From:             [EMAIL PROTECTED]
Operating system: Linux
PHP version:      5CVS-2003-03-26 (dev)
PHP Bug Type:     Zend Engine 2 problem
Bug description:  Heavy mem-leaks in debug build with namespace/class/exception 
testcase

The following scripts gives quite some memory leaks in a HEAD debug build:

 $ cat exception2_1.php
<?php
        require_once 'exception2_2.php';

        try {
        } catch (foo:bar::baz $e) {
        }
?>
$ cat exception2_2.php
<?php
        namespace foo:bar {
                class baz {
                        function __construct() { }
                }
        }

        namespace foo { }
?>
$ php exception2_1.php
/home/mfischer/isrc/cvs/php5/Zend/zend_compile.c(3267) :  Freeing
0x401B05B0 (32 bytes), script=exception2_1.php
/home/mfischer/isrc/cvs/php5/Zend/zend_hash.c(176) : Actual location
(location was relayed)
/home/mfischer/isrc/cvs/php5/Zend/zend_compile.c(3266) :  Freeing
0x401B054C (44 bytes), script=exception2_1.php
/home/mfischer/isrc/cvs/php5/Zend/zend_compile.c(3265) :  Freeing
0x401B04D8 (64 bytes), script=exception2_1.php
/home/mfischer/isrc/cvs/php5/Zend/zend_hash.c(176) : Actual location
(location was relayed)
/home/mfischer/isrc/cvs/php5/Zend/zend_compile.c(3264) :  Freeing
0x401B0464 (64 bytes), script=exception2_1.php
/home/mfischer/isrc/cvs/php5/Zend/zend_hash.c(176) : Actual location
(location was relayed)
/home/mfischer/isrc/cvs/php5/Zend/zend_compile.c(3263) :  Freeing
0x401B03F0 (64 bytes), script=exception2_1.php
/home/mfischer/isrc/cvs/php5/Zend/zend_hash.c(176) : Actual location
(location was relayed)
/home/mfischer/isrc/cvs/php5/Zend/zend_compile.c(3286) :  Freeing
0x401B0294 (296 bytes), script=exception2_1.php
/home/mfischer/isrc/cvs/php5/Zend/zend_language_scanner.l(1114) :  Freeing
0x401B0258 (4 bytes), script=exception2_1.php

Note that doing any of the following completely removes the leak
warnings:
- Move content of file 2_2 completely into 2_1
- Remove the __construct function
- Move namespace foo declaring before namespace foo:bar

-- 
Edit bug report at http://bugs.php.net/?id=22914&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22914&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22914&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22914&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22914&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22914&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22914&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22914&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22914&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22914&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22914&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22914&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22914&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22914&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22914&r=gnused

Reply via email to