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 neologix
Recipients emptysquare, gregory.p.smith, neologix, sbt
Date 2013-07-12.08:22:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1373617356.73.0.101512642975.issue18418@psf.upfronthosting.co.za>
In-reply-to
Content
This is just a special-case of the more general problem of forking() in a multi-threaded program (see #16500 and #6721).
Since fork() can occur at any time, even though your data structures are protected by locks, they can end up in an inconsistent state in the child process. There's nothing we can do about it, and it affects *every code that's not atomic*.
For example, even though your patch fixes this specific issue, you can still end up with the thread both in _active and _limbo at the same time (which shouldn't be a problem since both are cleared after fork(), but still).

OTOH, the patch is simple and safe, so it might be interesting (another maybe better approach would be to also iterate over _limbo in _after_fork()).

As for the reproduction in 3.3, you're probably having trouble to reproduce it because of the GIL change. You might want to play with sys.setswitchinterval().
History
Date User Action Args
2013-07-12 08:22:36neologixsetrecipients: + neologix, gregory.p.smith, sbt, emptysquare
2013-07-12 08:22:36neologixsetmessageid: <1373617356.73.0.101512642975.issue18418@psf.upfronthosting.co.za>
2013-07-12 08:22:36neologixlinkissue18418 messages
2013-07-12 08:22:36neologixcreate