Charles-François Natali <neolo...@free.fr> added the comment: 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.
---------- Added file: http://bugs.python.org/file24389/reinit_tls_27.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13817> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com