php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24831 Memory Leak
Submitted: 2003-07-27 14:57 UTC Modified: 2003-08-04 05:39 UTC
From: cunha17 at uol dot com dot br Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.0b2-dev OS: Linux 2.4.20 (Redhat 9)
Private report: No CVE-ID: None
 [2003-07-27 14:57 UTC] cunha17 at uol dot com dot br
Description:
------------
This small OO script gives some memory leaks.


Reproduce code:
---------------
class ReleaseInfo
{
    const NAME_LONG                 = "PHPORB";
    const NAME_SHORT                = "orb";
    const VERSION_MAJOR             = 0;
    const VERSION_MINOR             = 1;
    const VERSION_MINOR_CHANGE      = 0;
    const VERSION                   = "" . VERSION_MAJOR . "." . VERSION_MINOR . "." . VERSION_MINOR_CHANGE;

    const SPEC_VERSION_MAJOR        = 2;
    const SPEC_VERSION_MINOR        = 4;
    const SPEC_VERSION_MINOR_CHANGE = 2;
    const SPEC_VERSION              = "" . SPEC_VERSION_MAJOR . "." . SPEC_VERSION_MINOR . "." . SPEC_VERSION_MINOR_CHANGE;

    const RELEASE                   = NAME_LONG . " Version " . VERSION;
    const RELEASE_TAG               = NAME_LONG . "_" . VERSION_MAJOR . "_" . VERSION_MINOR . "_" . VERSION_MINOR_CHANGE;

    public static function main($args)
    {
        echo NAME_LONG . ":";
        echo "\t" . NAME_LONG . " " . VERSION;
        echo "\t" . RELEASE_TAG;
        echo "\tCORBA/IIOP " . SPEC_VERSION . " (http://www.omg.org/cgi-bin/doc?formal/01-02-01)";
    }
}


Expected result:
----------------
Nothing to the standard output and no memory leaks.

Actual result:
--------------
/usr/src/zend2/php5-200307262130/Zend/zend_operators.c(1087) :  Freeing 0x4070AE7C (12 bytes), script=org/openorb/ReleaseInfo.php
Last leak repeated 13 times
Zend/zend_language_scanner.c(4497) :  Freeing 0x4070AE40 (2 bytes), script=org/openorb/ReleaseInfo.php
Last leak repeated 9 times
Zend/zend_language_scanner.c(4350) :  Freeing 0x4070ADB8 (14 bytes), script=org/openorb/ReleaseInfo.php
Last leak repeated 11 times
/usr/src/zend2/php5-200307262130/Zend/zend_compile.c(2524) :  Freeing 0x4070AA80 (6 bytes), script=org/openorb/ReleaseInfo.php
/usr/src/zend2/php5-200307262130/Zend/zend_variables.c(111) : Actual location (location was relayed)
Last leak repeated 2 times


Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-28 20:28 UTC] sniper@php.net
I must have had --enable-debug missing in my last build, now I got the same leaks.

 [2003-08-03 15:05 UTC] cunha17 at uol dot com dot br
With the latest CVS there is no memory leaks anymore, but I got core dumped at the end of script execution.
 [2003-08-04 05:39 UTC] stas@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: Mon Aug 19 00:01:27 2024 UTC