[New-bugs-announce] [issue6337] multiprocessing module: Double close of sys.stdin - ID: 2811568

Alexey Akimov report at bugs.python.org
Wed Jun 24 16:32:45 CEST 2009

New submission from Alexey Akimov <subdir at gmail.com>:

Double close of FD 0 when child process spawns its own child process.
Bug causes wrong file descriptors to be closed.
Bug affects only posix system.

How to reproduce:

>>> import multiprocessing as mp
>>> def child(q):
... print 'current process:', mp.current_process().name
... q.put(1)
... q.get()
... p = mp.Process(None, child, args=(mp.Queue(),))
... p.start()
>>> q = mp.Queue()
>>> child(q)
current process: MainProcess
current process: Process-1
current process: Process-1:1
Process Process-1:1:
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/multiprocessing/process.py", line
236, in _bootstrap
File "/usr/lib/python2.5/site-packages/multiprocessing/process.py", line
93, in run
self._target(*self._args, **self._kwargs)
File "<stdin>", line 4, in child
File "/usr/lib/python2.5/site-packages/multiprocessing/queues.py", line
91, in get
res = self._recv()
IOError: [Errno 9] Bad file descriptor

components: Extension Modules, Library (Lib)
files: multiprocessing.patch
keywords: patch
messages: 89666
nosy: subdir
severity: normal
status: open
title: multiprocessing module: Double close of sys.stdin - ID: 2811568
versions: Python 2.4, Python 2.5, Python 2.6
Added file: http://bugs.python.org/file14354/multiprocessing.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list