From: isitoya at wakhok dot ac dot jp Operating system: Suse9.2 PHP version: 5.1.0b3 PHP Bug Type: Reproducible crash Bug description: throw Exception in error handler causes crash
Description: ------------ When I using Phing, My testcase with PEAR-SOAP and rdfapi-php had stopped with segmentation fault. And I Found that throwing exception in error_handler causes Seg fault. Reproduce code: --------------- <?php set_error_handler('errorHandler', E_USER_ERROR); try{ test(); }catch(Exception $e){ } restore_error_handler(); function test(){ trigger_error("error", E_USER_ERROR); } function errorHandler($errno, $errstr, $errfile, $errline) { throw new Exception(); } ?> ----- no try and catch <?php set_error_handler('errorHandler', E_USER_ERROR); test(); restore_error_handler(); function test(){ trigger_error("error", E_USER_ERROR); } function errorHandler($errno, $errstr, $errfile, $errline) { throw new Exception(); } ?> Expected result: ---------------- nothing Actual result: -------------- *** glibc detected *** double free or corruption: 0x0000000000af7970 *** *** glibc detected *** double free or corruption: 0x0000000000af7a10 *** *** glibc detected *** double free or corruption: 0x0000000000af07b0 *** ------ no try and catch Fatal error: Uncaught exception 'Exception' in /usr/home/kent/tests/trigger_errorTest.php:11 Stack trace: #0 [internal function]: errorHandler(256, 'error', '/usr/home/kent/...', 7, Array) #1 /usr/home/kent/tests/trigger_errorTest.php(7): trigger_error('error', 256) #2 /usr/home/kent/tests/trigger_errorTest.php(3): test() #3 {main} thrown in /usr/home/kent/tests/trigger_errorTest.php on line 11 *** glibc detected *** double free or corruption: 0x0000000000af7870 *** *** glibc detected *** double free or corruption: 0x0000000000af7910 *** Segmentation fault -- Edit bug report at http://bugs.php.net/?id=33802&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33802&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33802&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33802&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33802&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33802&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33802&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33802&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33802&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33802&r=support Expected behavior: http://bugs.php.net/fix.php?id=33802&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33802&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33802&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33802&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33802&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33802&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33802&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33802&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33802&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33802&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33802&r=mysqlcfg