From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: "Dirk-Jan C. Binnema" <djcb@djcbsoftware.nl>
Cc: zsh-users@zsh.org
Subject: Re: segfault in mkundoent when completing
Date: Mon, 26 Oct 2015 09:49:41 +0000 [thread overview]
Message-ID: <20151026094941.7354c721@ntlworld.com> (raw)
In-Reply-To: <87fv0ym71h.fsf@djcbsoftware.nl>
On Mon, 26 Oct 2015 09:18:50 +0200
Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> wrote:
> Hmmm, it seems some kind of interaction between a few different things;
> but I was amble to reproduce it with this ~/.zshrc (using the external
> highlighting package):
>
> --8<---------------cut here---------------start------------->8---
> setopt allexport
> autoload -U compinit
> compinit
> source ~/Sources/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
> --8<---------------cut here---------------end--------------->8---
Yes, this is showing it's...
> Hmm... the change in question adds mkundoent() in a different context.
> I'm wondering if that UNMETACHECK() just above the crash might go off if
> this were copmiled with --enable-zsh-debug. But I couldn't get this to
> happen easily myself, even adding an extra DPUTS().
I presume there are now a few extra hooks around causing it to happen in
completion context.
The easiest thing is to add protection we've already get in
handleundo(), which I've just copied verbatim.
pws
diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c
index 714d911..ffff8fd 100644
--- a/Src/Zle/zle_utils.c
+++ b/Src/Zle/zle_utils.c
@@ -1739,9 +1739,26 @@ zlecallhook(char *name, char *arg)
zlong
get_undo_current_change(UNUSED(Param pm))
{
+ int remetafy;
+
+ /*
+ * Yuk: we call this from within the completion system,
+ * so we need to convert back to the form which can be
+ * copied into undo entries.
+ */
+ if (zlemetaline != NULL) {
+ unmetafy_line();
+ remetafy = 1;
+ } else
+ remetafy = 0;
+
/* add entry for any pending changes */
mkundoent();
setlastline();
+
+ if (remetafy)
+ metafy_line();
+
return undo_changeno;
}
prev parent reply other threads:[~2015-10-26 9:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <874mhfe8ng.fsf@djcbsoftware.nl>
[not found] ` <151025095136.ZM29675@torch.brasslantern.com>
[not found] ` <87y4eqahet.fsf@djcbsoftware.nl>
[not found] ` <151025180706.ZM30568@torch.brasslantern.com>
2015-10-26 7:18 ` Dirk-Jan C. Binnema
2015-10-26 9:49 ` 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=20151026094941.7354c721@ntlworld.com \
--to=p.w.stephenson@ntlworld.com \
--cc=djcb@djcbsoftware.nl \
--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).