Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug in built-in 'test' under cont $CONTEXT
- X-seq: zsh-workers 27078
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Bug in built-in 'test' under cont $CONTEXT
- Date: Wed, 1 Jul 2009 01:31:52 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=gamma;        h=domainkey-signature:mime-version:received:in-reply-to:references         :date:message-id:subject:from:to:content-type         :content-transfer-encoding;        bh=paCmNhKiYe6CSmFPppv/HZPml7nJRgbhIHdnEDzbzb8=;        b=UoWP4MCavfOT6g+4LLMFFn9wL9fmpZZndHPlY2Oq5zSa7CFT05F4iT3YvZOnfeWOKF         3Oy7Ym7V7GHJsKD789j6na2vA3Q20ApxuJepapXMonlbecrYfhLHd2jBlujieTUXfem8         4E1MHWbEa6uZSpxEZiQ5aYxSCdf3bO78AKzd8=
- Domainkey-signature: a=rsa-sha1; c=nofws;        d=gmail.com; s=gamma;        h=mime-version:in-reply-to:references:date:message-id:subject:from:to         :content-type:content-transfer-encoding;        b=W4ni4BAnrzZ8phRwk0PEnr8apMjFKLgOCH6N8nPPoQdxM/qksFhNUP9vBl4T9ZtkIZ         RirH3ecwpFHjEctUrcFZ0mV+YTHQyj69N08OBYY/kogmUvLPSqF4uJWelV2JD553vefD         WlslUXLexNKSAud6XTrWntGAIKqVGi2CfMPvA=
- In-reply-to: <4A4A8C51.3080106@xxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <4A4A8C51.3080106@xxxxxxxxx>
2009/7/1 Takahiro SUZUKI <takahiro.suzuki.ja@xxxxxxxxx>:
> Hi all,
>
> I found a bug in builtin test command under $CONTEXT=="cont".
>
> Using builtin test command via zle widget when zsh is pending for "for",
> the shell fails with segmentation fault. This does not occur when using
> /usr/bin/test instead, so I guess it is a problem of zsh.
>
> REPRO:
> % zsh -f
> myhost% source zshrc_segv
>
> myhost% for i in;    [test2 called]
> for> do    [test2 called]
> for> echo    [test2 called]
> for> done    [test2 called]
>
> myhost% for i in;    [test1 called]
> for> do    [test1 called]
> for> echo    [test1 called]
> zsh: segmentation fault  zsh -f
>
>
> % cat zshrc_segv
> function test1 {
>  # calling in $CONTEXT=cont will crash zsh
>  echo -n '    [test1 called]'
>  test -n ""
> }
> function test2 {
>  # but this won't
>  echo -n '    [test2 called]'
>  /usr/bin/test -n ""
> }
> zle -N test1
> zle -N test2
> bindkey '^T' test1
> bindkey '^[t' test2
>
>
> VERSION: (ubuntu server 8.04 x86)
> zsh 4.3.4 (i686-pc-linux-gnu)
Here's just a quick backtrace with no particular analysis:
(gdb) print ecused
$9 = 3
(gdb) print eclen
$10 = 256
(gdb) bt
#0  0x080aa1fb in ecadd (c=0) at parse.c:289
#1  0x080aab96 in par_list (complex=0x7783f6f0) at parse.c:606
#2  0x080ab930 in par_for (complex=0x7783f6f0) at parse.c:996
#3  0x080ab2b1 in par_cmd (complex=0x7783f6f0) at parse.c:798
#4  0x080aaf5c in par_pline (complex=0x7783f6f0) at parse.c:728
#5  0x080aaf0c in par_sublist2 (complex=0x7783f6f0) at parse.c:709
#6  0x080aad76 in par_sublist (complex=0x7783f728) at parse.c:664
#7  0x080aa7cf in par_event () at parse.c:477
#8  0x080aa746 in parse_event () at parse.c:454
#9  0x08084472 in loop (toplevel=1, justonce=0) at init.c:131
#10 0x080871eb in zsh_main (argc=2, argv=0x7783f874) at init.c:1409
#11 0x080553c6 in main (argc=Cannot access memory at address 0xffffffff
) at ./main.c:93
-- 
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author