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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Thu Nov 21 15:01:30 2024 UTC