#39629 [NEW]: Buffer clean in error handler causes PHP crash

From: Date: Sat, 25 Nov 2006 19:32:58 +0000
Subject: #39629 [NEW]: Buffer clean in error handler causes PHP crash
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-105440@lists.php.net to get a copy of this message
From: robert dot tuley at imperial dot ac dot uk Operating system: winXP PHP version: 5.2.0 PHP Bug Type: Output Control Bug description: Buffer clean in error handler causes PHP crash Description: ------------ Trying to clean the buffer in a custom error handler causes script exit when that buffer has 'ob_gzhandler' as a handler. The behaviour is consistent for both PHP5 and PHP4. Note that the example works correctly if there is no callback function specified in the call to ob_start(). Reproduce code: --------------- // set error handler function errorHandler($code,$string,$filename,$line,$scope) { ob_end_clean(); die('should reach here'); } set_error_handler('errorHandler'); // use ob_gzhandler to buffer page ob_start('ob_gzhandler'); echo 'some output'; trigger_error('encounters error',E_USER_ERROR); Expected result: ---------------- should reach here Actual result: -------------- No output. -- Edit bug report at http://bugs.php.net/?id=39629&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39629&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39629&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39629&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39629&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39629&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39629&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39629&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39629&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39629&r=support Expected behavior: http://bugs.php.net/fix.php?id=39629&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39629&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39629&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39629&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39629&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39629&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39629&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39629&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39629&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39629&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39629&r=mysqlcfg

« previous php.bugs (#105440) next »