zsh-workers
 help / color / mirror / code / Atom feed
From: Takahiro SUZUKI <takahiro.suzuki.ja@gmail.com>
To: zsh-workers@sunsite.dk
Subject: Bug in built-in 'test' under cont $CONTEXT
Date: Wed, 01 Jul 2009 07:06:09 +0900	[thread overview]
Message-ID: <4A4A8C51.3080106@gmail.com> (raw)

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)


--
Takahiro Suzuki


             reply	other threads:[~2009-06-30 22:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30 22:06 Takahiro SUZUKI [this message]
2009-06-30 23:31 ` Mikael Magnusson
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=4A4A8C51.3080106@gmail.com \
    --to=takahiro.suzuki.ja@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).