From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24394 invoked from network); 30 Jun 2009 23:32:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 30 Jun 2009 23:32:16 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 47986 invoked from network); 30 Jun 2009 23:32:07 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Jun 2009 23:32:07 -0000 Received: (qmail 8225 invoked by alias); 30 Jun 2009 23:31:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27078 Received: (qmail 8196 invoked from network); 30 Jun 2009 23:31:57 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 30 Jun 2009 23:31:57 -0000 Received: from mail-ew0-f218.google.com (mail-ew0-f218.google.com [209.85.219.218]) by bifrost.dotsrc.org (Postfix) with ESMTP id 59B548027106 for ; Wed, 1 Jul 2009 01:31:54 +0200 (CEST) Received: by ewy18 with SMTP id 18so625863ewy.45 for ; Tue, 30 Jun 2009 16:31:54 -0700 (PDT) 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= MIME-Version: 1.0 Received: by 10.210.58.17 with SMTP id g17mr3982184eba.88.1246404713905; Tue, 30 Jun 2009 16:31:53 -0700 (PDT) In-Reply-To: <4A4A8C51.3080106@gmail.com> References: <4A4A8C51.3080106@gmail.com> Date: Wed, 1 Jul 2009 01:31:52 +0200 Message-ID: <237967ef0906301631s710ba9efyc863419fa28b8291@mail.gmail.com> Subject: Re: Bug in built-in 'test' under cont $CONTEXT From: Mikael Magnusson To: zsh-workers@sunsite.dk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.94.2/9527/Tue Jun 30 20:52:00 2009 on bifrost X-Virus-Status: Clean 2009/7/1 Takahiro SUZUKI : > 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