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.

classification
Title: configure test for posix_semaphore capability leaves semaphore behind, causing test to fail for other users
Type: compile error Stage: resolved
Components: Interpreter Core Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: mark.dickinson, r.david.murray
Priority: high Keywords: easy

Created on 2009-12-13 20:53 by r.david.murray, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (7)
msg96352 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-12-13 20:53
autoconf tries to open a semaphore (/autoconf) to find out if posix
semaphores are available and working.  On linux, a file 'sem.autoconf'
is left behind in /dev/shm, owned by the user running autoconf.  If any
other user on the system compiles python, the autoconf tests will fail
to open this file (which is rw to the owner only), and the resulting
python will claim that the system has a broken semaphore implementation.
msg96353 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-12-13 21:01
According to the linux man page, to delete the named semaphore after all
processes are done with it one must call sem_unlink on it.  So an unlink
call should be added to both autoconf tests that use sem_open.
msg96356 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-12-13 21:21
I've added the calls to sem_unlink in r76813 (trunk), r76815 (py3k) and 
r76821 (release31-maint).  I also changed the name of the semaphore for 
the second sem_open, so that we can tell which test is leaving files 
behind if it happens again in the future.

David, could you check whether this fixes the problem on linux?
msg96363 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-12-13 22:19
Yes, it does.  Thanks.
msg96365 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-12-13 22:23
Thanks, David!
msg96509 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-12-17 09:09
The configure test for enabled POSIX semaphores is now failing for me on 
OS X 10.6:  the test produces

sem_open: Permission denied
msg96752 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-12-21 14:43
This seems to be fixed;  I think I must have had a stale semaphore lying 
around, from while I was experimenting with the original problem.
History
Date User Action Args
2022-04-11 14:56:55adminsetgithub: 51746
2009-12-21 14:43:29mark.dickinsonsetstatus: open -> closed

messages: + msg96752
2009-12-17 09:09:16mark.dickinsonsetstatus: closed -> open
assignee: mark.dickinson
messages: + msg96509
2009-12-13 22:23:22mark.dickinsonsetstatus: open -> closed
resolution: fixed
messages: + msg96365

stage: needs patch -> resolved
2009-12-13 22:19:15r.david.murraysetmessages: + msg96363
2009-12-13 21:21:30mark.dickinsonsetmessages: + msg96356
versions: + Python 3.1
2009-12-13 21:01:52r.david.murraysettitle: configure test for posix_semaphore capability leaves semaphore behind, on linux causing test to fail for other users -> configure test for posix_semaphore capability leaves semaphore behind, causing test to fail for other users
2009-12-13 21:01:05r.david.murraysetmessages: + msg96353
2009-12-13 20:53:13r.david.murraycreate