From:             cedric_cefc2002 at yahoo dot com dot tw
Operating system: win2000
PHP version:      5.0.1
PHP Bug Type:     Apache2 related
Bug description:  use shmop_open 3 times make apache2 error 

Description:
------------
<?php
/*$shm_id = shmop_open(0xff3,"c",0,0);
if ($shm_id) {
   $shm_size = shmop_size($shm_id);
   $my_string = shmop_read($shm_id, 0, $shm_size);
   $cache=serialize($my_string);
    shmop_close($shm_id);       
}*/ make error
//print_r($cache);      
$name="shm1.php";
$time1=filectime($name);
 if(isset($cache[$name])){
         if($cache[$name]['time']==$time1){
            $shm_id = shmop_open($cache[$name]['key'],"c",0,0);
        $shm_size = shmop_size($shm_id);
        $my_string = shmop_read($shm_id, 0, $shm_size);
        echo $my_string;
        shmop_close($shm_id);
        clearstatcache ( void );
        exit;
         }
 }
 $d=file_get_contents($name);
 $i=strlen($d);
 $c=count($cache);
 echo $d;

 $shm_id = shmop_open((int)$c,"c",0644,$i);
 $shm_bytes_written = shmop_write($shm_id, $d,0); 
 shmop_close($shm_id);
  
 //echo "<pre>".$d."</pre>";
 $a['time']=filectime($name);
 $a['key']=$c;
 $cache[$name]=$a;
 print_r($cache);

 //echo $cache[$name]['time'];
 //echo filectime($name);
 //$cache
 $d=serialize($cache);
 // echo "<pre>".$d."</pre>";
 $i=strlen($d);
 $shm_id = shmop_open(0xff3,"c",0644,$i);
 $shm_bytes_written = shmop_write($shm_id, $d,0); 
 shmop_close($shm_id);
 
 clearstatcache();
?>


-- 
Edit bug report at http://bugs.php.net/?id=29816&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=29816&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=29816&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=29816&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=29816&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=29816&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=29816&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=29816&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=29816&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=29816&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=29816&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=29816&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=29816&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=29816&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=29816&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=29816&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=29816&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=29816&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=29816&r=float

Reply via email to