From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25069 invoked by alias); 16 May 2017 09:48:46 -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: 41112 Received: (qmail 4217 invoked from network); 16 May 2017 09:48:46 -0000 X-Qmail-Scanner-Diagnostics: from mailout1.w1.samsung.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(210.118.77.11):SA:0(-5.0/5.0):. Processed in 1.95203 secs); 16 May 2017 09:48:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at samsung.com does not designate permitted sender hosts) X-AuditID: cbfec7f2-f797e6d000004438-c4-591acaf2abd5 Date: Tue, 16 May 2017 10:48:31 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: zsh 5.3.1 crashes on completion Message-id: <20170516104831.14aa23c6@pwslap01u.europe.root.pri> In-reply-to: <170515133354.ZM20191@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNIsWRmVeSWpSXmKPExsWy7djP87qfTklFGry8oWxxsPkhkwOjx6qD H5gCGKO4bFJSczLLUov07RK4Mt4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5MZJMEioCpxZ+o+MJtNwFBi6qbZ jCC2iIC4xNm151lAlgkL6Ejs318AEuYVsJe4f2wZ2DJOASuJC0297BAz9zFLTL77HWwZv4C+ xNW/n5ggrrOXmHnlDCNEs6DEj8n3WEBsZgEtic3bmlghbHmJzWveMkMcqi5x4+5u9gmMwrOQ tMxC0jILScsCRuZVjCKppcW56bnFhnrFibnFpXnpesn5uZsYgRG07djPzTsYL20MPsQowMGo xMO7YoVkpBBrYllxZe4hRgkOZiUR3t2rpCKFeFMSK6tSi/Lji0pzUosPMZoCA2Yis5Rocj4w uvNK4g1NDM0tDY2MLSzMjYyUxHlLPlwJFxJITyxJzU5NLUgtgulj4uCUamCsiii12vTiTELV aTehyds9Sn/0/VYI+fkxS5e7jLFIKfjuIjnlHK9b4g+77uZsKXWY9V3BKePd1MTVPLe62abs 8XFxXKKrkPBM+IZb+9+NacIHpY0S0+yuxl74XFir42RTWHutgb3ydnSViITliZI0M6FlocnZ MYVFmle0Db+EmLAcUHzXoMRSnJFoqMVcVJwIAHumCfi2AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170516094834eucas1p2cdd010a7c8de3202dc200ea51242a251 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?UGV0ZXIgU3RlcGhlbnNvbhtTQ1NDLURhdGEgUGxhbmUb?= =?UTF-8?B?7IK87ISx7KCE7J6QG1ByaW5jaXBhbCBFbmdpbmVlciwgU29mdHdhcmU=?= X-Global-Sender: =?UTF-8?B?UGV0ZXIgU3RlcGhlbnNvbhtTQ1NDLURhdGEgUGxhbmUbU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtQcmluY2lwYWwgRW5naW5lZXIsIFNvZnR3YXJl?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDA1Q0QwNTAwNTg=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170513182335epcas3p2ddebe4bda1f5c273cce7a5902d621aa7 X-RootMTR: 20170513182335epcas3p2ddebe4bda1f5c273cce7a5902d621aa7 References: <170511141903.ZM13639@torch.brasslantern.com> <20170512161603.GA16688@fujitsu.shahaf.local2> <783A691B-B69F-4673-B237-B316CEF26346@remrain.com> <170513112313.ZM14712@torch.brasslantern.com> <20170515102819.39284ef6@pwslap01u.europe.root.pri> <170515133354.ZM20191@torch.brasslantern.com> On Mon, 15 May 2017 13:33:54 -0700 Bart Schaefer 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