[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Segfault on recursive trap/kill
From: |
Mike Gerwitz |
Subject: |
Re: Segfault on recursive trap/kill |
Date: |
Sun, 07 Oct 2018 13:21:34 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
On Sun, Oct 07, 2018 at 08:52:25 +0200, Valentin Bajrami wrote:
> As earlier expained, you are calling foo function recursively. To mitigate
> this behaviour you simple set FUNCNEST=<N> foo() { foo; }; foo where N
> denotes the number of nested functios to be called.
This is perfect and clear behavior, actually:
$ FUNCNEST=10; foo() { foo; }; foo
bash: foo: maximum function nesting level exceeded (10)
If bash were to set a default value for FUNCNEST then a useful error
would be provided rather than segfaulting (and possibly triggering a
coredump). Of course, if bash itself is sharing a stack with the
interpreter, then it's hard to come up with a good predetermined value.
FUNCNEST doesn't seem to work with the issue of recursive traps, though
(understandably).
--
Mike Gerwitz
signature.asc
Description: PGP signature
Re: Segfault on recursive trap/kill, Robert Elz, 2018/10/06