|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52701 sem_get with auto_release=0 is released in case of shutdown
Submitted: 2010-08-25 21:00 UTC Modified: -
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:0 (0.0%)
From: dominique dot fournier at grenoble dot cnrs dot fr Assigned:
Status: Open Package: Semaphore related
PHP Version: 5.3.3 OS: Ubuntu 10.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: dominique dot fournier at grenoble dot cnrs dot fr
New email:
PHP Version: OS:


 [2010-08-25 21:00 UTC] dominique dot fournier at grenoble dot cnrs dot fr
If I write a program with a sem_get and auto_release=0, in case of shutdown, an other program should not be available to take the semaphore.

Launch two times the following script (in cli in my case).
Kill the first with Ctrl+C within 10 secs. The second display "Acquire".

PHP Version : Ubuntu 5.3.2-1ubuntu4.2

Test script:
 $seg = sem_get("123554", 1, 0666, 0) ;
  echo "Acquire\n";
  sleep (10);

Expected result:
Don't display "Acquire" and stay pending until I remove the semaphore by another way.

If you remove the sleep, you shouldn't be available to run the script 2 times : the first display Acquire, and the second should wait until the semaphore is removed.

Actual result:
Display "Acquire" and then enter in sleep 10.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 10:01:31 2024 UTC