ytrstu / pts-mini-gpl

Automatically exported from code.google.com/p/pts-mini-gpl
0 stars 0 forks source link

Unable to import multiprocessing queues with staticpython #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. $ ./python2.7-static
2. $ >>> from multiprocessing import queues

What is the expected output? What do you see instead?

>>> from multiprocessing import queues
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/proc/self/exe/multiprocessing/queues.py", line 22, in <module>
  File "/proc/self/exe/multiprocessing/synchronize.py", line 33, in <module>
ImportError: This platform lacks a functioning sem_open implementation, 
therefore, the required synchronization primitives needed will not function, 
see issue 3770.

What version of the product are you using? On what operating system?

Note that the python version on the host works fine importing this, so it'd be 
unlikely to be a host problem. Likely an issue with how python was built.

Original issue reported on code.google.com by kerg...@gmail.com on 28 Oct 2011 at 7:34

GoogleCodeExporter commented 9 years ago
Tried adding _multiprocessing/semaphore.c to the multiprocessing module sources 
in the Modules file at toplevel for 2.7 -- sadly not that easy.

Original comment by kerg...@gmail.com on 28 Oct 2011 at 8:11

GoogleCodeExporter commented 9 years ago
Thank you for submitting this bug report, thus letting me know about the 
problem.

For Python 2.7 on Linux, the configure script sets POSIX_SEMAPHORES_NOT_ENABLED 
to 1, possibly because of a non-working sem_init(3) implementation in uClibc 
used for compiling StaticPython. This needs further investigation, maybe it's 
possible to make it work.

For Python 3.2 we get another error message, related to dependencies and the 
semaphore.o file.

For Mac OS X, it needs further investigation whether we should use semaphore.c 
and whether it works.

Original comment by pts...@gmail.com on 29 Oct 2011 at 11:48

GoogleCodeExporter commented 9 years ago
Fixed in r281. The most important part of the fix was adding fixsemaphore() to 
build.sh, to prevent pyconfig.h from defining  POSIX_SEMAPHORES_NOT_ENABLED. It 
works on both Linux and Mac OS X now.

Again, thank you for reporting the problem, and thank you for writing a 
detailed bug report.

Original comment by pts...@gmail.com on 30 Oct 2011 at 11:59

GoogleCodeExporter commented 9 years ago
Thanks for the quick fix. Love the project, find it extremely useful, 
particularly on old hosts which are stuck on old python versions.

Original comment by kerg...@gmail.com on 30 Oct 2011 at 2:32