-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
faulthandler will hang the process with a TSAN and free-thread build Python #120696
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
This is in the free-threaded build? (I see |
Yes, I didn't try it without the free-threaded build, I'll try it now. |
The free-thread build doesn't have this issue. @colesbury |
Faulthandler has other issues with the free-threaded build as well. Dumping tracebacks for other threads is a lot more likely to itself crash when the GIL disabled. |
Sorry, I mean non free-thread build doesn't have this issue 😂 |
I think was fixed by #128400 |
Bug report
Bug description:
I tried to run the TSAN check on macOS: #120502
However, the
test_capi.test_mem
will hang indefinitely with the TSAN build on my local machine or on GHA: https://github.com/python/cpython/actions/runs/9517250225/job/26235426291?pr=120502After some investigation, I found that
test_pymem_malloc_without_gil
andtest_pyobject_malloc_without_gil
are causing the hang. These tests simply execute./python.exe -X faulthandler -c "import _testcapi; _testcapi.pymem_malloc_without_gil()"
under the hood.The call stack for the hung process:
I discovered that removing the
-X faulthandler
option resolves the hang. Another notable observation is that the hung process consumes 100% CPU time, but attaching lldb to it normalizes the CPU usage.CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
The text was updated successfully, but these errors were encountered: