From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26493 invoked by alias); 6 Jan 2011 20:17:15 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28588 Received: (qmail 26844 invoked from network); 6 Jan 2011 20:17:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at ntlworld.com designates 81.103.221.56 as permitted sender) Date: Thu, 6 Jan 2011 19:54:27 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Certain pattern causing shell to crash Message-ID: <20110106195427.03ab19a9@pws-pc.ntlworld.com> In-Reply-To: <20110106185134.GA10630@alpha.rzhou.org> References: <20110106160802.GA4655@Xye> <20110106182201.27da4de9@pwslap01u.europe.root.pri> <20110106185134.GA10630@alpha.rzhou.org> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.0; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=JvdXmxIgLJv2/GthKqHpGJEEHukvLcvELVXUanXFreg= c=1 sm=0 a=p-0xN7MJ6KkA:10 a=kj9zAlcOel0A:10 a=21c8c_67AAAA:8 a=NLZqzBF-AAAA:8 a=wBLdMjNSeqtZkfIf_CoA:9 a=c8F-KwAkqSbCbf7RCsQA:7 a=_yk1Rv1vxX98hxQsok8Gm-6OWbsA:4 a=CjuIK1q_8ugA:10 a=t_b4wO5MBi4A:10 a=_dQi-Dcv4p4A:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 On Thu, 6 Jan 2011 13:51:35 -0500 Ricky Zhou wrote: > For what it's worth, I did a git bisect, and the segfault was introduced > in d234059b1c6493e5eefb6c28aa2b8a021d894d51. Hopefully this can be of > use to somebody more familiar with how this code works. (Ah, so I need to use git diff d234059b1c6493e5eefb6c28aa2b8a021d894d51^\! to look at it. Obvious.) Yes, that narrows it down a lot, thanks. Index: Src/text.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/text.c,v retrieving revision 1.26 diff -p -u -r1.26 text.c --- Src/text.c 14 Sep 2010 14:46:26 -0000 1.26 +++ Src/text.c 6 Jan 2011 19:43:49 -0000 @@ -785,8 +785,7 @@ gettext2(Estate state) taddstr(" "); taddstr(ecgetstr(state, EC_NODUP, NULL)); if (ctype == COND_STREQ || - ctype == COND_STRNEQ || - ctype == COND_REGEX) + ctype == COND_STRNEQ) state->pc++; } else { /* Unary test: `-f foo' etc. */ Index: Test/C02cond.ztst =================================================================== RCS file: /cvsroot/zsh/zsh/Test/C02cond.ztst,v retrieving revision 1.27 diff -p -u -r1.27 C02cond.ztst --- Test/C02cond.ztst 10 Oct 2010 00:05:25 -0000 1.27 +++ Test/C02cond.ztst 6 Jan 2011 19:43:49 -0000 @@ -306,6 +306,21 @@ F:Failures in these cases do not indicat 2:Error message for unknown infix condition ?(eval):1: unknown condition: -fail + crashme() { + if [[ $1 =~ ^http:* ]] + then + url=${1#*=} + fi + } + which crashme +0:Regression test for examining code with regular expression match +>crashme () { +> if [[ $1 =~ ^http:* ]] +> then +> url=${1#*=} +> fi +>} + %clean # This works around a bug in rm -f in some versions of Cygwin chmod 644 unmodish -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/