From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers@sunsite.dk
Subject: Re: Bug in built-in 'test' under cont $CONTEXT
Date: Wed, 1 Jul 2009 01:31:52 +0200 [thread overview]
Message-ID: <237967ef0906301631s710ba9efyc863419fa28b8291@mail.gmail.com> (raw)
In-Reply-To: <4A4A8C51.3080106@gmail.com>
2009/7/1 Takahiro SUZUKI <takahiro.suzuki.ja@gmail.com>:
> 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
next prev parent reply other threads:[~2009-06-30 23:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 22:06 Takahiro SUZUKI
2009-06-30 23:31 ` Mikael Magnusson [this message]
2009-07-01 8:59 ` Peter Stephenson
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=237967ef0906301631s710ba9efyc863419fa28b8291@mail.gmail.com \
--to=mikachu@gmail.com \
--cc=zsh-workers@sunsite.dk \
/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).