ID: 20567
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Won\'t fix
-Bug Type: Reproducible crash
+Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.3.0RC1
New Comment:
You're recursively calling the constructer without end condition so the
stack overflows. As per previous discussions we will not make a defence
against this.
Previous Comments:
------------------------------------------------------------------------
[2002-11-22 04:29:48] [EMAIL PROTECTED]
The following code segfaults.
class Class2 extends Class1
{
}
class Class1
{
function Class2(){
return new Class2;
}
}
Class1::Class2();
I don't actually know if it's valid PHP code or not, but I don't think
it should segfault either way.
Conditions:
It only happens if Class2 extends Class1.
It only happens if Class2 does not have a constructor.
Confirmed with 4.2.2 and 4.3.0RC1 on Slackware 8.1, 2.4.19 and 4.2.3 on
FreeBSD 4.4-RELEASE.
Configure line: './configure' '--with-mysql'
'--with-apxs=/usr/sbin/apxs'
I've never done a backtrace before, and I'm not sure I did it right,
but hopefully this is of some use to someone... :)
(gdb) run
Starting program: /usr/local/bin/php index.html
Program received signal SIGSEGV, Segmentation fault.
0x0812cda5 in execute (op_array=0x81b6c34) at
/usr/src/php-4.3.0RC1/Zend/zend_execute.c:1002
1002 EX(fbc) = NULL;
(gdb) bt
#0 0x0812cda5 in execute (op_array=0x81b6c34) at
/usr/src/php-4.3.0RC1/Zend/zend_execute.c:1002
#1 0x081322ea in execute (op_array=0x81b6c34) at
/usr/src/php-4.3.0RC1/Zend/zend_execute.c:1639
#2 0x081322ea in execute (op_array=0x81b6c34) at
/usr/src/php-4.3.0RC1/Zend/zend_execute.c:1639
#3 0x081322ea in execute (op_array=0x81b6c34) at
/usr/src/php-4.3.0RC1/Zend/zend_execute.c:1639
#4 0x081322ea in execute (op_array=0x81b6c34) at
/usr/src/php-4.3.0RC1/Zend/zend_execute.c:1639
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20567&edit=1