ID:               25335
 Updated by:       [EMAIL PROTECTED]
 Reported By:      cunha17 at uol dot com dot br
-Status:           Open
+Status:           Closed
 Bug Type:         Zend Engine 2 problem
 Operating System: *
 PHP Version:      5CVS-2003-08-31 (dev)
 Assigned To:      helly
 New Comment:

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.


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

[2003-09-14 15:57:12] [EMAIL PROTECTED]

The combination of excetions / user space error handling made me think
in that direction. Further investigation showed that you were right and
there was indeed a problem with temporairy allocated memory.

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

[2003-09-14 15:32:07] cunha17 at uol dot com dot br

My knowledge of ZE2 is too limited but I don't think the memory manager
got shutdown when the error handler is called (does it?). IMHO it seems
the error handler calling mechanism is allocating something and not
releasing it since the user function(error handler) is terminated
abnormally (exception) and not in the expected way (function end
reached, return or exit/die).

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

[2003-09-14 15:20:55] [EMAIL PROTECTED]

For me it seems as if a zval is created after memory manager shutdown.
If this is the case we would need to return 'internal zvals' when
creating new ones after normal script runtime and also their data must
be malloced which is impossible. Or we need to prevent user functions
from beeing called after shutdown_executor() gets called.

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

[2003-09-10 21:49:16] cunha17 at uol dot com dot br

Is anyone looking at this ?

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

[2003-08-31 19:44:50] cunha17 at uol dot com dot br

Description:
------------
This code below gives some memory leak. The leak only appears when
throwing exceptions inside error handler.
The code I'm using is a little more complex 'cause it translates PHP
errors into PHP Exceptions, but this piece of code reproduces the leak
correctly.


Reproduce code:
---------------
<?
function my_error($nr, $text, $file, $line, $vars)
{
throw new Exception($text);
}

error_reporting(E_ALL);
set_error_handler("my_error");

try {
        include("unexistent");
} catch (Exception $e) {
        echo "EXCEPTION!!!";
}
?>

Expected result:
----------------
EXCEPTION!!!

Actual result:
--------------
EXCEPTION!!!/usr/src/zend2/php-src/Zend/zend.c(914) :  Freeing
0x404C9340 (16 bytes), script=leak.php
=== Total 1 memory leaks detected ===



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


-- 
Edit this bug report at http://bugs.php.net/?id=25335&edit=1

Reply via email to