From:
Operating system: Linux
PHP version: 5.3.3
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Exception not caught sometimes
Description:
------------
An Exception thrown is not caught by the corresponding catch block, instead
the global exception handler is invoked. That only happens on one page
during a long selenium test case. The bug is reproduceable with the
selenium test script, but stripping the code to a small example does not
result in an error. Will will add the stripped version of the code which
does not fail, but show the code.
The System is a 64bit Zend Server 5.3 CE on CentOS 5.5. The same code on a
Zend Server 5.2 CE does not have this problem. The problem also occurred in
PHP 5.3.2
In the example script $defer should be set to true but instead of catching
the excepetion in that block the global exception handler is called.
A fix for this is currently to use bofre the throw:
if (version_compare(PHP_VERSION, '5.3.0', '>=') &&
version_compare(PHP_VERSION, '5.3.3', '<=')) {
set_exception_handler(create_function('$exception', 'return $exception
instanceof iwat_ui_controller_ObjectSaveDeferredException ? true :
userExceptionHandler($exception);'));
}
as the application behaves as expected, but that bug still exists.
Disabling all Zend modules has no effect
Test script:
---------------
try {
doSave();
} catch (iwat_ui_controller_ObjectSaveDeferredException $e) {
$defer = true;
} catch (IWATException $e) {
}
function doSave() {
throw new iwat_ui_controller_ObjectSaveDeferredException();
}
--
Edit bug report at http://bugs.php.net/bug.php?id=52890&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52890&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52890&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=52890&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52890&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=52890&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52890&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=52890&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=52890&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=52890&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=52890&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=52890&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=52890&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=52890&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52890&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52890&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52890&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=52890&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=52890&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=52890&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=52890&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=52890&r=mysqlcfg