ID: 35666
Updated by: sniper@php.net
Reported By: zhonghaijun at yahoo dot com dot cn
-Status: Open
+Status: Bogus
Bug Type: Output Control
Operating System: Linux
PHP Version: 5CVS-2005-12-14 (CVS)
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
RTFM:
"ob_end_clean(), ob_end_flush(), ob_clean(), ob_flush() and ob_start()
may not be called from a callback function. If you call them from
callback function, the behavior is undefined."
Previous Comments:
------------------------------------------------------------------------
[2005-12-14 06:04:51] zhonghaijun at yahoo dot com dot cn
Description:
------------
Ob_start crash
Seems dead loop when I debugged the programme
Reproduce code:
---------------
<?php
function callback($buffer)
{
ob_clean();
return $buffer."\n";
}
var_dump(ob_start("callback", 2));
echo "\nHi!abc";
?>
Expected result:
----------------
Hi!abc
Actual result:
--------------
segment fault
BT
(gdb) bt
#0 zend_call_function (fci=0xbf0a5080, fci_cache=0x0)
at /home/junz/src/PHP/v506/SRC/Zend/zend_execute_API.c:577
#1 0x08073aae in call_user_function_ex (function_table=0x0,
object_pp=0x0,
function_name=0x0, retval_ptr_ptr=0x0, param_count=0, params=0x0,
no_separation=0,
symbol_table=0x0) at
/home/junz/src/PHP/v506/SRC/Zend/zend_execute_API.c:559
#2 0x08166745 in php_end_ob_buffer (send_buffer=0 '\0', just_flush=1
'\001')
at /home/junz/src/PHP/v506/SRC/main/output.c:240
#3 0x081673a8 in zif_ob_clean (ht=0, return_value=0x8584ebc,
this_ptr=0x0,
return_value_used=0) at
/home/junz/src/PHP/v506/SRC/main/output.c:788
#4 0x081b0ee6 in zend_do_fcall_common_helper (execute_data=0xbf0a5260,
opline=0x82a51bc,
op_array=0x82a53b8) at
/home/junz/src/PHP/v506/SRC/Zend/zend_execute.c:2761
#5 0x081adb49 in execute (op_array=0x82a53b8)
at /home/junz/src/PHP/v506/SRC/Zend/zend_execute.c:1438
#6 0x08074198 in zend_call_function (fci=0xbf0a53b0, fci_cache=0x0)
at /home/junz/src/PHP/v506/SRC/Zend/zend_execute_API.c:875
#7 0x08073aae in call_user_function_ex (function_table=0x0,
object_pp=0x0,
function_name=0x0, retval_ptr_ptr=0x0, param_count=0, params=0x0,
no_separation=0,
symbol_table=0x0) at
/home/junz/src/PHP/v506/SRC/Zend/zend_execute_API.c:559
#8 0x08166745 in php_end_ob_buffer (send_buffer=0 '\0', just_flush=1
'\001')
at /home/junz/src/PHP/v506/SRC/main/output.c:240
#9 0x081673a8 in zif_ob_clean (ht=0, return_value=0x8584d94,
this_ptr=0x0,
return_value_used=0) at
/home/junz/src/PHP/v506/SRC/main/output.c:788
#10 0x081b0ee6 in zend_do_fcall_common_helper (execute_data=0xbf0a5590,
opline=0x82a51bc,
op_array=0x82a53b8) at
/home/junz/src/PHP/v506/SRC/Zend/zend_execute.c:2761
#11 0x081adb49 in execute (op_array=0x82a53b8)
at /home/junz/src/PHP/v506/SRC/Zend/zend_execute.c:1438
#12 0x08074198 in zend_call_function (fci=0xbf0a56e0, fci_cache=0x0)
at /home/junz/src/PHP/v506/SRC/Zend/zend_execute_API.c:875
#13 0x08073aae in call_user_function_ex (function_table=0x0,
object_pp=0x0,
function_name=0x0, retval_ptr_ptr=0x0, param_count=0, params=0x0,
no_separation=0,
and so many records below....
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35666&edit=1