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 30068b47 for ; Wed, 25 Sep 2019 16:27:24 +0000 (UTC) Received: (qmail 8621 invoked by alias); 25 Sep 2019 16:26:28 -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: 24286 Received: (qmail 4171 invoked by uid 1010); 25 Sep 2019 16:26:28 -0000 X-Qmail-Scanner-Diagnostics: from mail-40135.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.135):SA:0(-2.7/5.0):. Processed in 3.773266 secs); 25 Sep 2019 16:26:28 -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.135 as permitted sender) Date: Wed, 25 Sep 2019 16:25:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1569428746; bh=HxedB9u1DjLus17pKh4+3WAdT5dEVRVNsEPC01pD/m8=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References: Feedback-ID:From; b=MQKIUfZUWME2kAhHR9PEBGeqAYkKDLLJG4DOCaWJGS97oz1jwOoRRmge0gl6If33r AdPwMtFlXN8SGV/U2GtZSEeiUdU7NIDLjfjEB3KixkVe3ORhuwOpA47AmCW+1bf+o8 bZ7Urmw7zw0KIVVFIIUIjCodnp5chqu/0lKWaMLM= To: Peter Stephenson From: Dennis Schwartz Cc: "zsh-users@zsh.org" Reply-To: Dennis Schwartz Subject: Re: TRAPINT doesn't work reliably Message-ID: <22AgAhXQWzavJGhNA8tFbGSMGk8z3KDGGa-pICX0lWszH622z2_nnc1acuvW3OcIbqAaXM_WAGJwmQU5Oph83DGbfQEplu1t3o7F5omeC4w=@protonmail.com> In-Reply-To: <1394985674.3969083.1569420087673@mail2.virginmedia.com> References: <1569314663.5531.4.camel@samsung.com> <1394985674.3969083.1569420087673@mail2.virginmedia.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 4:01 PM, Peter Stephenson wrote: > > On 25 September 2019 at 14:02 Dennis Schwartz dennis.schwartz@protonmai= l.com wrote: > > > > I am now more convinced it's a bug in Zsh. Any advice on how to debug t= his? > > And where can I best submit a bug report to? > > You don't need to submit a further separate bug report. Okay, thanks. > Memory errors are tricky, and often hard to reproduce since allocation > is heavily OS specific, but probably your best bet is to run with > > valgrind --leak-check=3Dfull zsh > > which should produce sensible results --- the shell shouldn't leak > memory and anything that looks anomalous is probably a real bug ("still > reachable" memory is OK). I run valgrind on zsh and captured the error. Unfortunately, I am inexperienced with C programming so I do not know how to interpret the output. I've copied the part of the output that I believed is relevant below. Please let me know if I could help in debugging it further. =3D=3D1896=3D=3D Invalid read of size 1 =3D=3D1896=3D=3D at 0x483BC62: strlen (vg_replace_strmem.c:460) =3D=3D1896=3D=3D by 0x19755E: dupstring (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x138F3B: ??? (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x144663: ??? (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x141A72: execlist (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x141D83: execode (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x142C8B: runshfunc (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x1431C8: doshfunc (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x1963C2: ??? (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x19413B: dotrap (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x194247: ??? (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x194661: zhandler (in /usr/bin/zsh) =3D=3D1896=3D=3D Address 0x5fc8488 is 264 bytes inside a block of size 328= free'd =3D=3D1896=3D=3D at 0x48399AB: free (vg_replace_malloc.c:530) =3D=3D1896=3D=3D by 0x136C8E: zcontext_restore_partial (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x1656C3: parse_subscript (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x17A446: getindex (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x17ABCF: fetchvalue (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x19BDB0: ??? (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x1A0C87: prefork (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x13ABE6: execsubst (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x1674CB: execfor (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x13E44C: ??? (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x13FB6E: ??? (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x13FF11: ??? (in /usr/bin/zsh) =3D=3D1896=3D=3D Block was alloc'd at =3D=3D1896=3D=3D at 0x483877F: malloc (vg_replace_malloc.c:299) =3D=3D1896=3D=3D by 0x136A13: zcontext_save_partial (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x165622: parse_subscript (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x17A446: getindex (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x17ABCF: fetchvalue (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x19BDB0: ??? (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x1A0C87: prefork (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x13ABE6: execsubst (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x1674CB: execfor (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x13E44C: ??? (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x13FB6E: ??? (in /usr/bin/zsh) =3D=3D1896=3D=3D by 0x13FF11: ??? (in /usr/bin/zsh) =3D=3D1896=3D=3D =3D=3D1896=3D=3D Invalid read of size 1 [... repetition 4 more times ...] =3D=3D2144=3D=3D =3D=3D2144=3D=3D HEAP SUMMARY: =3D=3D2144=3D=3D in use at exit: 1,583,276 bytes in 35,151 blocks =3D=3D2144=3D=3D total heap usage: 78,390 allocs, 43,239 frees, 12,292,10= 2 bytes allocated =3D=3D2144=3D=3D =3D=3D2144=3D=3D LEAK SUMMARY: =3D=3D2144=3D=3D definitely lost: 0 bytes in 0 blocks =3D=3D2144=3D=3D indirectly lost: 0 bytes in 0 blocks =3D=3D2144=3D=3D possibly lost: 0 bytes in 0 blocks =3D=3D2144=3D=3D still reachable: 1,583,276 bytes in 35,151 blocks =3D=3D2144=3D=3D suppressed: 0 bytes in 0 blocks =3D=3D2144=3D=3D Reachable blocks (those to which a pointer was found) are = not shown. =3D=3D2144=3D=3D To see them, rerun with: --leak-check=3Dfull --show-leak-k= inds=3Dall =3D=3D2144=3D=3D =3D=3D2144=3D=3D For counts of detected and suppressed errors, rerun with: = -v =3D=3D2144=3D=3D ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 0 fro= m 0) > I'd also suggest trying the latest firmware from git or sourceforge, > since there have been some memory fixes (and a release is probably > overdue). I haven't tried compiling from the latest source code yet. If this is desired I could try this again at a later point in time. - Dennis