On Sun, Sep 24, 2017 at 08:53:46PM +0300, Shlomi Fish wrote: > I see. Well, the general wisdom is that a program should not ever segfault, > but > instead gracefully handle the error and exit.
This only applies to applications, not to tools that let YOU write applications. I can write a trivial C program that gcc will compile into a program that segfaults. That doesn't mean gcc has a bug. It means my C program has a bug. Likewise, if you write a shell script that causes a shell to recurse infinitely and exceed its available stack space, the bug is in your script, not in the shell that faithfully tried to run it. (See also Chet's two replies pointing to FUNCNEST.)