ID: 25335
User updated by: cunha17 at uol dot com dot br
Reported By: cunha17 at uol dot com dot br
Status: Open
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5CVS-2003-08-31 (dev)
Assigned To: helly
New Comment:
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).
Previous Comments:
------------------------------------------------------------------------
[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