From: iddekingej at lycos dot com
Operating system: Linux
PHP version: 5.3.0RC2
PHP Bug Type: Scripting Engine problem
Bug description: Possible memory corruption
Description:
------------
The included example code was made for finding the reason
php5.3RC2/apache2 crashed with some php website (the websie is not publicly
available). The script didn't crash apache but failed differently.
The script should fail with a 'undefined variable', it does but it also
displays the message "Fatal error: Allowed memory size of 536870912 bytes
exhausted (tried to allocate 140498868988960 bytes) in Unknown on line 0".
(The large number is probably a memory location).
This error only happens in the following situation:
* as a web page (CLI works OK)
* restart apache
* Load the page and the memory exhausted message is displayed.
* Reload the page and no "memory exhausted" message
Software/machine:
* 64Bit amd
* Kubuntu 8.10
* Apache 2.2.9
* PHP(5.3RC2) compiled with :
'./configure' '--enable-zip' '--enable-soap' '--enable-sockets'
'--with-gd' '--with-pgsql' '--with-apxs2=/usr/bin/apxs2' '--with-gettext'
'--enable-cli' '--enable-mbstring'
Reproduce code:
---------------
<?
function ex_handler($p_exception)
{
?> Error:<i><?=$p_exception->getMessage()?></i><br/><br/><?
}
function
er_handler($p_errorno,$p_errstr,$p_errfile,$p_errline,$p_context)
{
$l_exception=new Exception("Error $p_errorno at $p_errline in
'$p_errfile':$p_errstr");
throw $l_exception;
}
set_Exception_Handler("ex_handler");
set_Error_Handler("er_handler",E_STRICT|E_WARNING|E_ALL|E_ERROR|E_NOTICE);
class aa
{
function check($p_a,$p_b,$p_c)
{
echo $p_a;
}
function dosome($p_b,$p_d,$p_e,$p_f,$p_g,$p_h)
{
return
$this->check(3,3,array("xx"=>$p_b,"xzx"=>$p_d,"xx"=>$p_e,"yy"=>$p_c));
}
}
$l_aa=new aa();
$l_aa->dosome('2',"33333333333333333","4","5",'sddddddddddddddddddddddd','ddddddddddddddddddd');
?>
Expected result:
----------------
* Undefined variable
Actual result:
--------------
* Undefined variable
* "Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to
allocate 140498868988960 bytes) in Unknown on line 0".
--
Edit bug report at http://bugs.php.net/?id=48228&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48228&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48228&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48228&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48228&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48228&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48228&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48228&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48228&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48228&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48228&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48228&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48228&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48228&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48228&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48228&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48228&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48228&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48228&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48228&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48228&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48228&r=mysqlcfg