zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Kamil Dudka <kdudka@redhat.com>
Cc: "Zsh Hackers' List" <zsh-workers@zsh.org>
Subject: Re: unbounded recursive call in a shell script crashes zsh
Date: Tue, 11 Apr 2017 19:12:41 -0700	[thread overview]
Message-ID: <170411191241.ZM5298@torch.brasslantern.com> (raw)
In-Reply-To: <1569411.Kln6y2GJnM@kdudka-nb>

On Apr 11,  4:38pm, Kamil Dudka wrote:
}
} So the difference is caused by the fact that recent versions of zsh are
} more hungry on stack, so the stack allocation limit is exceeded before the 
} shell call recursion limit is reached.

Actually more recent versions should be *less* hungry because we no
longer use alloca() as the default for many local arrays (unless your
zsh was compiled with --enable-stack-allocation).

However, a LOT has changed since 4.3.11.  For example the warning about
"recursion limit exceeded" is from an entirely different part of the
code than "maximum nested function" -- the limit that was being hit in
4.3.11 is never reached with 5.3.1, so there's no way to tell whether
the older version might also have overflowed the stack.

In fact 4.3.11 running out of job table space means that it consumed
all malloc() memory before consuming all of the stack; 5.3.1 is much
better about heap footprint.


  reply	other threads:[~2017-04-12  2:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11 13:00 Kamil Dudka
2017-04-11 13:29 ` Jérémie Roquet
2017-04-11 14:01   ` Jérémie Roquet
2017-04-11 14:38     ` Kamil Dudka
2017-04-12  2:12       ` Bart Schaefer [this message]
2017-04-12  7:30         ` Kamil Dudka
2017-04-12 22:11           ` Bart Schaefer
2017-04-13 14:30             ` Kamil Dudka
2017-04-13 15:21               ` Jérémie Roquet
2017-04-13 16:01                 ` Jérémie Roquet
2017-04-15 16:14                   ` Bart Schaefer
2017-04-16 18:56                     ` Daniel Shahaf
2017-04-16 21:00                       ` Bart Schaefer
2017-04-16 23:12                         ` Daniel Shahaf
2017-04-17  0:17                           ` Bart Schaefer
2017-04-18 13:54                   ` Kamil Dudka
2017-04-19 21:01                     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=170411191241.ZM5298@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=kdudka@redhat.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).