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 ita1024
Recipients ggenellina, gregory.p.smith, gvanrossum, ita1024, jba, loewis, therve
Date 2011-10-31.10:22:43
SpamBayes Score 0.000408854
Marked as misclassified No
Message-id <1320056564.29.0.110558034625.issue1336@psf.upfronthosting.co.za>
In-reply-to
Content
The following piece of code does not seem to be thread-safe:

gc.disable()
try:
    os.fork()
except:
    ...

If calling subprocess.Popen() is supposed to work from threads without any particular protection, then a lock is needed in subprocess.py:

try:
   spawn_lock.acquire()
   gc.disable()
   try:
       os.fork()
   except:
       ...
finally:
   spawn_lock.release()

Such issues are very difficult to reproduce and to track. The documentation should at least mention that calling gc.enable() may cause subprocess() to hang!

The following issue seems to be relevant: http://bugs.python.org/issue12739
History
Date User Action Args
2011-10-31 10:22:44ita1024setrecipients: + ita1024, gvanrossum, loewis, gregory.p.smith, ggenellina, therve, jba
2011-10-31 10:22:44ita1024setmessageid: <1320056564.29.0.110558034625.issue1336@psf.upfronthosting.co.za>
2011-10-31 10:22:43ita1024linkissue1336 messages
2011-10-31 10:22:43ita1024create