From: tuxracer69 at gmail dot com Operating system: Linux 2.6.17-2-686 PHP version: 5CVS-2007-02-07 (snap) PHP Bug Type: Unknown/Other Function Bug description: memory leaks in PHP milter SAPI and proposed fix
Description: ------------ After compiling the last CVS snapshot (5.2) ./configure \ --with-pgsql --with-curl --with-xml \ --enable-sockets --with-zlib --with-bz2 \ --with-iconv --enable-track-vars --enable-sysvsem \ --enable-sysvshm --enable-inline-optimization \ --with-curl --with-regex=system --with-png \ --enable-discard-path --enable-dbx --enable-memory-limit \ --disable-debug --disable-rpath --with-openssl \ --enable-exif --enable-mbstring \ --with-xsl=/usr/lib \ --with-milter --disable-cli --disable-cgi --enable-debug and launching the example milter I was getting the memory leaks warnings below. ----------------- /usr/local/php5.2-200702061930/sapi/milter/php_milter.c(304) : Freeing 0xA5E46184 (44 bytes), script=- /usr/local/php5.2-200702061930/Zend/zend_API.c(819) : Actual location (location was relayed) Last leak repeated 1 time [Wed Feb 7 10:20:03 2007] Script: '-' /usr/local/php5.2-200702061930/sapi/milter/php_milter.c(196) : Freeing 0xA5E464 70 (10 bytes), script=- [Wed Feb 7 10:20:03 2007] Script: '-' /usr/local/php5.2-200702061930/sapi/milter/php_milter.c(346) : Freeing 0xA5E466 C4 (3 bytes), script=- Last leak repeated 5 times [Wed Feb 7 10:20:03 2007] Script: '-' /usr/local/php5.2-200702061930/Zend/zend_API.c(1193) : Freeing 0xA5E466F8 (16 bytes), script=- Last leak repeated 2 times [Wed Feb 7 10:20:03 2007] Script: '-' /usr/local/php5.2-200702061930/sapi/milter/php_milter.c(229) : Freeing 0xA5E468A8 (10 bytes), script=- [Wed Feb 7 10:20:03 2007] Script: '-' /usr/local/php5.2-200702061930/Zend/zend_API.c(1194) : Freeing 0xA5E468E4 (17 bytes), script=- Last leak repeated 2 times [Wed Feb 7 10:20:03 2007] Script: '-' /usr/local/php5.2-200702061930/Zend/zend_API.c(1196) : Freeing 0xA5E46958 (35 bytes), script=- /usr/local/php5.2-200702061930/Zend/zend_hash.c(388) : Actual location (location was relayed) Last leak repeated 2 times [Wed Feb 7 10:20:03 2007] Script: '-' /usr/local/php5.2-200702061930/sapi/milter/php_milter.c(411) : Freeing 0xA5E46E D8 (43 bytes), script=- [Wed Feb 7 10:20:03 2007] Script: '-' /usr/local/php5.2-200702061930/sapi/milter/php_milter.c(347) : Freeing 0xA5E470 50 (40 bytes), script=- Last leak repeated 5 times [Wed Feb 7 10:20:03 2007] Script: '-' /usr/local/php5.2-200702061930/sapi/milter/php_milter.c(264) : Freeing 0xA5E49A 58 (32 bytes), script=- /usr/local/php5.2-200702061930/Zend/zend_alloc.c(1917) : Actual location (location was relayed) Last leak repeated 1 time [Wed Feb 7 10:20:03 2007] Script: '-' /usr/local/php5.2-200702061930/sapi/milter/php_milter.c(192) : Freeing 0xA5E505E8 (16 bytes), script=- === Total 29 memory leaks detected === --------------- The TODO file in the distribution mention such leaks. Reproduce code: --------------- the milter.php in the milter sapi distribution Expected result: ---------------- no memory leaks Actual result: -------------- a lot of memory leaks warnings. -- Edit bug report at http://bugs.php.net/?id=40392&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40392&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40392&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40392&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40392&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40392&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40392&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40392&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40392&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40392&r=support Expected behavior: http://bugs.php.net/fix.php?id=40392&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40392&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40392&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40392&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40392&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40392&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40392&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40392&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40392&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40392&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40392&r=mysqlcfg