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 avian
Recipients asksol, avian, jnoller, pajs@fodder.org.uk, pitrou
Date 2011-06-25.14:17:17
SpamBayes Score 6.715678e-11
Marked as misclassified No
Message-id <1309011438.3.0.914077996362.issue7123@psf.upfronthosting.co.za>
In-reply-to
Content
I am pretty sure this is another instance of issue 6721.

multiprocessing is forking a new process and if that happens while the other thread is holding the lock for stdout, the process will deadlock because the lock state is replicated in the subprocess while the thread that is supposed unlock it isn't (even if you remove all prints, the deadlock will happen on a stdout flush).

Attaching a gdb to a hung subprocess confirms that it is waiting for a lock in the bufferedio module.

I've reproduced this on Python trunk running on Linux (using pthreads) and can confirm that the patch attached to issue 6721 fixes it.

I'm also attaching a shorter test case that omits unused code from the original example.
History
Date User Action Args
2011-06-25 14:17:18aviansetrecipients: + avian, pitrou, pajs@fodder.org.uk, jnoller, asksol
2011-06-25 14:17:18aviansetmessageid: <1309011438.3.0.914077996362.issue7123@psf.upfronthosting.co.za>
2011-06-25 14:17:17avianlinkissue7123 messages
2011-06-25 14:17:17aviancreate