php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29816 use shmop_open 3 times make apache2 error
Submitted: 2004-08-24 16:01 UTC Modified: 2004-09-14 01:00 UTC
From: cedric_cefc2002 at yahoo dot com dot tw Assigned:
Status: No Feedback Package: Apache2 related
PHP Version: 5.0.1 OS: win2000
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-08-24 16:01 UTC] cedric_cefc2002 at yahoo dot com dot tw
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();
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-24 16:06 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.

And please, don't forget to provide the text of your "error".
 [2004-09-14 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 10:01:31 2024 UTC