[issue23309] Hang on interpreter shutdown if daemon thread prints to stdout

2015-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Fix pushed! closing. -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23309 ___

[issue23309] Hang on interpreter shutdown if daemon thread prints to stdout

2015-04-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2c53a5302058 by Antoine Pitrou in branch '3.4': Issue #23309: Avoid a deadlock at shutdown if a daemon thread is aborted https://hg.python.org/cpython/rev/2c53a5302058 New changeset 8a3da91737cf by Antoine Pitrou in branch 'default': Issue #23309:

[issue23309] Hang on interpreter shutdown if daemon thread prints to stdout

2015-03-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch with tests. -- Added file: http://bugs.python.org/file38549/bufio_lock_finalizing_fatal_error2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23309

[issue23309] Hang on interpreter shutdown if daemon thread prints to stdout

2015-03-09 Thread Marien Zwart
Marien Zwart added the comment: I'm afraid I don't have real-world code I can confirm is fixed, since I reported this on behalf of someone on irc in #python. I think I'd prefer the Py_FatalError version of the patch. It's definitely possible to see writes to stdout/stderr at this time. If I

[issue23309] Hang on interpreter shutdown if daemon thread prints to stdout

2015-03-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you for the feedback. Yes, I now also think the fatal error is the preferrable way. I'll see if I can add a reliable test. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23309

[issue23309] Hang on interpreter shutdown if daemon thread prints to stdout

2015-03-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: Attached patch is stricter and dumps a fatal error after the grace period. -- Added file: http://bugs.python.org/file38392/bufio_lock_finalizing_fatal_error.patch ___ Python tracker rep...@bugs.python.org

[issue23309] Hang on interpreter shutdown if daemon thread prints to stdout

2015-03-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: (note that trying to print a warning or raise an error only makes things worse if the stream subject to deadlock is stderr) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23309

[issue23309] Hang on interpreter shutdown if daemon thread prints to stdout

2015-03-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: Your analysis sounds right to me. -- nosy: +tim.peters ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23309 ___

[issue23309] Hang on interpreter shutdown if daemon thread prints to stdout

2015-03-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: A possible solution is to tweak the IO lock acquire on shutdown: only wait for a grace period instead of waiting indefinitely. Attached patch demonstrates the solution (and solves the deadlock issue in your script). -- keywords: +patch nosy: +neologix

[issue23309] Hang on interpreter shutdown if daemon thread prints to stdout

2015-03-08 Thread Mark Lawrence
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23309 ___ ___ Python-bugs-list

[issue23309] Hang on interpreter shutdown if daemon thread prints to stdout

2015-01-24 Thread Marien Zwart
New submission from Marien Zwart: A script spawning a single daemon thread calling print() in a loop (like the attached) will usually hang on shutdown in Python 3.4.2 and hg rev 8d802fb6ae32. Attaching gdb at that point shows the following: (gdb) thread apply all bt Thread 1 (Thread