Bug #13672: Memory leak
| From: | mh at bang dot ca | Date: | Mon, 15 Oct 2001 12:53:54 +0000 |
| Subject: | Bug #13672: Memory leak | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-67955@lists.php.net to get a copy of this message | ||
From: mh@bang.ca
Operating system: RH Linux (2.2.16-22)
PHP version: 4.0.6
PHP Bug Type: Scripting Engine problem
Bug description: Memory leak
Doing mtrace on libphp4.so returns:
- 0000000000 Realloc 6161 was never alloc'd
- 0000000000 Realloc 6163 was never alloc'd
- 0000000000 Realloc 6168 was never alloc'd
- 0000000000 Realloc 7007 was never alloc'd
- 0000000000 Realloc 7015 was never alloc'd
- 0000000000 Realloc 7023 was never alloc'd
Memory not freed:
-----------------
Address Size Caller
0000000000 0 at
I have tried the latest CVS build, but it won't compile with zlib:
zlib.c:115: `STANDARD_MODULE_HEADER' undeclared here (not in a function)
zlib.c:115: initializer element is not constant
zlib.c:115: (near initialization for `php_zlib_module_entry.name')
zlib.c:116: warning: initialization from incompatible pointer type
zlib.c:117: warning: initialization from incompatible pointer type
zlib.c:122: warning: initialization from incompatible pointer type
zlib.c:123: `NO_VERSION_YET' undeclared here (not in a function)
zlib.c:123: initializer element is not constant
zlib.c:123: (near initialization for
`php_zlib_module_entry.global_shutdown_func')
zlib.c:124: warning: initialization makes integer from pointer without a
cast
zlib.c:124: warning: initialization makes integer from pointer without a
cast
zlib.c:124: warning: initialization makes integer from pointer without a
cast
zlib.c:124: warning: excess elements in struct initializer
zlib.c:124: warning: (near initialization for `php_zlib_module_entry')
zlib.c:125: warning: excess elements in struct initializer
zlib.c:125: warning: (near initialization for `php_zlib_module_entry')
make[3]: *** [zlib.lo] Error 1
make[3]: Leaving directory
`/usr/local/bang_setup/php4-200110141200/ext/zlib'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/usr/local/bang_setup/php4-200110141200/ext/zlib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/bang_setup/php4-200110141200/ext'
make: *** [all-recursive] Error 1
My config line for PHP is:
--with-apxs=/usr/local/apache/bin/apxs' '--enable-force-cgi-redirect'
'-with-png-dir=/usr/local/bang_setup/libpng-1.0.11/'
'--with-zlib-dir=/usr/local/bang_setup/zlib-1.1.3/' '--enable-ftp'
'--with-gd=/usr/local/bang_setup/gd-1.8.4' '--with-jpeg-dir=/usr/local/'
'--with-mysql=/usr/local' '--enable-gd-imgstrttf' '--with-imap'
'--with-ldap=/usr/local' '--enable-gd-native-ttf' '--enable-trans-sid'
'--with-mcrypt'
Some of our websites have become erratic, to the point where some scripts
would sometimes return:
Cannot use assign-op operators with overloaded object
s nor string offsets
on something as simple as
$table[$i] .= "something";
This last problem has been circumvented by
$var .= "something";
$table[$i] = $var;
but now rather than the above-mentioned error, the script outputs the
letter "F".
I wish I could be more accurate, but I have no idea why this started
happening, but I suspect the memory leak. I haven't been able to come up
with a test case, and my script is a little unwieldy.
--
Edit bug report at: http://bugs.php.net/?id=13672&edit=1