php.net |  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: -
Votes:4
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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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
Description:
------------
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) ;
  sem_acquire($seg);
  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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 09 04:01:27 2024 UTC