From: [EMAIL PROTECTED]
Operating system:
PHP version: 5.3CVS-2008-09-17 (CVS)
PHP Bug Type: Scripting Engine problem
Bug description: Memory leaks when using global statement
Description:
------------
See below.
Reproduce code:
---------------
<?php
$foo = array(1);
function foobar($errno, $errstr, $errfile, $errline) { }
set_error_handler('foobar');
function test($x) {
global $foo;
$x->invokeArgs(array(0));
}
$x = new ReflectionFunction('str_pad');
test($x);
Actual result:
--------------
/home/felipe/dev/php5/Zend/zend_vm_execute.h(4047) : Freeing 0x08C23230
(20 bytes), script=/home/felipe/public_html/bug.php
[Wed Sep 17 11:46:07 2008] Script: '/home/felipe/public_html/bug.php'
/home/felipe/dev/php5/Zend/zend_vm_execute.h(4078) : Freeing 0x08C2392C
(35 bytes), script=/home/felipe/public_html/bug.php
/home/felipe/dev/php5/Zend/zend_hash.c(388) : Actual location (location
was relayed)
[Wed Sep 17 11:46:07 2008] Script: '/home/felipe/public_html/bug.php'
/home/felipe/dev/php5/Zend/zend_vm_execute.h(4092) : Freeing 0x08C24150
(32 bytes), script=/home/felipe/public_html/bug.php
/home/felipe/dev/php5/Zend/zend_alloc.c(2391) : Actual location (location
was relayed)
Last leak repeated 1 time
[Wed Sep 17 11:46:07 2008] Script: '/home/felipe/public_html/bug.php'
/home/felipe/dev/php5/Zend/zend_execute.c(737) : Freeing 0x08C241A0 (20
bytes), script=/home/felipe/public_html/bug.php
[Wed Sep 17 11:46:07 2008] Script: '/home/felipe/public_html/bug.php'
/home/felipe/dev/php5/Zend/zend_vm_execute.h(482) : Freeing 0x08C258B4
(20 bytes), script=/home/felipe/public_html/bug.php
=== Total 6 memory leaks detected ===
--
Edit bug report at http://bugs.php.net/?id=46106&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46106&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46106&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46106&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46106&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=46106&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46106&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46106&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46106&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46106&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46106&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=46106&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=46106&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46106&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46106&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46106&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46106&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46106&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46106&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46106&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46106&r=mysqlcfg