Possible bug in multiprocessing.Queue() on Ubuntu
Jerrad Genson
jerradgenson at gmail.com
Wed Nov 3 23:36:42 EDT 2010
Hello,
While working with the multiprocessing module in Python 2.6.6 on
Ubuntu 10.10 64-bit, the following exception was raised:
>>> import multiprocessing
>>> input_queue = multiprocessing.Queue()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/multiprocessing/__init__.py", line 213, in
Queue
return Queue(maxsize)
File "/usr/lib/python2.6/multiprocessing/queues.py", line 37, in
__init__
self._rlock = Lock()
File "/usr/lib/python2.6/multiprocessing/synchronize.py", line 117,
in __init__
SemLock.__init__(self, SEMAPHORE, 1, 1)
File "/usr/lib/python2.6/multiprocessing/synchronize.py", line 49,
in __init__
sl = self._semlock = _multiprocessing.SemLock(kind, value,
maxvalue)
OSError: [Errno 30] Read-only file system
The same exception was also raised in Python 3.1.2 on the same
platform:
>>> import multiprocessing
>>> input_queue = multiprocessing.Queue()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.1/multiprocessing/__init__.py", line 212, in
Queue
return Queue(maxsize)
File "/usr/lib/python3.1/multiprocessing/queues.py", line 37, in
__init__
self._rlock = Lock()
File "/usr/lib/python3.1/multiprocessing/synchronize.py", line 121,
in __init__
SemLock.__init__(self, SEMAPHORE, 1, 1)
File "/usr/lib/python3.1/multiprocessing/synchronize.py", line 49,
in __init__
sl = self._semlock = _multiprocessing.SemLock(kind, value,
maxvalue)
OSError: [Errno 30] Read-only file system
This also occurs in Ubuntu 10.04 64-bit, but it works just fine in
Ubuntu 10.10 32-bit. Out of curiosity, I downloaded the latest version
of the Python 3.2a3+ source from the official Subversion repository,
configured it for debugging mode, compiled, and ran the same commands.
>>> import multiprocessing
[66271 refs]
>>> input_queue = multiprocessing.Queue()
Traceback (most recent call last):
File "/home/jerrad/Development/py3k/Lib/multiprocessing/
synchronize.py", line 28, in <module>
from _multiprocessing import SemLock
ImportError: cannot import name SemLock
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jerrad/Development/py3k/Lib/multiprocessing/
__init__.py", line 212, in Queue
from multiprocessing.queues import Queue
File "/home/jerrad/Development/py3k/Lib/multiprocessing/queues.py",
line 22, in <module>
from multiprocessing.synchronize import Lock, BoundedSemaphore,
Semaphore, Condition
File "/home/jerrad/Development/py3k/Lib/multiprocessing/
synchronize.py", line 33, in <module>
" function, see issue 3770.")
ImportError: This platform lacks a functioning sem_open
implementation, therefore, the required synchronization primitives
needed will not function, see issue 3770.
[69570 refs]
After checking issue 3770 in Roundup, it appears this is a known issue
for FreeBSD and OpenBSD, but not for Ubuntu (and it works fine in 32-
bit Ubuntu!). I just want to ensure I'm not doing something stupid
before I submit this to the issue tracker.
More information about the Python-list
mailing list