php.net |  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
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: mike@php.net Assigned:
Status: Wont fix Package: Reproducible crash
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mike@php.net
New email:
PHP Version: OS:

 

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

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

Reproduce code:
---------------
<?php
function _r(){
    echo round(memory_get_usage()/1024) . "k\n";
    _r();
}
_r();
?>


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/libc.so.6
#1  0xbfe0105c in ?? ()
#2  0x408e2e85 in vfprintf () from /lib/libc.so.6
#3  0x408fb46b in vsprintf () from /lib/libc.so.6
#4  0x408e89dd in sprintf () from /lib/libc.so.6
#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



Patches

Pull Requests

History

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

Thanks,
Michael
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC