Message139068
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. |
|
Date |
User |
Action |
Args |
2011-06-25 14:17:18 | avian | set | recipients:
+ avian, pitrou, pajs@fodder.org.uk, jnoller, asksol |
2011-06-25 14:17:18 | avian | set | messageid: <1309011438.3.0.914077996362.issue7123@psf.upfronthosting.co.za> |
2011-06-25 14:17:17 | avian | link | issue7123 messages |
2011-06-25 14:17:17 | avian | create | |
|