#48409 [Fbk->Csd]: Exception + nested functions + classes crash PHP 5.2
| From: | lbarnaud@php.net | Date: | Sat, 30 May 2009 16:38:16 +0000 |
| Subject: | #48409 [Fbk->Csd]: Exception + nested functions + classes crash PHP 5.2 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-137899@lists.php.net to get a copy of this message | ||
ID: 48409
Updated by: lbarnaud@php.net
Reported By: nightstorm at tlen dot pl
-Status: Feedback
+Status: Closed
Bug Type: Reproducible crash
-Operating System: Linux 64bit gcc
+Operating System: Linux gcc
PHP Version: 5.2CVS-2009-05-27 (snap)
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2009-05-27 19:22:06] jani@php.net
Arnaud: I'd like to see the reportee's answers to my questions. And I
tested in 64bit system, gcc 4.1.2.
What was the GCC version you (both) used? :)
------------------------------------------------------------------------
[2009-05-27 18:42:08] lbarnaud@php.net
Looks like the same as bug #48228
Can reproduce on a 64bit system, not on 32bit.
"./configure --disable-all", default CFLAGS (-O2)
------------------------------------------------------------------------
[2009-05-27 18:28:29] jani@php.net
Note: I can not reproduce this.
------------------------------------------------------------------------
[2009-05-27 18:27:27] jani@php.net
Did you use --enable-debug or not? Change -O (optimizer level) compile
parameter?
------------------------------------------------------------------------
[2009-05-27 18:26:30] jani@php.net
<?php
class ABCException extends Exception {}
class BBB
{
public function xyz($d, $x)
{
if ($x == 34) {
throw new ABCException;
}
return array('foo' => 'xyz');
}
}
class CCC
{
public function process($p)
{
return $p;
}
}
class AAA
{
public function func()
{
$b = new BBB;
$c = new CCC;
$i = 34;
$item = array('foo' => 'bar');
try {
$c->process($b->xyz($item['foo'], $i));
}
catch(ABCException $e) {
$b->xyz($item['foo'], $i);
}
} // end func();
}
class Runner
{
public function run($x)
{
try {
$x->func();
}
catch(ABCException $e) {
throw new Exception;
}
}
}
try {
$runner = new Runner;
$runner->run(new AAA);
}
catch(Exception $e) {
die('Exception thrown');
}
?>
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/48409
--
Edit this bug report at http://bugs.php.net/?id=48409&edit=1