Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: TRAPINT doesn't work reliably
- X-seq: zsh-users 24293
- From: Dennis Schwartz <dennis.schwartz@xxxxxxxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: TRAPINT doesn't work reliably
- Date: Thu, 26 Sep 2019 17:10:54 +0000
- Cc: "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1569517856; bh=WXUEkpPhxmERv7J93MNitTF9rpJjStosk2X/vhE49Ec=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References: Feedback-ID:From; b=NE0T9Mnp2JzRdE79uVbo2GzjcsWGT522nv7JaFj9CDRoPa60iJjg76Fto8esX6Cjw xvzz6MQw3xTW6FE3PpS/9CKav31I+XLacgNnjDs9K5rOeHQgU065GFImoszNlxTbhW zHiyGEeVcVqxFdrCmMARUKZb+Gxi/LkQHpok51bg=
- Feedback-id: 9o-Cl1kmi7SjXhHVTYCKLMaOWEb5sehZHGWJCh5kD69wcWVVeOfY5BYq3wMUF0ymJu-oBC8u1h80JJ91GEz6Og==:Ext:ProtonMail
- In-reply-to: <1569511539.3770.6.camel@samsung.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CGME20190917164905epcas1p4ad458ffcd504501780d522880c81de3e@epcas1p4.samsung.com> <XwKNAg1qGlWEVe6teZMU0FhD554sBKMAVDblWDoIFxZeOktj1B6qY4Jl7BESBBQFtRKy8SeAa7UzBcB5vShOqFQTgNcZoWShxyjeLaLrCKI=@protonmail.com> <1569314663.5531.4.camel@samsung.com> <Bczpjmkq93UC9ogVXedAec4MSWn1xm79AtK56m7J7_XKU3g1oWkhoUeoj9_CjqM_bdhDM3WFcb0IWT04yMJctdhKDGj_fiAyOLAfaMatz5k=@protonmail.com> <1394985674.3969083.1569420087673@mail2.virginmedia.com> <22AgAhXQWzavJGhNA8tFbGSMGk8z3KDGGa-pICX0lWszH622z2_nnc1acuvW3OcIbqAaXM_WAGJwmQU5Oph83DGbfQEplu1t3o7F5omeC4w=@protonmail.com> <1569434163.10786.26.camel@samsung.com> <EwtKvyologv1mcP4t0gYc4lnyj-ccruEDWJM6kEh3_-H1P6kvlnSEV_LunkUg4AxuDZkdVcoPHq2KnqTqQ4pOAzRd2bXfkj0tjAvgg2-cQQ=@protonmail.com> <1569511539.3770.6.camel@samsung.com>
- Reply-to: Dennis Schwartz <dennis.schwartz@xxxxxxxxxxxxxx>
On Thursday, September 26, 2019 5:25 PM, Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> It suggests it's going to be quite hard to reproduce elsewhere, though
> I'd still be interesting in the logic where you're defining TRAPINT since
> clearly that's the memory that's getting mishandled.
I don't fully understand what you mean with "the logic where you're
defining TRAPINT," but I have the following code in my `.zshrc`:
function TRAPINT {
VIMODE="$VIINS"
print $1 # for debug only
return $(( 128 + $1 ))
}
(I use zsh with vi keybindings and VIMODE indicates on my prompt which
mode I'm in. When I interrupt, start again in insert mode and I want that
to be properly indicated.)
> It's also still suggesting trying to get valgrind to give a bit more
> detail is the best way forward.
Ah, of course. I forgot about valgrind since I could only reproduce this
bug if I checked out the tag `zsh-5.7.1`.
I did manage to capture the bug with valgrind on `master` using the
following sequence of commands (output tidied):
$ git checkout master
$ git checkout zsh-5.7.1 -- Config/version.mk
$ ./configure --enable-zsh-debug && make && sudo make install
$ valgrind --leak-check=full --log-file=zsh-valgrind.log /usr/local/bin/zsh
/usr/share/zsh-antigen/antigen.zsh:2134: parse error near `\n'
$ ll
TRAPINT:1: not an identifier:
Here, `ll [TAB]` was executed in the new shell. I don't get the error
message "/usr/share/zsh-antigen/antigen.zsh:2134: parse error near `\n'"
when I start zsh without valgrind, so I guess that can be ignored.
What valgrind captured:
Invalid read of size 1
at 0x4838CC2: __strlen_sse2 (vg_replace_strmem.c:462)
by 0x1B0792: dupstring (string.c:39)
by 0x19BC70: ecgetstr (parse.c:2809)
by 0x144095: addvars (exec.c:2429)
by 0x1404DB: execsimple (exec.c:1237)
by 0x140A85: execlist (exec.c:1378)
by 0x14038F: execode (exec.c:1194)
by 0x14DCB0: runshfunc (exec.c:5980)
by 0x14D2E8: doshfunc (exec.c:5830)
by 0x1AF4D1: dotrapargs (signals.c:1371)
by 0x1AFA8F: dotrap (signals.c:1487)
by 0x1AF18C: handletrap (signals.c:1202)
Address 0x566b948 is 0 bytes after a block of size 328 free'd
at 0x48369AB: free (vg_replace_malloc.c:530)
by 0x13D8F3: zcontext_restore_partial (context.c:108)
by 0x13DA56: zcontext_restore (context.c:119)
by 0x175A04: parse_subscript (lex.c:1697)
by 0x18B7F1: getindex (params.c:1858)
by 0x18C132: fetchvalue (params.c:2106)
by 0x1B6304: paramsubst (subst.c:2516)
by 0x1B1DB9: stringsubst (subst.c:322)
by 0x1B1108: prefork (subst.c:142)
by 0x14486C: execsubst (exec.c:2570)
by 0x1772E9: execfor (loop.c:98)
by 0x148469: execcmd_exec (exec.c:3913)
Block was alloc'd at
at 0x483577F: malloc (vg_replace_malloc.c:299)
by 0x13D5D6: zcontext_save_partial (context.c:58)
by 0x13D7E9: zcontext_save (context.c:82)
by 0x1758A7: parse_subscript (lex.c:1661)
by 0x18B7F1: getindex (params.c:1858)
by 0x18C132: fetchvalue (params.c:2106)
by 0x1B6304: paramsubst (subst.c:2516)
by 0x1B1DB9: stringsubst (subst.c:322)
by 0x1B1108: prefork (subst.c:142)
by 0x14486C: execsubst (exec.c:2570)
by 0x1772E9: execfor (loop.c:98)
by 0x148469: execcmd_exec (exec.c:3913)
I hope this helps. Thank you for your time and developing zsh!
Cheers,
Dennis
Messages sorted by:
Reverse Date,
Date,
Thread,
Author