Edit report at https://bugs.php.net/bug.php?id=61541&edit=1
ID: 61541
User updated by: grzegorz129 at gmail dot com
Reported by: grzegorz129 at gmail dot com
-Summary: Segfault using ob_*
+Summary: Segfault using ob_clean/flush* functions in
output_callback function
Status: Open
Type: Bug
Package: Reproducible crash
Operating System: Linux/debian lenny
PHP Version: 5.3.10
Block user comment: N
Private report: N
New Comment:
@reeze - thanks for patch & title suggestion.
Is there any way to catch E_PARSE? As you can see ob_* is dead end ;)
Previous Comments:
------------------------------------------------------------------------
[2012-03-28 16:42:41] reeze dot xia at gmail dot com
@grzegorz129 maybe the title can be more specific: eg: Segfault using
ob_clean/flush* functions in output_callback function
------------------------------------------------------------------------
[2012-03-28 16:40:46] reeze dot xia at gmail dot com
I've sent a pull request to fix this. @see
https://github.com/php/php-src/pull/25
this makes php raise fatal error instead of segfault.
This seems to be a logic error when clean/flush output will cause the callback
called and then endless function call.
------------------------------------------------------------------------
[2012-03-28 15:09:36] grzegorz129 at gmail dot com
Test script can be even simplier:
<?php
ob_start('foo');
function foo() { ob_end_clean(); }
?>
------------------------------------------------------------------------
[2012-03-28 14:51:09] [email protected]
Changed summary from "Memory leak during using ob_*"
------------------------------------------------------------------------
[2012-03-28 11:48:46] grzegorz129 at gmail dot com
Description:
------------
I've trying to catch E_PARSE but trying to run sample code results only in
segfault.
Test script:
---------------
<?php
ob_start('phpErrorHandler');
function phpErrorHandler($output) {
ob_end_clean();
echo "abc";
die("def");
}
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61541&edit=1