zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: zsh 5.3.1 crashes on completion
Date: Tue, 16 May 2017 10:48:31 +0100	[thread overview]
Message-ID: <20170516104831.14aa23c6@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <170515133354.ZM20191@torch.brasslantern.com>

On Mon, 15 May 2017 13:33:54 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> It's a bit more subtle than that.  The current history line (chline)
> is actually pointing into the previous event, which is being taken as
> a duplicate of *itself*.

This is certainly murky.  The loop(0, 1) in bin_fc is a one-off, not
like anything else in the shell, and fc, as you already implied, isn't
really fit for running non-interactively anyway.

zcontext_save() in loop() will run, since this isn't a top-level loop,
which will save and clear chline.  So it should be the case the the loop
we have for fc has a clean history state.  So I wonder if something else to do
with the state (that maybe we should be saving and clearing at the same
time?) is screwy owing to not having finished the top-level history
line.  Either that, or something is running twice in the subshell when
it shouldn't.

I'm not seeing the falling call debug trigger, anyway, though it's quite
hard to see in the case with the memory corruption which is reporting
errors from glibc.  Promoting it to a hard error with a return didn't
seem to make any difference, either.

pws

diff --git a/Src/hist.c b/Src/hist.c
index 350688d..c68b2ae 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -1035,6 +1035,7 @@ hbegin(int dohist)
 	stophist = (!interact || unset(SHINSTDIN)) ? 2 : 0;
     else
 	stophist = 0;
+    DPUTS(chline != NULL, "chline set at start of history");
     /*
      * pws: We used to test for "|| (inbufflags & INP_ALIAS)"
      * in this test, but at this point we don't have input


  reply	other threads:[~2017-05-16  9:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11  2:35 ChenYao
2017-05-11 21:19 ` Bart Schaefer
2017-05-12 16:16   ` Daniel Shahaf
2017-05-12 16:19     ` Bart Schaefer
2017-05-13  2:02     ` ChenYao
2017-05-13 18:23       ` Bart Schaefer
2017-05-15  9:28         ` Peter Stephenson
2017-05-15 20:33           ` Bart Schaefer
2017-05-16  9:48             ` Peter Stephenson [this message]
2017-05-16 11:05               ` Peter Stephenson
2017-05-17 18:18                 ` Bart Schaefer
2017-05-17 18:41                   ` Peter Stephenson
2017-05-25 16:01                 ` Jun T.
2017-05-25 18:05                   ` Bart Schaefer
2017-05-26  9:19                   ` Peter Stephenson
2017-05-26 23:56                     ` Bart Schaefer
2017-05-29  4:04                     ` Jun T.
2017-05-17 18:07               ` 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=20170516104831.14aa23c6@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.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).