Author neologix
Recipients Ringding, neologix, pitrou, vstinner
Date 2013-04-04.07:57:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
> Here is an updated patch.

_PyThreadState_DeleteExcept uses HEAD_LOCK: ISTM that
PyThreadState_Clear() can trigger arbitrary code execution: if a
thread ends up being created/destroyed, I think we can get a deadlock
when trying to acquire the head lock. I think it should be turned into
an open call if possible.

Also, as noted by Stefan, shouldn't we also iterate over other interpreters?

> Note that I think this patch could break some programs. For example, if you have a thread in your main process which has a database connection open, deleting the thread state in a child process might shutdown the database connection (depending on the exact protocol). Therefore, I think it would be better to only apply the patch in 3.4.

Indeed. For the database example, there's this other issue where the
database connection is stored in a thread-local storage... Some people
will definitely get bitten by this...
Date User Action Args
2013-04-04 07:57:24neologixsetrecipients: + neologix, pitrou, vstinner, Ringding
2013-04-04 07:57:23neologixlinkissue17094 messages
2013-04-04 07:57:23neologixcreate