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

Re: unbounded recursive call in a shell script crashes zsh



On Tuesday, April 11, 2017 19:12:41 Bart Schaefer wrote:
> In fact 4.3.11 running out of job table space means that it consumed
> all malloc() memory before consuming all of the stack;

I cannot confirm your hypothesis.  In my testing environment, zsh-4.3.11 
raised the error when the condition (newsize > MAX_MAXJOBS) in expandjobtab() 
became true:

https://sourceforge.net/p/zsh/code/ci/zsh-4.3.11/tree/Src/jobs.c#l1735

At that time, the total amount of memory allocated by malloc() was 689120 
bytes (<1 MiB) on an x86_64 machine with 16 GiB of physical memory.

> 5.3.1 is much better about heap footprint.

Definitely an improvement but it does not solve the problem in question.

Kamil



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