From:             php at kloopy dot com
Operating system: Win32 and Linux
PHP version:      4.4.1
PHP Bug Type:     Output Control
Bug description:  Calling ob_flush after creating an ob callback causes 
"Segmentation fault"

Description:
------------
When setting an output buffer that returns an empty string (I do have a
good reason for doing this), later calls to ob_flush() cause PHP to seg
fault. 

Tested on PHP-4.1.1 on linux (CLI and Apache2 module) with same error on
both.

Also tested on PHP-5.0.5 on Win32 (CLI and Apache2 module) with same error
on both.

Reproduce code:
---------------
<?php 
function nooutput($text) { return ""; } 
print "Before\n"; 
ob_start("nooutput"); 
print "Middle\n"; 
ob_flush();
ob_end_flush(); 
print "After\n"; 
?> 


Expected result:
----------------
Before
After

Actual result:
--------------
Before
Segmentation fault

-- 
Edit bug report at http://bugs.php.net/?id=35156&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=35156&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=35156&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=35156&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=35156&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=35156&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=35156&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=35156&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=35156&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=35156&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=35156&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=35156&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=35156&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=35156&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=35156&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=35156&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=35156&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=35156&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=35156&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=35156&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=35156&r=mysqlcfg

Reply via email to