[RESOLVED] Exception thrown without a stack frame in Unknown on line 0

WHAT is this ??? :confused:
Have coded a complete system this week. Developed it on WinXP, moved it to test it on a production server and ended up with this af the whole page have executed.
(Comes at the bottom of every page)

Exception thrown without a stack frame in Unknown on line 0You've read <!-- m --><a class="postlink" href="http://www.php.net/manual/en/language.exceptions.php">http://www.php.net/manual/en/language.exceptions.php</a><!-- m -->? And what type of error is this: fatal, warning, ... ?

Also, see <!-- m --><a class="postlink" href="http://bugs.php.net/bug.php?id=33598Sorry">http://bugs.php.net/bug.php?id=33598Sorry</a><!-- m -->, Fatal Error.
I did read that at bugs.php.net, but I havent got any destructors.
Today I deleted my db and set it up again, and now this appears:


Fatal error: Exception thrown without a stack frame in Unknown on line 0


Warning: Unknown: A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0Have you managed to find a test case? I tried reproducing the message based on guesses of what your code is like, but didn't managed to produce it.I have found the problem and resolved it. I wasnt about the destructor as described in the bugs.php.net report.

1. My init script sets errorhandler here:
$oldErrorhandler = set_error_handler('error_handler', E_ALL);
2. Later it initializes pear and sets my own error handler:
autoload_file('lib/PEAR/DB.php', true);
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'pear_error_handler');
3. And then connects from my own wrapper
// PEAR::DB will not be compat to E_STRICT (authors words)
$db =& DB::connect($dbh, $options);

4. BUT. The function containing this connect method, (my own), returned $db without checking... silly me :)
What i needed to do was:
if (PEAR::isError($db)) {
trigger_error($db->getMessage(), E_USER_ERROR);
die();
}

Without that check, my pear_error_handler was used (2), and In there, I violently threw an exception.
Changing that to do a trigger_error instead solves the problem. Im not completely sure why, but it seems not allowed to throw exceptions from with ANY errorhandler. Then this error occurs. (reproducable on both Linux & Win32)
 
Back
Top