Closed (won't fix)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Jun 2010 at 06:46 UTC
Updated:
29 Jun 2010 at 17:20 UTC
#840182: Testing is broken put PHP Fatal error: Exception thrown without a stack frame in Unknown on line 0 in my Apache error log. Even if that issue is fixed, just revert the short patch and fix exception handling. I won't. I had my say about exceptions. Good luck playing whack-a-mole with this error message.
Comments
Comment #1
chx commentedIt seems you need to have a batch and an exception thrown in a shutdown function for this happen. Merely throwing an exception from shutdown is not enough. No matter how much it annoys me that's not critical.
Comment #2
berdirDid not get #1. Will that be displayed even when using drupal_register_shutdown_function() instead of register_shutdown_function? If no, then I don't see your point, avoiding exactly these errors is the reason of drupal_register_shutdown_function()'s existance...
Comment #3
chx commenteddrupal_register_shutdown_function only helped the parent issue because it caused simpletest to remove the call to the offending function. Just try creating a batch that throws an exception in a shutdown function and you will see. For example, add register_shutdown_function('test_throw') and function test_throw() { global $testing; if ($testing) throw new Exception('test');} to index.php and flip the global in simpletest setUp and run a test. Ka-boom. Or, as the original post says, just change back the drupal_register_shutdown_function to register_shutdown_function in mysql/database.inc nextId
Comment #4
berdirdrupal_register_shutdown_function() does more than that. It also explicitly catches all exceptions thrown in shutdown functions and displays them nicely, as you can see here: http://api.drupal.org/api/function/_drupal_shutdown_function/7
As I said, in your example you used again register_shutdown_function(). Your example code even fails without checking $testing and simply accessing index.php
If you use drupal_register_shutdown_function(), you will instead see the following:
This might not be perfect, but there is not much more we can do at that time and you can see what exception was thrown and where.
I tested this both with your method during testing and directly.