zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: valgrind of patcompile() errors
Date: Wed, 19 Oct 2016 22:31:49 -0700	[thread overview]
Message-ID: <161019223149.ZM2851@torch.brasslantern.com> (raw)

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== 


                 reply	other threads:[~2016-10-20 17:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=161019223149.ZM2851@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).