[issue18418] Thread.isAlive() sometimes True after fork

2013-09-08 Thread koobs
koobs added the comment: For reference, this test is successfuly identifying failures on koobs-freebsd and koobs-freebsd10 buildbots: == FAIL: test_is_alive_after_fork (test.test_threading.ThreadTests)

[issue18418] Thread.isAlive() sometimes True after fork

2013-09-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've identified a possible cause (and fix) for the sporadic test failures in 74dc664ad699. If the solution holds, it should be backported to 3.3 and 2.7. -- ___ Python tracker rep...@bugs.python.org

[issue18418] Thread.isAlive() sometimes True after fork

2013-08-31 Thread Charles-François Natali
Charles-François Natali added the comment: The final patch includes tests that are very reliable at revealing the bug in 2.7 and 3.3. Indeed, I could reproduce it systematically without the patch. Thanks for accepting this patch! Well, thanks for the patch! -- resolution: - fixed

[issue18418] Thread.isAlive() sometimes True after fork

2013-08-30 Thread Charles-François Natali
Changes by Charles-François Natali cf.nat...@gmail.com: -- nosy: +pitrou stage: patch review - commit review versions: +Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18418

[issue18418] Thread.isAlive() sometimes True after fork

2013-08-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well... I can't say anything except that the patch looks harmless. It's a pity the test failure is hard to trigger, though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18418

[issue18418] Thread.isAlive() sometimes True after fork

2013-08-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset ba54011aa295 by Charles-François Natali in branch '2.7': Issue #18418: After fork(), reinit all threads states, not only active ones. http://hg.python.org/cpython/rev/ba54011aa295 New changeset 29fce7f31539 by Charles-François Natali in branch

[issue18418] Thread.isAlive() sometimes True after fork

2013-08-30 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: Thanks for accepting this patch! Antoine, I initially had trouble writing a test that reliably reproduced the bug, especially in Python 3.3. But I read other threading tests and got smarter. The final patch includes tests that are very reliable at

[issue18418] Thread.isAlive() sometimes True after fork

2013-08-18 Thread Charles-François Natali
Changes by Charles-François Natali cf.nat...@gmail.com: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18418 ___ ___

[issue18418] Thread.isAlive() sometimes True after fork

2013-08-18 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: FYI I'm going on vacation again 8/20 through 8/25. I'll check in again as soon as I return to see if there's anything else I should do. -- ___ Python tracker rep...@bugs.python.org

[issue18418] Thread.isAlive() sometimes True after fork

2013-08-10 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: Bump. I think my most recent patch (August 4) addresses all of Charles-François's comments. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18418

[issue18418] Thread.isAlive() sometimes True after fork

2013-08-04 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: I'm back from a Zen retreat--no email!--will address your comments momentarily. On Fri, Aug 2, 2013 at 3:07 AM, Charles-François Natali rep...@bugs.python.org wrote: Charles-François Natali added the comment: I've posted another review (not sure you

[issue18418] Thread.isAlive() sometimes True after fork

2013-08-04 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: New patch for 3.3 branch after Charles-François's critique: use _enumerate() where appropriate, and join the test thread before finishing the test. -- Added file: http://bugs.python.org/file31153/issue18418-3.patch

[issue18418] Thread.isAlive() sometimes True after fork

2013-08-02 Thread Charles-François Natali
Charles-François Natali added the comment: I've posted another review (not sure you receive notifications). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18418 ___

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-26 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: By the way, I'm going on vacation through August 4. When I return I'll check if there's anything else I need to do to help resolve this. On Thursday, July 25, 2013, A. Jesse Jiryu Davis wrote: A. Jesse Jiryu Davis added the comment: (Sorry about the

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-25 Thread Charles-François Natali
Charles-François Natali added the comment: Bump. Did you see my review at http://bugs.python.org/review/18418/#ps8668 ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18418 ___

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-25 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: Oh, no I didn't. I'm learning how this system works. I'll respond there soon. Thanks On Thursday, July 25, 2013, Charles-François Natali wrote: Charles-François Natali added the comment: Bump. Did you see my review at

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-25 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: New patch for 3.3 branch after Charles-François's critique: instead of changing startup sequence in Thread._bootstrap_inner, stop all threads in _limbo after a fork. -- Added file: http://bugs.python.org/file31035/issue18418-2.patch

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-25 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: (Sorry about the extraneous XML file from my IDE, I made a mistake and allowed the diff to include it.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18418

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-22 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: Bump. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18418 ___ ___ Python-bugs-list mailing list

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-15 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: Charles-François, I agree that many guarantees are impossible to enforce in a multithreaded application that calls fork(). But the threading module does try to guarantee, after a fork, that isAlive() is False for all threads but one. I claim that it can

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-15 Thread Gregory P. Smith
Gregory P. Smith added the comment: This patch makes sense to me. I've gone over the code and I cannot spot any adverse effects. I was wondering in particular if anything would be surprised to find a non-started thread in _active within the short window where that will be true but nothing

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-15 Thread Charles-François Natali
Charles-François Natali added the comment: If you want a consistent reproducible test case for this I believe you will need to replace the Thread object's __started with a test wrapper who's set() method blocks waiting for for the fork to have happened before doing the actual set(). That

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-15 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: Patch #2: * Add comment before .set() as requested. * setcheckinterval(0) and try 20 times to repro the bug, inspired by test_enumerate_after_join. This reliably repros in 2.7.5. -- Added file:

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-15 Thread A. Jesse Jiryu Davis
Changes by A. Jesse Jiryu Davis je...@emptysquare.net: Added file: http://bugs.python.org/file30935/fix_is_alive_and_fork_python_33.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18418 ___

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-12 Thread Charles-François Natali
Charles-François Natali added the comment: 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

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-09 Thread A. Jesse Jiryu Davis
New submission from A. Jesse Jiryu Davis: In threading.Thread.__bootstrap_inner(), the thread sets self.__started before adding itself to the _active collection. If a different thread forks between these two operations, we're left with a thread that believes it's alive although it isn't.

[issue18418] Thread.isAlive() sometimes True after fork

2013-07-09 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +gregory.p.smith, sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18418 ___ ___