bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Massive recursion -> SEGV


From: Roman Rakus
Subject: Re: Massive recursion -> SEGV
Date: Sun, 01 Jul 2012 14:37:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

On 07/01/2012 02:03 PM, Jan Schampera wrote:
Hi folks,


a suggestion about recursive function calls (and not only that, of course).

Do you see a way for Bash to pull the emergency break before it runs out of stack here (to provide an error to the user, rather than a crash):

--------------------
f1() {
  f1
}

f1
--------------------

Currently it runs into a SEGV, where the number of recurions depends on the stack limit.

On a fast search I found no portable way, but there are ways for specific platforms, like getrusage() when stack is reported there.

Look for FUNCNEST variable. In recent release it is available.

RR



reply via email to

[Prev in Thread] Current Thread [Next in Thread]