Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: TRAPINT doesn't work reliably



On Wednesday, September 25, 2019 4:01 PM, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:

> > On 25 September 2019 at 14:02 Dennis Schwartz dennis.schwartz@xxxxxxxxxxxxxx wrote:
> >
> > I am now more convinced it's a bug in Zsh. Any advice on how to debug this?
> > 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=full 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.


==1896== Invalid read of size 1
==1896==    at 0x483BC62: strlen (vg_replace_strmem.c:460)
==1896==    by 0x19755E: dupstring (in /usr/bin/zsh)
==1896==    by 0x138F3B: ??? (in /usr/bin/zsh)
==1896==    by 0x144663: ??? (in /usr/bin/zsh)
==1896==    by 0x141A72: execlist (in /usr/bin/zsh)
==1896==    by 0x141D83: execode (in /usr/bin/zsh)
==1896==    by 0x142C8B: runshfunc (in /usr/bin/zsh)
==1896==    by 0x1431C8: doshfunc (in /usr/bin/zsh)
==1896==    by 0x1963C2: ??? (in /usr/bin/zsh)
==1896==    by 0x19413B: dotrap (in /usr/bin/zsh)
==1896==    by 0x194247: ??? (in /usr/bin/zsh)
==1896==    by 0x194661: zhandler (in /usr/bin/zsh)
==1896==  Address 0x5fc8488 is 264 bytes inside a block of size 328 free'd
==1896==    at 0x48399AB: free (vg_replace_malloc.c:530)
==1896==    by 0x136C8E: zcontext_restore_partial (in /usr/bin/zsh)
==1896==    by 0x1656C3: parse_subscript (in /usr/bin/zsh)
==1896==    by 0x17A446: getindex (in /usr/bin/zsh)
==1896==    by 0x17ABCF: fetchvalue (in /usr/bin/zsh)
==1896==    by 0x19BDB0: ??? (in /usr/bin/zsh)
==1896==    by 0x1A0C87: prefork (in /usr/bin/zsh)
==1896==    by 0x13ABE6: execsubst (in /usr/bin/zsh)
==1896==    by 0x1674CB: execfor (in /usr/bin/zsh)
==1896==    by 0x13E44C: ??? (in /usr/bin/zsh)
==1896==    by 0x13FB6E: ??? (in /usr/bin/zsh)
==1896==    by 0x13FF11: ??? (in /usr/bin/zsh)
==1896==  Block was alloc'd at
==1896==    at 0x483877F: malloc (vg_replace_malloc.c:299)
==1896==    by 0x136A13: zcontext_save_partial (in /usr/bin/zsh)
==1896==    by 0x165622: parse_subscript (in /usr/bin/zsh)
==1896==    by 0x17A446: getindex (in /usr/bin/zsh)
==1896==    by 0x17ABCF: fetchvalue (in /usr/bin/zsh)
==1896==    by 0x19BDB0: ??? (in /usr/bin/zsh)
==1896==    by 0x1A0C87: prefork (in /usr/bin/zsh)
==1896==    by 0x13ABE6: execsubst (in /usr/bin/zsh)
==1896==    by 0x1674CB: execfor (in /usr/bin/zsh)
==1896==    by 0x13E44C: ??? (in /usr/bin/zsh)
==1896==    by 0x13FB6E: ??? (in /usr/bin/zsh)
==1896==    by 0x13FF11: ??? (in /usr/bin/zsh)
==1896==
==1896== Invalid read of size 1

[... repetition 4 more times ...]

==2144==
==2144== HEAP SUMMARY:
==2144==     in use at exit: 1,583,276 bytes in 35,151 blocks
==2144==   total heap usage: 78,390 allocs, 43,239 frees, 12,292,102 bytes allocated
==2144==
==2144== LEAK SUMMARY:
==2144==    definitely lost: 0 bytes in 0 blocks
==2144==    indirectly lost: 0 bytes in 0 blocks
==2144==      possibly lost: 0 bytes in 0 blocks
==2144==    still reachable: 1,583,276 bytes in 35,151 blocks
==2144==         suppressed: 0 bytes in 0 blocks
==2144== Reachable blocks (those to which a pointer was found) are not shown.
==2144== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==2144==
==2144== For counts of detected and suppressed errors, rerun with: -v
==2144== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 0 from 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



Messages sorted by: Reverse Date, Date, Thread, Author