zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: Zsh parser malloc corruption
Date: Tue, 9 May 2017 23:21:41 -0700	[thread overview]
Message-ID: <170509232141.ZM7753@torch.brasslantern.com> (raw)
In-Reply-To: <CAOSMAusOHHM-4Y8w24wSwX6i5_YP2Q1nXD2cc6+jibXR=PNhKQ@mail.gmail.com>

PWS, I'm going to ask you to please look at this after all, because it
seems to be related to 

    36682: expand pattern interface to optimise unmetafication

Valgrind says:

==19116== Invalid write of size 1
==19116==    at 0x4A2E0D: patcompile (pattern.c:679)
==19116==    by 0x456846: compgetmatch (glob.c:2623)
==19116==    by 0x4568FA: getmatch (glob.c:2663)
==19116==    by 0x4BA2D9: paramsubst (subst.c:3045)
==19116==    by 0x4B486A: stringsubst (subst.c:247)
==19116==    by 0x4B3BED: prefork (subst.c:85)
==19116==    by 0x4437D5: execcmd_getargs (exec.c:2659)
==19116==    by 0x443BCF: execcmd_exec (exec.c:2765)
==19116==    by 0x4414B5: execpline2 (exec.c:1873)
==19116==    by 0x43FCDA: execpline (exec.c:1602)
==19116==    by 0x43EEA5: execlist (exec.c:1360)
==19116==    by 0x43E5A3: execode (exec.c:1141)

This repeats several times, and eventually kills valgrind itself:

valgrind: the 'impossible' happened:
   Killed by fatal signal
==19116==    at 0x38058236: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)

It appears that the "patalloc" space is not large enough to hold the
metafied pattern, maybe because there are NUL bytes in the pattern
prior to it being metafied?

Also I can reproduce my crash with a shorter input; delete everything
from (including) the first "&" through the end of the malloc-corruption
file.


  parent reply	other threads:[~2017-05-10  6:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170508135522epcas1p2c81789e7cafaa2c46e00eed1472af895@epcas1p2.samsung.com>
2017-05-08 13:53 ` Eduardo Bustamante
2017-05-08 14:11   ` Peter Stephenson
2017-05-08 14:16     ` Eduardo Bustamante
2017-05-08 14:20     ` Eduardo Bustamante
2017-05-08 15:10       ` Peter Stephenson
2017-05-08 19:12         ` Daniel Shahaf
2017-05-10  6:21   ` Bart Schaefer [this message]
2017-05-11 16:15     ` Peter Stephenson
2017-05-11 21:09       ` Bart Schaefer

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=170509232141.ZM7753@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).