ID:               49711
 User updated by:  kristina at 10gen dot com
 Reported By:      kristina at 10gen dot com
 Status:           Open
 Bug Type:         Scripting Engine problem
 Operating System: Windows
 PHP Version:      5.3.0
 New Comment:

Okay, my bad.  Fixed the extension.  It prints:

3670016
10223616

(The first number is mem usage before running the function 10000 times,
the second the mem usage after).


Previous Comments:
------------------------------------------------------------------------

[2009-09-29 16:11:17] kristina at 10gen dot com

It segfaulted immediately, popping up the Visual Studio Just-In-Time
debugger window before outputting anything.

------------------------------------------------------------------------

[2009-09-29 15:14:32] j...@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/



------------------------------------------------------------------------

[2009-09-29 14:49:57] kristina at 10gen dot com

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 this bug report at http://bugs.php.net/?id=49711&edit=1

Reply via email to