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 eric.snow
Recipients eric.snow
Date 2019-01-11.21:04:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1547240687.08.0.242313450509.issue35724@roundup.psfhosted.org>
In-reply-to
Content
The code in Modules/signalsmodule.c (as well as a few other places in the code) has a concept of a "main" thread.  It's the OS thread where Py_Initialize() was called (and likely the process's original thread).  For various good reasons, we ensure that signal handling happens relative to that ("main") thread.

The problem is that we track the OS thread (by ID), which multiple interpreters can share.  What we really want is to track the original PyThreadState.  Otherwise signal-handling could happen (or handlers get added) in the wrong interpreter.

Options:
1. track the PyThreadState pointer instead of the OS thread ID
2. check that the current interpreter is the main one, in every place we check for the main thread

From what I can tell, the simpler option is #2.
History
Date User Action Args
2019-01-11 21:04:50eric.snowsetrecipients: + eric.snow
2019-01-11 21:04:47eric.snowsetmessageid: <1547240687.08.0.242313450509.issue35724@roundup.psfhosted.org>
2019-01-11 21:04:47eric.snowlinkissue35724 messages
2019-01-11 21:04:46eric.snowcreate