From: dankab at infinito dot it
Operating system: linux
PHP version: 5.0.1
PHP Bug Type: Apache2 related
Bug description: segmentation fault in the child class catch
Description:
------------
[sorry for my english]
the code below cause a segmentation fault in apache 2
i try to use a parent variable in the catch statement of the second child
if i use the same variable in the first child it's seems to work
Reproduce code:
---------------
class A {
public $myVar = "";
function __construct() {
try {
$this->test();
}
catch(Exception $e) {
throw $e;
}
}
public function test() {
$this->myVar = "something<br>";
if(0!=1) throw new Exception("ERROR",100);
}
}
class B extends A {
function __construct() {
try {
parent::__construct();
}
catch(Exception $e) {
throw $e;
}
}
}
class C extends B {
function __construct() {
try {
parent::__construct();
}
catch(Exception $e) {
echo $this->myVar;
throw $e;
}
}
}
try {
$c = new C();
}
catch(Exception $e) {
echo $e->getMessage();
}
Expected result:
----------------
printing of:
something
ERROR
Actual result:
--------------
segmentation fault in apache 2
[notice] child pid 12938 exit signal Segmentation fault (11)
--
Edit bug report at http://bugs.php.net/?id=30128&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30128&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30128&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30128&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30128&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30128&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30128&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30128&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30128&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30128&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30128&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30128&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30128&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30128&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30128&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30128&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30128&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30128&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30128&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30128&r=mysqlcfg