|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24578 A stack overflow in a php-script leads to a segmentation fault.
Submitted: 2003-07-10 03:34 UTC Modified: 2003-07-13 10:51 UTC
Avg. Score:4.8 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:2 (33.3%)
Same OS:0 (0.0%)
From: daniel dot goss at t-systems dot com Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.3.2 OS: RedHat 8.0, 7.3
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:
32 + 48 = ?
Subscribe to this entry?

 [2003-07-10 03:34 UTC] daniel dot goss at t-systems dot com
I know this bug has been reported as "Bug #18909: Stack overflow error" but I think this should be fixed and not treated as bogus like in bug #18909.
Scripting engines should _never_ segfault!

A stack overflow in a recursive php-function leads the php-engine to a segmentation fault.

There is a second issue that could be in associated with this one. If a function is called very often (sometimes recoursive - depth not greater than 20) php crashes too. We've not investigated this issue further enough to write a script to reproduce this behaviour.

Reproduce code:
  function MyTest($A, $B, $C, $D, $E, $F, $G)
  	for ($k=0; $k<100; $k++)
	    echo "|".$A++."|<BR>";
  		MyTest($A, "", "", "", "", "", "");

Expected result:
A php error complaining about a stack overflow.

Actual result:
[notice] child pid 29029 exit signal Segmentation fault (11)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-11 02:56 UTC] bharat at menalto dot com
Here's a very simple test case to reproduce this bug:

function crash($data) { 
 [2003-07-11 03:07 UTC] daniel dot goss at t-systems dot com
We've investigates the "second issue" and have reported it under Bug #24581.
 [2003-07-13 10:51 UTC]
This won't be "fixed". Just don't do this.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Aug 13 09:05:44 2022 UTC