php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50863 Simple recursion results in bus error (core dumped) on approx 10k depth
Submitted: 2010-01-27 18:52 UTC Modified: 2010-01-28 01:38 UTC
From: cyrrus at mail dot ru Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.2.12 OS: FreeBSD 5.3
Private report: No CVE-ID: None
 [2010-01-27 18:52 UTC] cyrrus at mail dot ru
Description:
------------
Configure:
./configure --disable-all --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-zlib --with-zlib-dir=/src/zlib-1.2.1/ --with-libxml-dir --enable-sockets --with-gd=/usr/local/ --with-pcre-regex --with-png-dir=/src/libpng-1.2.8-config --with-freetype-dir=/usr/local/include/freetype2/ --enable-gd-native-ttf --with-ttf --disable-reflection --with-iconv --enable-session --enable-spl --enable-libxml --enable-simplexml

Eaccelerator 0.9.5.3 is used.

#0  ZEND_RECV_SPEC_HANDLER (execute_data=0xbfb000d0) at /src/php-5.2.12/Zend/zend_execute.c:276
#1  0x0818d105 in execute (op_array=0x8397600) at zend_vm_execute.h:92
#2  0x0818d351 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfb00210) at zend_vm_execute.h:234
#3  0x0818d105 in execute (op_array=0x8397600) at zend_vm_execute.h:92
#4  0x0818d351 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfb00350) at zend_vm_execute.h:234
...
...
#6486 0x08173731 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /src/php-5.2.12/Zend/zend.c:1134
#6487 0x0813a7b1 in php_execute_script (primary_file=0xbfbfec64) at /src/php-5.2.12/main/main.c:2036
#6488 0x081ef55d in main (argc=3, argv=0xbfbfed04) at /src/php-5.2.12/sapi/cli/php_cli.c:1165


Reproduce code:
---------------
<?php
function MyRecurs( $a )
{
        $a++;
        if ( $a < 100000 ) return MyRecurs( $a );
        else return 1;
}

echo "MyRecurs = " . MyRecurs( 0 );
?>


Expected result:
----------------
MyRecurs = 1
or
Fatal error: Allowed memory size of *** bytes exhausted (tried to allocate *** bytes) in ***.php on line 5

Actual result:
--------------
Bus error (core dumped)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-28 01:38 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 05:01:29 2024 UTC