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