php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35666 ob_start crash
Submitted: 2005-12-14 06:04 UTC Modified: 2005-12-14 06:27 UTC
From: zhonghaijun at yahoo dot com dot cn Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5CVS-2005-12-14 (CVS) OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: zhonghaijun at yahoo dot com dot cn
New email:
PHP Version: OS:

 

 [2005-12-14 06:04 UTC] 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....

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-14 06:27 UTC] sniper@php.net
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."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 01:01:28 2024 UTC