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-25.13:39:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1480081154.73.0.735827907914.issue28673@psf.upfronthosting.co.za>
In-reply-to
Content
This script can cause deadlock on Python 3.6.

1. Other threads can register traceback to sys module after sys module dict is cleaned up.
2. In Py_Finalize, __del__ method of arbitrary object in the traceback can be called.
3. The __del__ method calls threading.Thread.start()
4. Thread.start() waits self.__started event which is set by Thread.__bootstrap
5. While finalizing, threads other than main thread exits when getting GIL. So Thread.__bootstrap() won't be called.
6. Thread.start() in main thread waits self.__started event forever.

I suggest thread_PyThread_start_new_thread() raise RuntimeError("can't start thread: finalizing")
History
Date User Action Args
2016-11-25 13:39:14methanesetrecipients: + methane, irmen, vstinner, eric.smith, pwp333
2016-11-25 13:39:14methanesetmessageid: <1480081154.73.0.735827907914.issue28673@psf.upfronthosting.co.za>
2016-11-25 13:39:14methanelinkissue28673 messages
2016-11-25 13:39:14methanecreate