-
Notifications
You must be signed in to change notification settings - Fork 24.1k
[Bug] Segmentation fault when importing sentencepiece (with v0.4.0) #8358
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
Comments
I can't repro on master with debug build. |
Getting a segfault on 0.5.0a0+f9633b9 when importing sentencepiece before torch.nn. |
How did you install sentencepiece? What version of it do you have? |
sentencepiece Python wrapper version 0.0.9, installed via pip sentencepiece itself installed from source, looking at the date it should be this commit google/sentencepiece@c08f9c1 |
Python wrapper via pip for Ubuntu 16.04.4 LTS. |
@ryonakamura Can you try |
$ gdb python
Program received signal SIGSEGV, Segmentation fault. |
@ssnl
Program received signal SIGSEGV, Segmentation fault. |
@ryonakamura @bheinzerling Thank you for traces! We'll look into this. |
Isn't this likely to be caused by the gcc versions again?
Indeed, I get the segfault when using that but it goes away when I compile my own with GCC 5. |
@t-vi Ah seems like that is the reason indeed! |
@t-vi Thank you!!! I didn't look into it too much once I realized that this is not the pybind11 problem. |
@bheinzerling @ryonakamura See @t-vi 's comment above. PyTorch binaries are compiled with gcc 4.9.2. However, gcc before and after that version are not incompatible. Hence the segfault you see when pulling them into the same address space. Using a sentencepiece compiled with later gcc will solve the issue. |
@t-vi Awesome to hear compiling with GCC 5 works! I'm super close to getting a working wheel compiled, but I ran into the following error when I run Seems related to needing to run |
Good news, looks like @taku910 found the source of the bug (incompatibility around std::call_once and pthread_once involving protobuf) and is releasing a patch soon: google/sentencepiece#186 |
The following snippet reproduces a bug.
error:
This bug doesn’t occur at v0.3.1, it occurs at v0.4.0.
The text was updated successfully, but these errors were encountered: