From:             
Operating system: linux 2.6.32
PHP version:      5.4.0
Package:          *General Issues
Bug Type:         Bug
Bug description:sem_get problem

Description:
------------
---
>From manual page:
http://www.php.net/function.sem-get#refsect1-function.sem-get-
description
---
The sem_get function don't work if the semaphore already exist : by example

created by an other application (made in C code). 
--> No sem_id returned.

If the php code is executed before this external application, the creation
and 
sharing runs correctly....

sem_get seems able to make a new semaphore.... but not take back the Id of
an 
existing semaphore.


Test script:
---------------
// On demande l’accès
$sem_id = sem_get(0x4d2, 1, 0666, 1);     <--- Return nothing             


// l'accès au block mémoire est autorisé
if(sem_acquire ($sem_id)) {                    
    $shm_id = shmop_open(0x4d2, "c", 0666, 200);
    if(!$shm_id) {
        echo "Impossible de creer la memoire partagee" . "<br />";
        // on libère l'accès 
        sem_remove($sem_id);
        exit;
    }
..... 

Expected result:
----------------
Be able to get back the sem_id of an exiting semaphore


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

Reply via email to