From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12649 invoked by alias); 8 Nov 2012 15:16:10 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30786 Received: (qmail 14190 invoked from network); 8 Nov 2012 15:16:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <121108071539.ZM2792@torch.brasslantern.com> Date: Thu, 08 Nov 2012 07:15:39 -0800 In-reply-to: <20378.1352370323@thecus.kiddle.eu> Comments: In reply to Oliver Kiddle "r in completion function causes zsh abort" (Nov 8, 11:25am) References: <20378.1352370323@thecus.kiddle.eu> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh workers Subject: Re: r in completion function causes zsh abort MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Nov 8, 11:25am, Oliver Kiddle wrote: } } After accidentally leaving a spurious `r' in a completion function, zsh } crashes "r" will of course attempt to invoke command history; it's not surprising that doing so down in the guts of a completion function dives into some code that's not prepared to be called at that juncture. Sure enough, the stack trace is abort free hend loop bin_fc execbuiltin (Don't have debugging compiled on the machine where I'm able to test this right now.) There's no way bin_fc should be calling the main loop during completion, and probably not at any time while zle is active (which is a lot easier to test). Feel free to suggest a better error message ... Index: Src/builtin.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v retrieving revision 1.267 diff -u -r1.267 builtin.c --- Src/builtin.c 11 Oct 2012 20:14:03 -0000 1.267 +++ Src/builtin.c 8 Nov 2012 15:14:41 -0000 @@ -1414,6 +1414,12 @@ unqueue_signals(); return 0; } + + if (zleactive) { + zwarnnam(nam, "no interactive history within ZLE"); + return 1; + } + /* put foo=bar type arguments into the substitution list */ while (*argv && equalsplit(*argv, &s)) { Asgment a = (Asgment) zhalloc(sizeof *a);