This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author methane
Recipients eric.smith, irmen, methane, pwp333, vstinner
Date 2016-11-27.07:38:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Where *exactly*?

See attached patch.
But python with this patch can deadlock in other state. Main thread wait GIL
but no other living threads have GIL. It seems caused by other issue around finalization and multithreading.

> Py_FinalizeEx() first calls wait_for_thread_shutdown() and *then* sets _Py_Finalizing to tstate.
> Does wait_for_thread_shutdown() complete on this bug?

Yes. wait_for_thread_shutdown() waits only daemon threads.
After _Py_Finalizing = tstate, main thread calls many __del__ methods
while shutdown. If one of them starts new thread, this deadlock happens.
Date User Action Args
2016-11-27 07:38:24methanesetrecipients: + methane, irmen, vstinner, eric.smith, pwp333
2016-11-27 07:38:24methanesetmessageid: <>
2016-11-27 07:38:24methanelinkissue28673 messages
2016-11-27 07:38:23methanecreate