#49711 [NEW]: Memory Leak in Deprecated Methods
| From: | kristina at 10gen dot com | Date: | Tue, 29 Sep 2009 14:49:57 +0000 |
| Subject: | #49711 [NEW]: Memory Leak in Deprecated Methods | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-143041@lists.php.net to get a copy of this message | ||
From: kristina at 10gen dot com
Operating system: Windows
PHP version: 5.3.0
PHP Bug Type: Unknown/Other Function
Bug description: Memory Leak in Deprecated Methods
Description:
------------
A method with the ZEND_ACC_DEPRECATED flag will cause memory usage to
increase each time it's called through PHPUnit. (It doesn't occur with a
PHP program run with "php script.php", so it might have something to do
with reflection.)
It occurs in 5.2.* and 5.3.*, only on Windows.
I've written a small PHP extension that demonstrates this bug. It is
available at http://github.com/beaddy1238/PHP-Memleak.
Reproduce code:
---------------
Compile the extension by putting the config.w32, php_mongo.h, and mongo.c
files in a pecl\mongo dir.
From the pecl\mongo directory, run:
phpunit tests\MongoRunner.php
It print out the memory used at the beginning and end of the function.
The function calls Mongo->lastError() (an empty method) 10000 times.
Expected result:
----------------
I expect the memory usage to stay the same.
Actual result:
--------------
The more times Mongo->lastError is called, the more memory is used.
This stops happening if ZEND_ACC_DEPRECATED is removed from mongo.c.
--
Edit bug report at http://bugs.php.net/?id=49711&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49711&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49711&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49711&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49711&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49711&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49711&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49711&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49711&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49711&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49711&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49711&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49711&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49711&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49711&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49711&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49711&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49711&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49711&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49711&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49711&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49711&r=mysqlcfg