[issue35866] concurrent.futures deadlock

STINNER Victor report at bugs.python.org
Mon Jun 28 19:45:32 EDT 2021


STINNER Victor <vstinner at python.org> added the comment:

> #6  0x00007ffff7bc7712 in __pthread_unwind () from /lib64/libpthread.so.0
> #7  0x00007ffff7bbf7e7 in pthread_exit () from /lib64/libpthread.so.0
> #8  0x000000000051b2fc in PyThread_exit_thread () at Python/thread_pthread.h:238
> #9  0x000000000055ed16 in t_bootstrap (boot_raw=0x7fffe8da0e40) at ./Modules/_threadmodule.c:1021

The thread_run() function (previously "t_bootstrap()") which is the low-level C function to run a thread in Python _thread.start_new_thread() no longer calls PyThread_exit_thread(): see bpo-44434.

I'm able to reproduce the issue using attached cf-deadlock.py with Python 3.8:

* Run 3 processes running cf-deadlock.py 
* Run the Python test suite to stress the machine: ./python -m test -r -j4  # try different -j values to stess the machine more or less

In the main branch (with bpo-44434 fix), I can no longer reproduce the issue. I ran cf-deadlock.py in 4 terminals in parallel with "./python -m test -r -j2" in a 5th terminal for 5 minutes. I couldn't reproduce the issue. On Python 3.8, I reproduced the issue in less than 1 minute.

Can someone please confirm that the issue is now fixed? Can we mark this issue as a duplicate of bpo-44434?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35866>
_______________________________________


More information about the Python-bugs-list mailing list