From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 34738c53 for ; Thu, 26 Sep 2019 14:49:18 +0000 (UTC) Received: (qmail 1303 invoked by alias); 26 Sep 2019 14:49:07 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24290 Received: (qmail 10634 invoked by uid 1010); 26 Sep 2019 14:49:07 -0000 X-Qmail-Scanner-Diagnostics: from mail-40136.protonmail.ch by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25580. spamassassin: 3.4.2. Clear:RC:0(185.70.40.136):SA:0(-2.7/5.0):. Processed in 2.69319 secs); 26 Sep 2019 14:49:07 -0000 X-Envelope-From: dennis.schwartz@protonmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.protonmail.ch designates 185.70.40.136 as permitted sender) Date: Thu, 26 Sep 2019 14:48:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1569509306; bh=clXnRz31LLx19HRXkJxlMoKQZWrMHvLevaSdeIeqejM=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References: Feedback-ID:From; b=Ej8YfVR60G7N5mZzzh5+LPQ4QEL7Q0RXCjLch/t3TZ+y+3LjR4Vwvmrf924rLm2fC uHVmfmNC8+r0QyOvjyPZ4TO3WnZiFUp7hHkZHI4SUN0wOwdBRaHrl9vd5OS9sk29M2 hUefG39kltb4agTpyrnHDgpYiGqKboK6KCGxbObg= To: Peter Stephenson From: Dennis Schwartz Cc: "zsh-users@zsh.org" Reply-To: Dennis Schwartz Subject: Re: TRAPINT doesn't work reliably Message-ID: In-Reply-To: <1569434163.10786.26.camel@samsung.com> References: <1569314663.5531.4.camel@samsung.com> <1394985674.3969083.1569420087673@mail2.virginmedia.com> <22AgAhXQWzavJGhNA8tFbGSMGk8z3KDGGa-pICX0lWszH622z2_nnc1acuvW3OcIbqAaXM_WAGJwmQU5Oph83DGbfQEplu1t3o7F5omeC4w=@protonmail.com> <1569434163.10786.26.camel@samsung.com> Feedback-ID: 9o-Cl1kmi7SjXhHVTYCKLMaOWEb5sehZHGWJCh5kD69wcWVVeOfY5BYq3wMUF0ymJu-oBC8u1h80JJ91GEz6Og==:Ext:ProtonMail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wednesday, September 25, 2019 7:56 PM, Peter Stephenson wrote: > On Wed, 2019-09-25 at 16:25 +0000, Dennis Schwartz wrote: > > > =3D=3D1896=3D=3D=C2=A0=C2=A0Block was alloc'd at > > =3D=3D1896=3D=3D=C2=A0=C2=A0=C2=A0=C2=A0at 0x483877F: malloc (vg_replac= e_malloc.c:299) > > =3D=3D1896=3D=3D=C2=A0=C2=A0=C2=A0=C2=A0by 0x136A13: zcontext_save_part= ial (in /usr/bin/zsh) > > =3D=3D1896=3D=3D=C2=A0=C2=A0=C2=A0=C2=A0by 0x165622: parse_subscript (i= n /usr/bin/zsh) > > =3D=3D1896=3D=3D=C2=A0=C2=A0=C2=A0=C2=A0by 0x17A446: getindex (in /usr/= bin/zsh) > > =3D=3D1896=3D=3D=C2=A0=C2=A0=C2=A0=C2=A0by 0x17ABCF: fetchvalue (in /us= r/bin/zsh) > > =3D=3D1896=3D=3D=C2=A0=C2=A0=C2=A0=C2=A0by 0x19BDB0: ??? (in /usr/bin/z= sh) > > =3D=3D1896=3D=3D=C2=A0=C2=A0=C2=A0=C2=A0by 0x1A0C87: prefork (in /usr/b= in/zsh) > > =3D=3D1896=3D=3D=C2=A0=C2=A0=C2=A0=C2=A0by 0x13ABE6: execsubst (in /usr= /bin/zsh) > > =3D=3D1896=3D=3D=C2=A0=C2=A0=C2=A0=C2=A0by 0x1674CB: execfor (in /usr/b= in/zsh) > > =3D=3D1896=3D=3D=C2=A0=C2=A0=C2=A0=C2=A0by 0x13E44C: ??? (in /usr/bin/z= sh) > > =3D=3D1896=3D=3D=C2=A0=C2=A0=C2=A0=C2=A0by 0x13FB6E: ??? (in /usr/bin/z= sh) > > =3D=3D1896=3D=3D=C2=A0=C2=A0=C2=A0=C2=A0by 0x13FF11: ??? (in /usr/bin/z= sh) > > =3D=3D1896=3D=3D > > =3D=3D1896=3D=3D Invalid read of size 1 > > One kind of interesting thing here is there's some suggestion that the > original allocation was not simply in top level code, but in some kind > of block (at least a for block) --- assuming, of course, this is > relevant.=C2=A0=C2=A0Is there some structure about the point where you're= setting > up the trap?=C2=A0=C2=A0If so, does changing it (making it simpler) have = any > effect on the problem? Okay, after quite some time debugging (I will spare you the details of all what I've tried), I can now reliably reproduce the bug. However, I lack the knowledge of zsh to understand what is causing the bug. To trigger the bug, I just open a fresh new shell (e.g. run `zsh`) and type `ls` and hit TAB to trigger the autocompletion function. However, I can only reproduce the bug if I have the following code in my `~/.zshrc`: # Antigen zsh plugins if [ -f "/usr/share/zsh-antigen/antigen.zsh" ]; then source "/usr/share/zsh-antigen/antigen.zsh" # load some plugins here, but they are not relevant to trigger # the bug fi So, I conditionally `source` another file. Apparently, this is causing *super weird* behavior. Unbelievably, if I open the file `.zshrc` (e.g., vim/gedit) and _save_ the file, I cannot trigger the bug. However, if I open the file, but _do not save_ the file, I always trigger the bug. To complicate it further, I can trigger the bug when I compile from source `zsh-5.7.1`, but I cannot trigger the bug anymore if VERSION in `Config/version.mk` is updated (i.e., the next commit). These findings leave me totally confused. Not sure if it's relevant but I mount my home folder with the `noatime` option. Any ideas? Thanks for your help! Cheers, Dennis