From:             ja at morrdusk dot net
Operating system: Mac OS X 10.2.4
PHP version:      4.3.2RC1
PHP Bug Type:     Reproducible crash
Bug description:  Segfault when calling a function recursively

I expected an out of memory error or something similar but instead I got a
segmentation fault when executing the following script:

<?php

function foo()
{
        foo();
}

foo();

?>

$ php foo.php 
zsh: 20003 segmentation fault  php foo.php

Gdb output, the backtrace was huge so I only included the first 10 lines:

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x900042f0 in free_list_add_ptr ()
(gdb) bt
#0  0x900042f0 in free_list_add_ptr ()
#1  0x90004a44 in malloc_zone_malloc ()
#2  0x000c1294 in _emalloc (size=40) at
/Volumes/Data/apps/php/php-4.3.2RC1/Zend/zend_alloc.c:158
#3  0x000e0314 in execute (op_array=0x44225c) at
/Volumes/Data/apps/php/php-4.3.2RC1/Zend/zend_execute.c:1627
#4  0x000e0404 in execute (op_array=0x476c20) at
/Volumes/Data/apps/php/php-4.3.2RC1/Zend/zend_execute.c:1650
#5  0x000e0404 in execute (op_array=0x476c20) at
/Volumes/Data/apps/php/php-4.3.2RC1/Zend/zend_execute.c:1650
#6  0x000e0404 in execute (op_array=0x476c20) at
/Volumes/Data/apps/php/php-4.3.2RC1/Zend/zend_execute.c:1650
#7  0x000e0404 in execute (op_array=0x476c20) at
/Volumes/Data/apps/php/php-4.3.2RC1/Zend/zend_execute.c:1650
#8  0x000e0404 in execute (op_array=0x476c20) at
/Volumes/Data/apps/php/php-4.3.2RC1/Zend/zend_execute.c:1650
#9  0x000e0404 in execute (op_array=0x476c20) at
/Volumes/Data/apps/php/php-4.3.2RC1/Zend/zend_execute.c:1650
#10 0x000e0404 in execute (op_array=0x476c20) at
/Volumes/Data/apps/php/php-4.3.2RC1/Zend/zend_execute.c:1650
-- 
Edit bug report at http://bugs.php.net/?id=22831&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22831&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22831&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22831&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22831&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22831&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22831&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22831&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22831&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22831&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22831&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22831&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22831&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22831&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22831&r=gnused

Reply via email to