Author Arfrever
Recipients Arfrever, jnoller, sbt
Date 2014-06-10.10:33:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1402396404.2.0.758262532851.issue21704@psf.upfronthosting.co.za>
In-reply-to
Content
When POSIX semaphores are disabled (e.g. by unmounting /dev/shm on a Linux system), then _multiprocessing module builds with undefined symbol _PyMp_sem_unlink:

$ ./configure ...
...
checking whether POSIX semaphores are enabled... no
...
$ make
...
building '_multiprocessing' extension
creating build/temp.linux-x86_64-3.5/tmp/cpython/Modules/_multiprocessing
x86_64-pc-linux-gnu-gcc -pthread -fPIC -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -march=core2 -O2 -fno-ident -pipe -ggdb3 -Wall -Wpointer-sign -IModules/_multiprocessing -I./Include -I. -IInclude -I/usr/local/include -I/tmp/cpython/Include -I/tmp/cpython -c /tmp/cpython/Modules/_multiprocessing/multiprocessing.c -o build/temp.linux-x86_64-3.5/tmp/cpython/Modules/_multiprocessing/multiprocessing.o
x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -Wl,--hash-style=gnu -Wl,--sort-common build/temp.linux-x86_64-3.5/tmp/cpython/Modules/_multiprocessing/multiprocessing.o -L. -L/usr/local/lib -lpython3.5m -o build/lib.linux-x86_64-3.5/_multiprocessing.cpython-35m.so
*** WARNING: renaming "_multiprocessing" since importing it failed: build/lib.linux-x86_64-3.5/_multiprocessing.cpython-35m.so: undefined symbol: _PyMp_sem_unlink
...
Following modules built successfully but were removed because they could not be imported:
_multiprocessing


This problem was introduced in Python 3.4. This problem is absent in older versions of Python.
Potential fix:

--- Modules/_multiprocessing/multiprocessing.c
+++ Modules/_multiprocessing/multiprocessing.c
@@ -129,5 +129,7 @@
     {"send", multiprocessing_send, METH_VARARGS, ""},
 #endif
+#ifndef POSIX_SEMAPHORES_NOT_ENABLED
     {"sem_unlink", _PyMp_sem_unlink, METH_VARARGS, ""},
+#endif
     {NULL}
 };
History
Date User Action Args
2014-06-10 10:33:24Arfreversetrecipients: + Arfrever, jnoller, sbt
2014-06-10 10:33:24Arfreversetmessageid: <1402396404.2.0.758262532851.issue21704@psf.upfronthosting.co.za>
2014-06-10 10:33:24Arfreverlinkissue21704 messages
2014-06-10 10:33:22Arfrevercreate