|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-08-29 10:19 UTC] alberty at neptunelabs dot de
Hi,
the follow call results a segfault:
<?php
class foo {
function out(){
static $stopper=0;
if ($stopper < 10) $this->out();
$stopper++;
}
}
$foo = new foo;
$foo->out();
?>
Tested with gcc3.1.1 and libc2.2.4
here is the backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x4044d4cc in _get_zval_ptr (node=0x816b018, Ts=0xbf8000bc, should_free=0xbf80008c) at /usr/src/php4/Zend/zend_execute.c:71
71 {
(gdb) bt
#0 0x4044d4cc in _get_zval_ptr (node=0x816b018, Ts=0xbf8000bc, should_free=0xbf80008c) at /usr/src/php4/Zend/zend_execute.c:71
#1 0x40445495 in zend_fetch_var_address (opline=0x816b004, Ts=0xbf8000bc, type=1) at /usr/src/php4/Zend/zend_execute.c:529
#2 0x40447900 in execute (op_array=0x816bf34) at /usr/src/php4/Zend/zend_execute.c:1237
#3 0x40449b55 in execute (op_array=0x816bf34) at /usr/src/php4/Zend/zend_execute.c:1643
#4 0x40449b55 in execute (op_array=0x816bf34) at /usr/src/php4/Zend/zend_execute.c:1643
#5 0x40449b55 in execute (op_array=0x816bf34) at /usr/src/php4/Zend/zend_execute.c:1643
...
Regards,
Steve
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 15:00:01 2026 UTC |
Yes, i know, but you have not read the script. I have declared $stopper as static! And also this script without any initializing also crashes: <?php class foo { var $stopper=0; function out(){ if ($this->stopper < 10) $this->out(); $this->stopper++; } } $foo = new foo; $foo->out(); ?> backtrace: Program received signal SIGSEGV, Segmentation fault. 0x4044d45d in zend_clean_garbage () at /usr/src/php4/Zend/zend_execute_locks.h:24 24 { (gdb) bt #0 0x4044d45d in zend_clean_garbage () at /usr/src/php4/Zend/zend_execute_locks.h:24 #1 0x40446b66 in execute (op_array=0x816c314) at /usr/src/php4/Zend/zend_execute.c:1054 #2 0x40449b55 in execute (op_array=0x816c314) at /usr/src/php4/Zend/zend_execute.c:1643 #3 0x40449b55 in execute (op_array=0x816c314) at /usr/src/php4/Zend/zend_execute.c:1643 Regards, Steve