On Thu, Aug 28, 2014 at 11:49:02AM -0700, bogun.dmit...@gmail.com wrote: > So why I should got SIGSEGV instead of nice, detailed error message in > recursion? We can detect it?
You can't detect that it's going to happen. You can only receive the SIGSEGV *after* it happens. We already have a configurable switch that would have prevented your original issue: Functions may be recursive. The FUNCNEST variable may be used to limit the depth of the function call stack and restrict the number of function invocations. By default, no limit is imposed on the number of recursive calls. Just export FUNCNEST=1000 somewhere in your dotfiles and you'll never have this particular seg fault again (assuming all your scripts run in an environment that inherits this). The default of 0 is quite reasonable, as others have already explained.