|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29242 Deep recursion crashes PHP
Submitted: 2004-07-18 11:57 UTC Modified: 2004-07-18 18:44 UTC
Avg. Score:4.3 ± 0.5
Reproduced:6 of 6 (100.0%)
Same Version:1 (16.7%)
Same OS:2 (33.3%)
From: miancule at yahoo dot com Assigned:
Status: Wont fix Package: Reproducible crash
PHP Version: 4.3.7 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
47 - 8 = ?
Subscribe to this entry?

 [2004-07-18 11:57 UTC] miancule at yahoo dot com
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:
function recurse($count)
  echo $count.'<br/>';
  if ($count < 10000)
die 'No crash';

Expected result:
No crash

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


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Jan 27 21:05:54 2023 UTC