bug-bash
[Top][All Lists]
Advanced

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

Massive recursion -> SEGV


From: Jan Schampera
Subject: Massive recursion -> SEGV
Date: Sun, 01 Jul 2012 14:03:01 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20120613 Iceowl/1.0b1 Icedove/3.0.11

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.

--
Be conservative in what you do, be liberal in what you accept from others.
- jbp, master of the net, in RFC793




reply via email to

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