php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22914 Heavy mem-leaks in debug build with namespace/class/exception testcase
Submitted: 2003-03-26 19:38 UTC Modified: 2003-05-11 08:26 UTC
From: mfischer@php.net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2003-03-26 (dev) OS: Linux
Private report: No CVE-ID: None
 [2003-03-26 19:38 UTC] mfischer@php.net
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

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-11 08:26 UTC] moriyoshi@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Aug 17 19:01:28 2024 UTC