From: ralph at smashlabs dot com Operating system: Linux PHP version: 5.2.1 PHP Bug Type: Session related Bug description: session_start Warnings caught by error handler produce E_Fatal
Description: ------------ Abstract: when handling php errors via set_error_handler() with the intention of throwing a catchable error, an E_FATAL error is triggered. Details: This is similar to the error you might see when attempting to throw an exception from an objects destructor. The internal pointer to the unwinding stack is lost and/or blown away. without the error handler session_start with an invalid save_path will produce an E_WARNING Reproduce code: --------------- <? ini_set('session.save_path', '/var/log'); set_error_handler('save_handler', E_ALL); try { session_start(); } catch (Exception $e) { echo $e->getMessage(); } function save_handler($errno, $errmsg) { throw new Exception('Error caught and thrown as exception: ' . $errmsg); } Expected result: ---------------- Error caught and thrown as exception: session_start(): open(/var/log/sess_3e97dad0fe4ce6f285e97593471f2c88, O_RDWR) failed: Permission denied (13) Actual result: -------------- Error caught and thrown as exception: session_start(): open(/var/log/sess_3e97dad0fe4ce6f285e97593471f2c88, O_RDWR) failed: Permission denied (13) Fatal error: Exception thrown without a stack frame in Unknown on line 0 -- Edit bug report at http://bugs.php.net/?id=41253&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41253&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41253&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41253&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41253&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41253&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41253&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41253&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41253&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41253&r=support Expected behavior: http://bugs.php.net/fix.php?id=41253&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41253&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41253&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41253&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41253&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41253&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41253&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41253&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41253&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41253&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41253&r=mysqlcfg