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 vstinner
Recipients gvanrossum, pitrou, serhiy.storchaka, vstinner
Date 2014-02-11.17:30:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1392139849.35.0.189954964122.issue20526@psf.upfronthosting.co.za>
In-reply-to
Content
At the first CTRL+c, the main thread exit and enters Py_Finalize() which calls wait_for_thread_shutdown() (in Python: threading._shutdown()).

The problem is that the second call interrupted threading._shutdown() (still in the main thread).

> #9  0x000000000043d1d5 in PyGC_Collect () at Modules/gcmodule.c:1604
> #10 0x000000000041e959 in Py_Finalize () at Python/pythonrun.c:605

At this point, we can expect that only one Python thread is running because wait_for_thread_shutdown() has been called, but there are between 2 and 9 running Python threads.

If wait_for_thread_shutdown() is interrupted, maybe Python should kill all other threads with pthread_kill() or something like that.

Or wait_for_thread_shutdown() should maybe block SIGINT and SIGTERM signals using pthread_sigmark()?
History
Date User Action Args
2014-02-11 17:30:49vstinnersetrecipients: + vstinner, gvanrossum, pitrou, serhiy.storchaka
2014-02-11 17:30:49vstinnersetmessageid: <1392139849.35.0.189954964122.issue20526@psf.upfronthosting.co.za>
2014-02-11 17:30:49vstinnerlinkissue20526 messages
2014-02-11 17:30:49vstinnercreate