Message152445
I thought about this a bit more, and I realized that a slight variation
of this bug also affects 2.7, and also older versions (i.e. before
_PyGILState_Reinit() was introduced), because any code that gets called
from PyOS_AfterFork() and uses the TLS API suffers from the same
problem.
I had the new test deadlock once, in theading._after_fork(): when trying
to acquire an (unlocked) lock, it got stuck in Py_END_ALLOW_THREADS,
which calls indirectly PyGILState_GetThisThreadState(), which calls
find_key().
Although less likely, this bug has been present for a *long* time, it's
surprising it had never been noticed before.
So the fix - calling PyThread_ReInitTLS() right at the beginning of PyOS_AfterFork() - should also be applied to 2.7.
I'll commit it tomorrow. |
|
Date |
User |
Action |
Args |
2012-02-01 22:12:08 | neologix | set | recipients:
+ neologix, pitrou, rosslagerwall, Martijn.van.Oosterhout, glaubich |
2012-02-01 22:12:08 | neologix | set | messageid: <1328134328.54.0.84386058306.issue13817@psf.upfronthosting.co.za> |
2012-02-01 22:12:07 | neologix | link | issue13817 messages |
2012-02-01 22:12:07 | neologix | create | |
|