|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-02-06 17:18 UTC] nathan at synop dot com
-------------------
<%
function a () {
b();
}
function b () {
a();
}
a();
%>
<h1>done</h1>
---------------------
The simple script above causes a seg fault. If you need more info on configuration etc please mail me. We made this simple example from a more compilcated instance. This bug was also present in 4.0.3pl1, we upgraded to try and stop the seg fault...
thanks!
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 13:00:01 2025 UTC |
and guess this "bug" was present in any version before, what do you expect to happen here? you will never leave these function calls (as you know I guess), as far as your stack is full it is full remember php has to remember each and every function call it did... a() b() a() b() .... if you really need exactly this construct, I would suggest you to use a static variable to count the total function calls and find the critical values a specific system segfaults (with your original code), then you stick a for(;;) around it and implement a check (eg. in a()) against the static variable to leave the recursion if a value with enough distance to the critical value is reached, then you should be able to begin the recursion again any recursion can be displayed as a loop, do not use recursion if you want to recurse infinitely