From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10713 invoked by alias); 15 May 2017 20:33:38 -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: 41106 Received: (qmail 12281 invoked from network); 15 May 2017 20:33:37 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua0-f169.google.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(209.85.217.169):SA:0(0.5/5.0):. Processed in 1.440607 secs); 15 May 2017 20:33:37 -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=0.5 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_SPAM,SPF_PASS, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.169 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=Vxzcdh8N0OtN5827T00+7SeCnMgJzum4nN0DM2CsF1s=; b=wQAhMh3QGqIDDbc7Du3qqhZNVGh81ptoAtYWEMmoqa3XafKYpteU2tcM8FFEUTdHMO GmnTCfw5alEiBkyus6XydYZ0ZDRAyF6BRouKltR9Tmp8o8IGZSRfFE4XR+joefC2IY+Z 0S1H0IXo8yxEqBXMsmgngJmGraFnrCUL7SRQbueLWGVCqOHeBuZZHHwuv+spkcqJEXJZ soQwzYr47gh68w7bPaeLW6CvcwZod6CZufLEiJpvmXZwG0LPPI5aG+O6mFS4fOmCaT3D fmWpiirJv/gnzdKbOokTW7/r+4LujhkIAekn1M0vlah5V4+Us/56NQGm+dDg7SnoI7yk VZFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=Vxzcdh8N0OtN5827T00+7SeCnMgJzum4nN0DM2CsF1s=; b=MotMhlRS1kUxQ+rimL6BIkiGKXCMGYqc0Ubd0biMZvTIKiLEEGp+Hv5TWCYlym58kV +FirjTjRa4tjgsFxmal3AG2y9aRRNbm32ojP4iqr0ZvUBBIVEXDtztZIp67+nF63+zCh dywtqfQZon6VruXv3v2aOQL2C6a+tssOv10J3EG8yFxvZP7b/gvY+jc+el9oOqgOGcPq ATWpu9cnB/zpZonQkKH5kAVVHNyEaRVEjX5rxVilvn2YIuG+UuSz8UVQeHpkXqOzIwoC IleM9R1c3agqgc6t9IT8HoQ0G6aiqNQOgQDoMFV8x7nN9svfPCi+VpVda+ynHNGOWJyG 1xag== X-Gm-Message-State: AODbwcBYlt8Qb7H4yblEStawFEu4qiuEXVdZy6OThrXomeSaHkbU1p4Q fklbUmi56QZkuqhJ X-Received: by 10.176.84.209 with SMTP id q17mr3370470uaa.119.1494880409734; Mon, 15 May 2017 13:33:29 -0700 (PDT) From: Bart Schaefer Message-Id: <170515133354.ZM20191@torch.brasslantern.com> Date: Mon, 15 May 2017 13:33:54 -0700 In-Reply-To: <20170515102819.39284ef6@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: zsh 5.3.1 crashes on completion" (May 15, 10:28am) 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> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: zsh 5.3.1 crashes on completion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 15, 10:28am, Peter Stephenson wrote: } Subject: Re: zsh 5.3.1 crashes on completion } } On Sat, 13 May 2017 11:23:13 -0700 } Bart Schaefer wrote: } > The crash occurs when the history in the subshell is updated to remove } > the duplicate of the previous command. Adding new history events is } > disabled in subshells so the new event that is supposed to replace the } > old one does not exist, and the code wanders off into neverland. } } I suppose removing duplicates could be disabled in subshells as well? 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*. One tangent seems to be that in a subshell, "save" in hend() ought to become zero, because we never (?) want to write out the history of a subshell. But without resorting to another hack on zsh_subshell like I did in entersubsh(), I don't know how to tell in hend() that the history doesn't need to be saved. The reason this crashes in completion seems to be that loop() is being called before ZLE exits, so the parent loop() is still "open" and no previous call to hend() has been done. Otherwise this would fail on *any* use of `r`. (Expand-word will trip the bug as well.) So maybe, really, loop() needs an entry point that doesn't use hbegin() and hend(). Or maybe that's overkill. Like I said, I don't know at which of all these places to apply a fix.