[New-bugs-announce] [issue5912] import deadlocks when using fork

ayal baron report at bugs.python.org
Sun May 3 13:50:28 CEST 2009


New submission from ayal baron <ayal.baron at rocketier.com>:

While running 2 or more threads, if one thread is importing anything
(i.e. has the import lock) and the other thread runs fork and then the
child process runs import then the child and parent will hang forever
(the child waits on the import lock but the parent receives the signal).
see Issue1590864 for another example of this.
Following is a simple way to reproduce this behavior:

mysleep.py:
import time
time.sleep(1)

run_me_and_hang.py:
import os
import threading
import subprocess
class F(threading.Thread):
	def run(self):
		import mysleep
		print "f is out"
f = F()
f.start()
a = subprocess.call(["echo", "DONE"])
print "exit"

----------
components: None
messages: 87044
nosy: abaron
severity: normal
status: open
title: import deadlocks when using fork
type: crash
versions: Python 2.4, Python 2.5, Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5912>
_______________________________________


More information about the New-bugs-announce mailing list