-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Address Sanitizer: libasan dead lock in pthread_create() (test_multiprocessing_fork.test_get() hangs) #89363
Comments
https://github.com/python/cpython/pull/28344/checks?check_run_id=3605759743 test_get (test.test_multiprocessing_fork.WithProcessesTestQueue) ... Timeout (0:20:00)! |
test_multiprocessing_fork also failed on the GitHub Action "Address sanitizer" job: test_get (test.test_multiprocessing_fork.WithProcessesTestQueue) ... Timeout (0:20:00)! |
Sometimes, WithProcessesTestProcess.test_error_on_stdio_flush_1() hangs. |
I'm able to reproduce the issue in a reliable way using attached bisect10 file and the command: $ ./python -m test test_multiprocessing_fork --timeout=40 -v --matchfile=bisect10
(...)
test_fork (test.test_multiprocessing_fork.WithProcessesTestQueue) ... ok
test_get (test.test_multiprocessing_fork.WithProcessesTestQueue) ...
Timeout (0:00:40)!
Thread 0x00007fd0552025c0 (most recent call first):
File "/home/vstinner/python/main/Lib/multiprocessing/synchronize.py", line 261 in wait
File "/home/vstinner/python/main/Lib/multiprocessing/synchronize.py", line 349 in wait
File "/home/vstinner/python/main/Lib/test/_test_multiprocessing.py", line 1003 in test_get
(...) bisect10 contains 68 tests. |
I'm talking about a Python built with Address Sanitizer: $ ./configure --with-address-sanitizer --without-pymalloc
$ make |
When the test hangs, a background Python process starts to use 100% of my CPU. This process is stuck in _thread.start_new_thread(). I opened the process in gdb. (gdb) thread 1 (gdb) thread 2 The thread 1 is stuck at the loop at the end of pthread_create(), line 245 an 246: wait until ¶m.is_registered == 0. 210 INTERCEPTOR(int, pthread_create, void *thread, The thread 2 seems to be stuck in a syscall done by __sanitizer::atomic_exchange<__sanitizer::atomic_uint32_t>, called by __sanitizer::BlockingMutex::Lock: (gdb) disassemble |
That's an Address Sanitizer job. Pablo: would it be possible to make the Address Sanitizer not mandatory on pull requests, until this libasan race condition is fixed? |
I don't think that's a good idea because then people will simply ignore it. |
I understand what you mean and I sympathize with it, but this is no different to random failures that we get in the other CI. The check is not failing constantly because otherwise no PRs could be merged and that's not what is happening. I understand your points but my concerns remain: I don't think that's a good idea because then people will simply ignore it. |
I'm fine with keeping a failing test if it's under our (Python) control. Here, it's a 3rd party issue. I cannot offer my help to fix libasan, but it will take time. I didn't check the error rate of this issue. Usually, I'm not sure why, but I'm the one affected by every single test which fails randomly :-D |
If you wish, as a compromise we can ignore multiprocessing tests on ASAN build for now and leave them for the buildbots. |
I reopen the issue: test_concurrent_futures seems to be also affected by this bug :-( Example of recent hang: --- OK (skipped=6) == Tests result: FAILURE then SUCCESS == 409 tests OK. 10 slowest tests:
9 tests skipped: 1 re-run test: |
Skip test_is_alive_after_fork() of test_threading if Python is built with Address Sanitizer (ASAN).
…thonGH-109835) Skip test_is_alive_after_fork() of test_threading if Python is built with Address Sanitizer (ASAN). (cherry picked from commit bc06743) Co-authored-by: Victor Stinner <[email protected]>
Skip test_is_alive_after_fork() of test_threading if Python is built with Address Sanitizer (ASAN).
…thonGH-109835) Skip test_is_alive_after_fork() of test_threading if Python is built with Address Sanitizer (ASAN). (cherry picked from commit bc06743) Co-authored-by: Victor Stinner <[email protected]>
…thon#109835) Skip test_is_alive_after_fork() of test_threading if Python is built with Address Sanitizer (ASAN).
…thon#109835) Skip test_is_alive_after_fork() of test_threading if Python is built with Address Sanitizer (ASAN).
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: