Bug #52701 [NEW]: sem_get with auto_release=0 is released in case of shutdown

From: Date: Wed, 25 Aug 2010 19:00:44 +0000
Subject: Bug #52701 [NEW]: sem_get with auto_release=0 is released in case of shutdown
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-153791@lists.php.net to get a copy of this message
From:             
Operating system: Ubuntu 10.04
PHP version:      5.3.3
Package:          Semaphore related
Bug Type:         Bug
Bug description:sem_get with auto_release=0 is released in case of shutdown

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.

-- 
Edit bug report at http://bugs.php.net/bug.php?id=52701&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=52701&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=52701&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=52701&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=52701&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52701&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=52701&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=52701&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=52701&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=52701&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=52701&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=52701&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=52701&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=52701&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=52701&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52701&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52701&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=52701&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=52701&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=52701&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=52701&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=52701&r=mysqlcfg



Thread (1 message)

  • dominique dot fournier at grenoble dot cnrs dot fr
« previous php.bugs (#153791) next »