From: wojtekm86 at konto dot pl Operating system: Linux PHP version: 5.2.0 PHP Bug Type: Semaphore related Bug description: loss of resources
Description: ------------ It's impossible to correct remove semaphores with sem_remove function when I use them to provide execution of concurrent processes. When the last process releases the semaphore I should be able to remove it. But I don't know if another process haven't acquired the semaphore. For safety reasons I don't remove released semaphores from system. Now, If I get 128 semaphores and I execute sem_get one more time I will get warning. So, I can't remove semaphores (because I don't know if another process is using it) and I can't get next semaphore. Reproduce code: --------------- $id = sem_get(SOME_ID); sem_acquire($id); HERE IS CRITICAL REGION sem_release($id); Expected result: ---------------- Expected result (and correct, I think) is removal of unused semaphore in sem_release function if another process didn't acquire it and isn't waiting for doing this. Release and Removal of semaphore should be one chain of instructions without possibility of separation (e.g. by interruption). Actual result: -------------- System reaches the maximum number of semaphores and warning is reported. The warning is: Warning: sem_get() [function.sem-get]: failed for key 0x5202e59f: No space left on device in /home/cicik/ftp/php-art/klasy/semafor.php on line 8 -- Edit bug report at http://bugs.php.net/?id=39987&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39987&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39987&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39987&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39987&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39987&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39987&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39987&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39987&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39987&r=support Expected behavior: http://bugs.php.net/fix.php?id=39987&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39987&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39987&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39987&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39987&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39987&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39987&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39987&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39987&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39987&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39987&r=mysqlcfg