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

Re: Cores almost on demand in patcompile()



Problems with mail from gmail reaching the mailing list, persist.


On Wed, Oct 19, 2016 at 10:55 PM, Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> Valgrind outputs two "Invalid read of size 8" messages. Don't know why
> there are no line pointers to source, however the reads are in
> patcompile(). I'm afraid that are PATNEXT invocations, final
> segmentation-fault places.


---------- Forwarded message ----------
From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
Date: Wed, Oct 19, 2016 at 10:31 PM
Subject: valgrind of patcompile() errors
To: zsh-workers@xxxxxxx


I do not get these errors on a second machine architecture I tried.  The
difference seems to be that the error happens on the 64bit architecture
but not on 32bit.

This one line may be telling:

==26676==    by 0x49F539: patcompile (pattern.c:672)

That is inside a block where a metafied string is converted back to an
unmetafied one to do a literal match.


==26676== Memcheck, a memory error detector
==26676== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==26676== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==26676== Command: Src/zsh -f test2.zsh
==26676==
==26676== Invalid read of size 8
==26676==    at 0x49F420: patcompile (pattern.c:651)
==26676==    by 0x453ED0: compgetmatch (glob.c:2612)
==26676==    by 0x453F84: getmatch (glob.c:2652)
==26676==    by 0x4B6834: paramsubst (subst.c:3033)
==26676==    by 0x4B0E7A: stringsubst (subst.c:247)
==26676==    by 0x4B01FD: prefork (subst.c:85)
==26676==    by 0x440AEF: addvars (exec.c:2388)
==26676==    by 0x43C5AF: execsimple (exec.c:1158)
==26676==    by 0x43CBD7: execlist (exec.c:1296)
==26676==    by 0x43C464: execode (exec.c:1115)
==26676==    by 0x462167: loop (init.c:208)
==26676==    by 0x466688: zsh_main (init.c:1692)
==26676==  Address 0x61d7c18 is 248 bytes inside a block of size 256 free'd
==26676==    at 0x4C2B7B2: realloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==26676==    by 0x47DB4F: zrealloc (mem.c:1008)
==26676==    by 0x49EB04: patadd (pattern.c:414)
==26676==    by 0x49F539: patcompile (pattern.c:672)
==26676==    by 0x453ED0: compgetmatch (glob.c:2612)
==26676==    by 0x453F84: getmatch (glob.c:2652)
==26676==    by 0x4B6834: paramsubst (subst.c:3033)
==26676==    by 0x4B0E7A: stringsubst (subst.c:247)
==26676==    by 0x4B01FD: prefork (subst.c:85)
==26676==    by 0x440AEF: addvars (exec.c:2388)
==26676==    by 0x43C5AF: execsimple (exec.c:1158)
==26676==    by 0x43CBD7: execlist (exec.c:1296)
==26676==
==26676== Invalid read of size 8
==26676==    at 0x49F48A: patcompile (pattern.c:652)
==26676==    by 0x453ED0: compgetmatch (glob.c:2612)
==26676==    by 0x453F84: getmatch (glob.c:2652)
==26676==    by 0x4B6834: paramsubst (subst.c:3033)
==26676==    by 0x4B0E7A: stringsubst (subst.c:247)
==26676==    by 0x4B01FD: prefork (subst.c:85)
==26676==    by 0x440AEF: addvars (exec.c:2388)
==26676==    by 0x43C5AF: execsimple (exec.c:1158)
==26676==    by 0x43CBD7: execlist (exec.c:1296)
==26676==    by 0x43C464: execode (exec.c:1115)
==26676==    by 0x462167: loop (init.c:208)
==26676==    by 0x466688: zsh_main (init.c:1692)
==26676==  Address 0x61d7c18 is 248 bytes inside a block of size 256 free'd
==26676==    at 0x4C2B7B2: realloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==26676==    by 0x47DB4F: zrealloc (mem.c:1008)
==26676==    by 0x49EB04: patadd (pattern.c:414)
==26676==    by 0x49F539: patcompile (pattern.c:672)
==26676==    by 0x453ED0: compgetmatch (glob.c:2612)
==26676==    by 0x453F84: getmatch (glob.c:2652)
==26676==    by 0x4B6834: paramsubst (subst.c:3033)
==26676==    by 0x4B0E7A: stringsubst (subst.c:247)
==26676==    by 0x4B01FD: prefork (subst.c:85)
==26676==    by 0x440AEF: addvars (exec.c:2388)
==26676==    by 0x43C5AF: execsimple (exec.c:1158)
==26676==    by 0x43CBD7: execlist (exec.c:1296)
==26676==



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