php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5025 Segmentation fault when using deeply nested scripts
Submitted: 2000-06-14 11:29 UTC Modified: 2000-07-23 15:14 UTC
From: mlemos at acm dot org Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0 Latest CVS (14/06/2000) OS: Linux
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mlemos at acm dot org
New email:
PHP Version: OS:

 

 [2000-06-14 11:29 UTC] mlemos at acm dot org
When running a large multi-file script using PHP standalone CGI executable
from the shell, it crashes with segmentation fault after running a long and
deeply nested (but not recursive) script. This also happens with PHP 3.

Running gdb with the latest PHP 4 version, there were 376 stack frames when
the program crashed somewhere in Zend code. I thought it was a stack limit
problem, but then I run ulimit -s unlimit and it still crashed in the same
code. I also set the memory limit to a very high value but with no change.

I have a 800KB strace output file if that helps, but all it is seen before
the crash is a long sequence of brk() calls. If strace or gdb output helps
just mail me back and I'll send the output to an address you want.

Since I am stuck without being able to do anything to work around this
crash, I am willing to open a telnet port so you can login in my machine
when I am online, as my Internet link is not permanent. Just mail me
or better, page me to ICQ UIN 15699174.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-15 06:23 UTC] mlemos at acm dot org
Phew, it turned out to be infinite recursion problem.  I was in sympathy
error with my code and I could not figure that it was going through a large
infinite recursion loop.

I don't think there is nothing to fix in PHP except for some mechanisms to
prevent programmers to go crazy with sympathy error due to infinite
recursion like I was.  Infinite recursion problems is programmers fault,
but it would be nice if there was an option that would enforce a an
effective limit to how many time a function may call itself whether
directly or indirectly.

The way it is now, these simple lines make PHP crash with segmentation fault:

<?

Function myfunction()
{
    return(myfunction());
}

echo myfunction();

?>
 [2000-07-23 15:14 UTC] jalal at cvs dot php dot net
User solved problem by not using infinite recursion.
Recommended practise.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 21:00:01 2026 UTC