bug-bash
[Top][All Lists]
Advanced

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

Re: Massive recursion -> SEGV


From: Jan Schampera
Subject: Re: Massive recursion -> SEGV
Date: Mon, 02 Jul 2012 20:36:06 +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

On 02.07.2012 15:57, Eric Blake wrote:

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

I more meant the shell interpreter, less the code I can write.

It would be possible to link bash with libsigsegv to install a graceful
stack overflow handler that allows a nicer exit message on failure;
other GNU projects that have done so include awk and m4.  But short of
introducing arbitrary limits (which goes against GNU philosophy), it is
not possible to detect stack overflow until after it happens, and the
only recovery possible after detecting stack overflow is a graceful
message and exit unless you go to extreme lengths to block signals
around every call to malloc or any other library function that grabs a lock.


Hi Eric,


yes, it's more about helpful messages (not neccesarily a recovery), less about limits in Bash or application (script, etc.).

The origin of this all was a "bugreport" to me about the manual lying about no limits on recursion - it turned out it was massive recursion and little stack - and a resulting SEGV.

I'm interested in people's thoughts there, like is it okay to just crash or would a message be better?

libsigsegv - I'll have a look.

Thanks.

--
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]