#19172 [Bgs->Csd]: limited recursive class call results segfault
| From: | alberty at neptunelabs dot de | Date: | Thu, 29 Aug 2002 14:44:17 +0000 |
| Subject: | #19172 [Bgs->Csd]: limited recursive class call results segfault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-18160@lists.php.net to get a copy of this message | ||
ID: 19172
User updated by: alberty@neptunelabs.de
Reported By: alberty@neptunelabs.de
-Status: Bogus
+Status: Closed
Bug Type: Reproducible crash
Operating System: i686-pc-linux-gnu
PHP Version: 4CVS-2002-08-29
New Comment:
Okay, this was absolutly my fault.
This BR was not really intelligent.
Sorry.
Previous Comments:
------------------------------------------------------------------------
[2002-08-29 10:36:24] cynic@php.net
umm, derick, my last comment was for the OP, you were too fast. :)
------------------------------------------------------------------------
[2002-08-29 10:34:34] cynic@php.net
no, it's actually you who has not read the script. you have a bug
there.
leave this PR bogusified.
------------------------------------------------------------------------
[2002-08-29 10:33:48] derick@php.net
Of course it does, you do the next function call before you increase
$stopper.
This way $stopper will always stay 0 when it enters the function
again.
Derick
------------------------------------------------------------------------
[2002-08-29 10:31:29] alberty@neptunelabs.de
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
------------------------------------------------------------------------
[2002-08-29 10:22:14] derick@php.net
erm,
you're initializing the variable to 0 every time you enter this
function, and the result will be that this function keeps calling
itself indefinetely.
As disucussed on the dev list before we will not fix this.
Derick
------------------------------------------------------------------------
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/19172
--
Edit this bug report at http://bugs.php.net/?id=19172&edit=1