Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh glitch



On Tue, 10 Nov 2015 22:43:20 +0100
Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> If it segfaults here, it's either because you're running an old
> version or the compiler miscompiled, or the zsh code disagrees with
> the compiler about what can be optimized out. What should happen is
> the following:
> 
> % (ls(); ls; ls)
> ls:1: maximum nested function level reached

It's basically luck whether you hit the maximum recursion depth before
you run out of stack (and hence crash) or not.  There's no easy way for
the shell to tell when this is going to happen, so it's very system
dependent.

The only better way out I can see is for someone with a wider knowledge
of the sort of systems they're compiling zsh for to attempt a more
appropriate configuration with --enable-max-function-depth=MAX.
The default is 1000; a nice round number that works in a lot of places
is about the best we can do generally.  For general purpose Linux
distributions I suspect that statement continues to apply.

pws



Messages sorted by: Reverse Date, Date, Thread, Author