zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-users@zsh.org
Subject: Re: Segmentation Fault on Stack Overflow
Date: Sun, 5 Jan 2014 17:58:31 +0000	[thread overview]
Message-ID: <20140105175831.4640d8a5@pws-pc.ntlworld.com> (raw)
In-Reply-To: <878uuwy0vk.fsf@ft.bewatermyfriend.org>

On Sat, 04 Jan 2014 02:46:55 +0100
Frank Terbeck <ft@bewatermyfriend.org> wrote:
> >> zsh% function inf() { inf }; inf
> >> inf: maximum nested function level reached
> 
> Huh. I must be remembering something incorrectly. The limit was in place
> since sometime in 2000¹. But you might be building with the
> ‘--disable-max-function-depth’ configuration option.
> 
> Otherwise the limit should be in place (it defaults to 1000). If the
> limit is in place, and the shell still crashes, it might be another
> issue, which I couldn't reproduce then.

The function depth limit is only a guess at the point where problems
might occur.  It depends on the local environment, both the physical
configuration and the per-process limits, whether this is good enough.

It might be possible to do a little better by querying some of the
memory-related limits (I would guess available stack space is the key
one, but some investigation will be necessary) to see if one of the
limits is getting short and aborting function calls in a handlable
fashion at that level.  Unhelpfully, limits (from getrlimit()) and
current usage (from getrusage()) don't seem to map cleanly onto one
another, and this is all rather system-specific, so this doesn't look
like a trivial project.

pws


      reply	other threads:[~2014-01-05 17:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-03 23:03 Russell Harmon
2014-01-03 23:36 ` Frank Terbeck
2014-01-04  1:16   ` Lawrence Velázquez
2014-01-04  1:46     ` Frank Terbeck
2014-01-05 17:58       ` Peter Stephenson [this message]

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=20140105175831.4640d8a5@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-users@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).