From:             miancule at yahoo dot com
Operating system: Windows XP
PHP version:      4.3.7
PHP Bug Type:     Reproducible crash
Bug description:  Deep recursion crashes PHP

Description:
------------
PHP 4.3.7
Apache 2.0.49
Windows XP

Deep recursion crashes the Apache process with status = 128.

[Sun Jul 18 12:29:08 2004] [notice] Parent: child process exited with
status 128 -- Restarting.

It seems the error occurs at somehow random recursion levels (it can go
from recursion level 100 to 1000).

I understand that a stack overflow might occur, but for the sample below a
decent implementation should allow very large recursion depths.

Reproduce code:
---------------
<?php
function recurse($count)
{
  echo $count.'<br/>';
  if ($count < 10000)
    recurse(++$count);
}
recurse(0);
die 'No crash';
?>

Expected result:
----------------
0
1
..
999
No crash

Actual result:
--------------
No output (because the server process is killed prematurely).

-- 
Edit bug report at http://bugs.php.net/?id=29242&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29242&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29242&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29242&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29242&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29242&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29242&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29242&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29242&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29242&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29242&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29242&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29242&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29242&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29242&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29242&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29242&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29242&r=float

Reply via email to