zsh-workers
 help / color / mirror / code / Atom feed
From: Kamil Dudka <kdudka@redhat.com>
To: zsh-workers@zsh.org
Subject: syntax check of 'echo $HOME' crashes in ksh emulation mode
Date: Mon, 05 Oct 2015 18:09:22 +0200	[thread overview]
Message-ID: <1693579.IilOBOKrgc@kdudka.brq.redhat.com> (raw)

The following command causes a SIGSEGV in zsh (built from upstream git HEAD):

$ ARGV0=ksh zsh -nc 'echo $HOME'
zsh: segmentation fault (core dumped)  ARGV0=ksh Src/zsh -nc 'echo $HOME'

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00000000004a3ded in sepsplit (s=0x0, sep=0x0, allownull=0, heap=1) at utils.c:3495
3495        if (s[0] == Nularg && !s[1])

(gdb) bt
#0  0x00000000004a3ded in sepsplit (s=0x0, sep=0x0, allownull=0, heap=1) at utils.c:3495
#1  0x0000000000497927 in paramsubst (l=0x7f63e07981a8, n=0x7f63e07981d8, str=0x7ffc3c5300f0, qt=0, pf_flags=16) at subst.c:3375
#2  0x0000000000490d4b in stringsubst (list=0x7f63e07981a8, node=0x7f63e07981d8, pf_flags=16, asssub=0) at subst.c:236
#3  0x0000000000490361 in prefork (list=0x7f63e07981a8, flags=0) at subst.c:77
#4  0x000000000042ed4e in execcmd (state=0x7ffc3c530bd0, input=0, output=0, how=18, last1=1) at exec.c:2724
#5  0x000000000042c391 in execpline2 (state=0x7ffc3c530bd0, pcode=131, how=18, input=0, output=0, last1=1) at exec.c:1748
#6  0x000000000042b2d0 in execpline (state=0x7ffc3c530bd0, slcode=4098, how=18, last1=1) at exec.c:1526
#7  0x000000000042a704 in execlist (state=0x7ffc3c530bd0, dont_change_job=0, exiting=1) at exec.c:1284
#8  0x0000000000429f4d in execode (p=0x7f63e0798130, dont_change_job=0, exiting=1, context=0x4b10e1 "cmdarg") at exec.c:1075
#9  0x0000000000429e24 in execstring (s=0x7ffc3c532223 "echo $HOME", dont_change_job=0, exiting=1, context=0x4b10e1 "cmdarg") at exec.c:1041
#10 0x000000000044dc73 in init_misc () at init.c:1281
#11 0x000000000044edf3 in zsh_main (argc=3, argv=0x7ffc3c530da8) at init.c:1664
#12 0x000000000040f296 in main (argc=3, argv=0x7ffc3c530da8) at ./main.c:93


             reply	other threads:[~2015-10-05 16:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 16:09 Kamil Dudka [this message]
2015-10-05 16:42 ` Peter Stephenson
2015-10-05 17:45   ` Bart Schaefer
2015-10-06  8:33     ` Peter Stephenson
2015-10-06  9:15       ` Peter Stephenson
2015-10-06 15:34         ` Bart Schaefer
2015-10-06 19:46           ` Peter Stephenson
2015-10-07  8:26             ` Peter Stephenson
2015-10-08 12:13   ` Kamil Dudka
2015-10-05 20:45 ` Axel Beckert

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=1693579.IilOBOKrgc@kdudka.brq.redhat.com \
    --to=kdudka@redhat.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).