|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26212 segfaults with recursive function calls
Submitted: 2003-11-12 05:57 UTC Modified: 2003-11-13 03:42 UTC
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: Assigned:
Status: Wont fix Package: Reproducible crash
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
New email:
PHP Version: OS:


 [2003-11-12 05:57 UTC]
PHP crashes after some time when recursive function calls are used intensively.

Probably a "Wont Fix"? -> Bug #8471

Reproduce code:
function _r(){
    echo round(memory_get_usage()/1024) . "k\n";

Expected result:
endless loop, which outputs nearly similar memory usage as it would with "while(true){ _r(); }" without recursion

Actual result:
increasing memory usage till segfault after a few seconds

Backtrace of PHP 5.0.0b2:

#0  0x408e5acb in __printf_fp () from /lib/
#1  0xbfe0105c in ?? ()
#2  0x408e2e85 in vfprintf () from /lib/
#3  0x408fb46b in vsprintf () from /lib/
#4  0x408e89dd in sprintf () from /lib/
#5  0x08236388 in zend_locale_sprintf_double (op=0x409c3ff4)
    at /usr/local/src/php-5.0.0b2/Zend/zend_operators.c:1845
#6  0x082370fb in zend_make_printable_zval (expr=0x409c3ff4, expr_copy=0x2,
    use_copy=0x9) at /usr/local/src/php-5.0.0b2/Zend/zend.c:245
#7  0x08234ee8 in concat_function (result=0x9, op1=0x409c3ff4, op2=0x2)
    at /usr/local/src/php-5.0.0b2/Zend/zend_operators.c:1083
#8  0x08252a11 in zend_concat_handler (execute_data=0x2, op_array=0x83fad68)
    at /usr/local/src/php-5.0.0b2/Zend/zend_execute.c:1361
#9  0x082524c5 in execute (op_array=0x83fad68)
    at /usr/local/src/php-5.0.0b2/Zend/zend_execute.c:1271
#10 0x082555e0 in zend_do_fcall_common_helper (execute_data=0x9,
    op_array=0x83fad68) at /usr/local/src/php-5.0.0b2/Zend/zend_execute.c:2579
#11 0x082524c5 in execute (op_array=0x83fad68)
#10843 0x082524c5 in execute (op_array=0x83fad68)
    at /usr/local/src/php-5.0.0b2/Zend/zend_execute.c:1271
#10844 0x082555e0 in zend_do_fcall_common_helper (execute_data=0xbfffd930,
    op_array=0x40a5ce4c) at /usr/local/src/php-5.0.0b2/Zend/zend_execute.c:2579
#10845 0x082524c5 in execute (op_array=0x40a5ce4c)
    at /usr/local/src/php-5.0.0b2/Zend/zend_execute.c:1271
#10846 0x08238355 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /usr/local/src/php-5.0.0b2/Zend/zend.c:1009
#10847 0x08206d9d in php_execute_script (primary_file=0xbffffce0)
    at /usr/local/src/php-5.0.0b2/main/main.c:1622
#10848 0x082654a2 in main (argc=2, argv=0xbffffd64)
    at /usr/local/src/php-5.0.0b2/sapi/cli/php_cli.c:910


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-13 03:42 UTC]
Well, I'd like to hear why this will never be fixed.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 15 03:01:28 2024 UTC