This should be fixed now. Thanks for the short reproducing script.
Andi
I don't think, that it is fixed in latest cvs.
Simply changing the script to this, the problem/bug still exists:
<?php
class test {
public function __destruct() {
$this->foo = false;
}
public function start() {
throw new Exception();
}
}
function bar() {
$test = new test();
$test->start();
}
bar();
?>
new backtrace:
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x0819cbd5 in execute (op_array=0x404e962c)
at /home/kase/php5-200403011430/Zend/zend_execute.c:1339
#2 0x0817b7cb in zend_call_function (fci=0xbfffd7c8,
fci_cache=0xbfffd7a8)
at /home/kase/php5-200403011430/Zend/zend_execute_API.c:759
#3 0x0818e949 in zend_call_method (object_pp=0xbfffd838,
obj_ce=0x404e80ec,
fn_proxy=0x0, function_name=0x8210a37 "__destruct",
function_name_len=10,
retval_ptr_ptr=0x0, param_count=0, arg1=0x0, arg2=0x0)
at /home/kase/php5-200403011430/Zend/zend_interfaces.c:79
#4 0x081906d0 in zend_objects_destroy_object (object=0x404e85a4,
handle=1)
at /home/kase/php5-200403011430/Zend/zend_objects.c:71
#5 0x081926fe in zend_objects_store_del_ref (zobject=0x404e8584)
at /home/kase/php5-200403011430/Zend/zend_objects_API.c:134
#6 0x08181e4e in _zval_dtor (zvalue=0x404e8584)
at /home/kase/php5-200403011430/Zend/zend_variables.c:61
#7 0x0817a9bd in _zval_ptr_dtor (zval_ptr=0x404e8660)
at /home/kase/php5-200403011430/Zend/zend_execute_API.c:358
This should be fixed now. Thanks for the short reproducing script.
Andi
I don't think, that it is fixed in latest cvs.
Simply changing the script to this, the problem/bug still exists:
[...]
$ cat destruct_segfault.php
<?php
class test {
function __destruct() {
$this->foo = false;
}
public function start() {
throw new Exception();
}
}
function bar() {
$test = new test();
$test->start();
}
bar();
?>
$ php5 destruct_segfault.php
Fatal error: Uncaught exception 'exception' in
/usr/home/thekid/devel/php/tests/destruct_segfault.php:7
Stack trace:
#0 /usr/home/thekid/devel/php/tests/destruct_segfault.php(13):
test->start()
#1 /usr/home/thekid/devel/php/tests/destruct_segfault.php(16): bar()
#2 {main}
thrown in /usr/home/thekid/devel/php/tests/destruct_segfault.php on
line 7
Looks fine to me.
- Timm