From: davidc at bLesys dot com
Operating system: Win XP Professional
PHP version: 5CVS-2003-12-22 (dev)
PHP Bug Type: Reproducible crash
Bug description: Thrown exceptions while evaluting argument to pass as parameter
crash PHP
Description:
------------
(bug was not fixed in beta3 also)
While evaluting argument 3 to pass to method setProperties, an exception
is thrown but any attempt to rethrow this exception/new exception or
return from the method crashes PHP.
Strangely, no problem is encountered if this exception is thrown while
evaluting the first two arguments.
The solution for now is to create a local variable that holds the contents
of the argument. Then, we simply pass the local variable to the method,
but this creates additional work for the programmer.
Reproduce code:
---------------
<?php
class x
{ function getFirst(){ throw ( new Exception( "No rows present"));} }
class Proxy
{
function setProperties($c){}
/* public void*/function setObject( $b, $obj, $res){
try
{
$res=new x();
$this->setProperties($a,$b,$res->getFirst());
}
catch(Exception $e)
{
throw new Exception("Failed to get it!");
}
}
}
$p =( new Proxy());
$p->setObject($this,$o,$ret);?>
Expected result:
----------------
Thrown exception caught by PHP5's default handler (stack output, etc)
Actual result:
--------------
Apache2 dies
--
Edit bug report at http://bugs.php.net/?id=26698&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26698&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26698&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26698&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26698&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26698&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=26698&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=26698&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26698&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26698&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26698&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26698&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26698&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26698&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26698&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26698&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26698&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26698&r=float