php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24699 Memory Leak with per-class constants
Submitted: 2003-07-17 23:17 UTC Modified: 2003-07-27 07:08 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: fujimura at wakhok dot ac dot jp Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2003-07-24 (dev) OS: *
Private report: No CVE-ID: None
 [2003-07-17 23:17 UTC] fujimura at wakhok dot ac dot jp
Description:
------------
The per-class constant causes memory leaks used with builtin constants.

configure line:
./configure \
--with-apxs=/usr/local/apache/bin/apxs \
--disable-short-tags \
--enable-versioning \
--enable-bcmath \
--enable-dio \
--enable-mbstring \
--enable-mbregex \
--enable-wddx \
--enable-dom \
--with-iconv \
--with-xsl \
--with-openssl \
--with-zlib \
--with-bz2 \
--enable-debug


Reproduce code:
---------------
[user@loki php-src]$ php -r 'class TEST { const FOO = SEEK_CUR; }'
/home/user/php-src/Zend/zend_language_scanner.l(1111) :  Freeing 0x40435334 (9 bytes), script=-
/home/user/php-src/Zend/zend_compile.c(2405) :  Freeing 0x404352F0 (16 bytes), script=-



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-24 16:29 UTC] helly@php.net
marcus@zaphod /usr/src/php5 $ php -r 'class TEST { const FOO = SEEK_CUR; }'
/usr/src/php5/Zend/zend_language_scanner.l(1111) :  Freeing 0x406842B0 (9 bytes), script=-
marcus@zaphod /usr/src/php5 $ php -r 'class TEST { const FOO = 1; }'
marcus@zaphod /usr/src/php5 $ php -r 'class TEST { const FOO = PHP_VERSION; }'
/usr/src/php5/Zend/zend_language_scanner.l(1111) :  Freeing 0x406842B0 (12 bytes), script=-
/usr/src/php5/Zend/zend_constants.c(290) :  Freeing 0x40684268 (12 bytes), script=-
/usr/src/php5/Zend/zend_variables.c(111) : Actual location (location was relayed)
/usr/src/php5/Zend/zend_compile.c(2349) :  Freeing 0x40684220 (16 bytes), script=-
 [2003-07-27 07:08 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-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 07 19:01:34 2025 UTC