Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault (core dumped) when putting items in Index #215

Closed
kamcio181 opened this issue Apr 20, 2021 · 4 comments
Closed

Segmentation fault (core dumped) when putting items in Index #215

kamcio181 opened this issue Apr 20, 2021 · 4 comments

Comments

@kamcio181
Copy link

Hello,

first of all I really appreciate your work and tool you have created. Currently I am trying to create a PoC using keyvi but I am facing following issue.
I have decided to put some data in one batch in order to create as few files as possible. I am using python so I cannot verify the issue by calling C++ code directly but it seems that error returned Segmentation fault (core dumped) is related to C++ part.
Basically I am trying to create 100300 items Index. Interesting part is that when I try to create i.e. 200300 items Index the issue is not occurring. You can find repro script below.
Any help will be appreciated.

from keyvi._core import Index
def run_repro():
    index = Index('repro')
    data = [(str(i), 'test') for i in range(100300)] # 
    index.MSet(data)
    index.Flush()
if __name__ == '__main__':
    run_repro()

best regards,
Kamil

@hendrikmuhs
Copy link
Contributor

Thanks for the report, I can reproduce it.

From a quick look I see a memory corruption as the issue, I will take a closer look tomorrow.

@hendrikmuhs
Copy link
Contributor

@kamcio181

I debugged your issue and was able to create a standalone example that triggers the crash in boost parallel stable sort. This sort is used only in the index compiler for > 10000 keys.

I opened boostorg/sort#54.

@kamcio181
Copy link
Author

@hendrikmuhs
Thank you for quick response and information.

hendrikmuhs added a commit to hendrikmuhs/keyvi-1 that referenced this issue Apr 28, 2021
hendrikmuhs added a commit that referenced this issue Apr 30, 2021
switch the parallel sorting algorithm. This fixes the segfault reported in #215.

relates #215
@hendrikmuhs
Copy link
Contributor

@kamcio181

I switched the parallel sorting algorithm to the other one provided in boost sort and released a new version 0.5.2. The issue is fixed, however I created an enhancement issue as follow up: #219.

I hope this fixes it for you, don't hesitate to report further problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants