-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 after test pytorch #8841
Comments
This is most certainly not an issue with pytest, but with your code under test (or rather one of your libraries, in native code) doing something wrong. Usually pytest's faulthandler should give you a stacktrace, but perhaps it was already disabled here at the point the crash happened. Can you try invoking |
@The-Compiler I have replaced the command with |
Hm, that's unfortunate. I'm assuming adding |
@The-Compiler It still no more detail, the case is here 😞 |
Perhaps you can run this snippet after pytest to give you a gdb stacktrace after the crash: #!/bin/bash
find . \( -name "*.core" -o -name core \) -exec gdb --batch --quiet -ex "thread apply all bt" "$(readlink -f $(which python3))" {} \;` or run Python under gdb directly: gdb --batch --quiet -ex r -ex "thread apply all bt" --args "$(readlink -f $(which python3))" -m pytest -p no:faulthandler -x toad/nn/module_test.py" not sure if those will work 1:1, I didn't really test them. |
@The-Compiler here is the gdb information |
This shows that the segfault happens at
Which looks like one of those PyTorch issues:
The first one seems like the closest one - it looks like it's been fixed in PyTorch 1.8, so you might want to try upgrading (according to your output you're still running 1.7.1). In any case, I'm closing this as it doesn't seem to specific to pytest in any way. |
@The-Compiler Thanks a lot! 👍 |
python 3.9, CentOS, I use
pytest
withpytorch
, after test case runs success, I gotSegmentation fault
error, here is the case in github actions.test case
pip list
from the virtual environment you are usingThe text was updated successfully, but these errors were encountered: