From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2417 invoked from network); 23 Apr 2007 15:07:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.8 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Apr 2007 15:07:17 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 23252 invoked from network); 23 Apr 2007 15:07:11 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Apr 2007 15:07:10 -0000 Received: (qmail 24382 invoked by alias); 23 Apr 2007 15:07:07 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23308 Received: (qmail 24360 invoked from network); 23 Apr 2007 15:07:04 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 23 Apr 2007 15:07:04 -0000 Received: (qmail 22840 invoked from network); 23 Apr 2007 15:07:04 -0000 Received: from cluster-c.mailcontrol.com (168.143.177.190) by a.mx.sunsite.dk with SMTP; 23 Apr 2007 15:07:00 -0000 Received: from rly05c.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly05c.srv.mailcontrol.com (MailControl) with ESMTP id l3NF6oEF002310 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 23 Apr 2007 16:06:50 +0100 Received: from submission.mailcontrol.com (submission.mailcontrol.com [86.111.216.190]) by rly05c.srv.mailcontrol.com (MailControl) id l3NF6ViN001532 for zsh-workers@sunsite.dk; Mon, 23 Apr 2007 16:06:31 +0100 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly05c-eth0.srv.mailcontrol.com (envelope-sender Peter.Stephenson@csr.com) (MIMEDefang) with ESMTP id l3NF6OnY001352; Mon, 23 Apr 2007 16:06:31 +0100 (BST) Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Mon, 23 Apr 2007 16:06:23 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.8/8.13.4) with ESMTP id l3NF6NRZ011762; Mon, 23 Apr 2007 16:06:23 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.13.8/8.13.8/Submit) with ESMTP id l3NF6Njx011759; Mon, 23 Apr 2007 16:06:23 +0100 Message-Id: <200704231506.l3NF6Njx011759@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: "Mikael Magnusson" cc: "Zsh hackers list" Subject: Re: zsh 4.3.4 released In-reply-to: <237967ef0704230722u7546461ehd6b3280df79352a0@mail.gmail.com> References: <200704161647.l3GGl2FE027950@news01.csr.com> <20070419120758.e9774528.pws@csr.com> <237967ef0704201440g1c072ca8l451439d2ec8578bf@mail.gmail.com> <20070423104151.1f5f368e.pws@csr.com> <237967ef0704230550k41ddb13fy60deebd526ecc5ec@mail.gmail.com> <200704231318.l3NDIONr006499@news01.csr.com> <237967ef0704230722u7546461ehd6b3280df79352a0@mail.gmail.com> Comments: In-reply-to "Mikael Magnusson" message dated "Mon, 23 Apr 2007 16:22:46 +0200." Date: Mon, 23 Apr 2007 16:06:23 +0100 From: Peter Stephenson X-OriginalArrivalTime: 23 Apr 2007 15:06:23.0795 (UTC) FILETIME=[F5389030:01C785B8] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-07-07-00 (www.mailcontrol.com) on 10.67.1.115 "Mikael Magnusson" wrote: > (gdb) print tindent > $12 = -2 Thanks. This is the problem; tindent should never be less than zero. I'm not sure why I'm not seeing it; it might suggest the structure with the function in it is already corrupt at the point where you run "which". The following patch should stop the crash (so it's probably worth having) and report at the point where it first becomes confused, though it doesn't address the underlying problem. Is it possibly you have old wordcode for the dot file that might define svmode? (Obviously the shell should be robust even if this is the case; since the wordcode has a version stamp this shouldn't happen with a released version of the shell.) Index: Src/text.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/text.c,v retrieving revision 1.18 diff -u -r1.18 text.c --- Src/text.c 19 Jan 2007 21:36:03 -0000 1.18 +++ Src/text.c 23 Apr 2007 14:50:00 -0000 @@ -33,6 +33,14 @@ static char *tptr, *tbuf, *tlim; static int tsiz, tindent, tnewlins, tjob; +static void +dec_tindent(void) +{ + DPUTS(tindent == 0, "attempting to decrement tindent below zero"); + if (tindent > 0) + tindent--; +} + /* add a character to the text buffer */ /**/ @@ -354,7 +362,7 @@ state->pc++; } else { state->pc = s->u._subsh.end; - tindent--; + dec_tindent(); taddnl(); taddstr(")"); stack = 1; @@ -371,7 +379,7 @@ state->pc++; } else { state->pc = s->u._subsh.end; - tindent--; + dec_tindent(); taddnl(); taddstr("}"); stack = 1; @@ -387,7 +395,7 @@ } else stack = 1; } else { - tindent--; + dec_tindent(); stack = 1; } break; @@ -414,7 +422,7 @@ } else { state->strs = s->u._funcdef.strs; state->pc = s->u._funcdef.end; - tindent--; + dec_tindent(); taddnl(); taddstr("}"); stack = 1; @@ -444,7 +452,7 @@ taddnl(); tpush(code, 1); } else { - tindent--; + dec_tindent(); taddnl(); taddstr("done"); stack = 1; @@ -462,7 +470,7 @@ taddnl(); tpush(code, 1); } else { - tindent--; + dec_tindent(); taddnl(); taddstr("done"); stack = 1; @@ -475,14 +483,14 @@ tindent++; tpush(code, 0); } else if (!s->pop) { - tindent--; + dec_tindent(); taddnl(); taddstr("do"); tindent++; taddnl(); s->pop = 1; } else { - tindent--; + dec_tindent(); taddnl(); taddstr("done"); stack = 1; @@ -498,7 +506,7 @@ taddnl(); tpush(code, 1); } else { - tindent--; + dec_tindent(); taddnl(); taddstr("done"); stack = 1; @@ -536,7 +544,7 @@ n->pop = (state->pc - 2 + WC_CASE_SKIP(code) >= end); } } else if (state->pc < s->u._case.end) { - tindent--; + dec_tindent(); switch (WC_CASE_TYPE(code)) { case WC_CASE_OR: taddstr(" ;;"); @@ -564,7 +572,7 @@ s->pop = ((state->pc - 2 + WC_CASE_SKIP(code)) >= s->u._case.end); } else { - tindent--; + dec_tindent(); switch (WC_CASE_TYPE(code)) { case WC_CASE_OR: taddstr(" ;;"); @@ -578,7 +586,7 @@ taddstr(";|"); break; } - tindent--; + dec_tindent(); if (tnewlins) taddnl(); else @@ -601,14 +609,14 @@ } else if (s->pop) { stack = 1; } else if (s->u._if.cond) { - tindent--; + dec_tindent(); taddnl(); taddstr("then"); tindent++; taddnl(); s->u._if.cond = 0; } else if (state->pc < s->u._if.end) { - tindent--; + dec_tindent(); taddnl(); code = *state->pc++; if (WC_IF_TYPE(code) == WC_IF_ELIF) { @@ -622,7 +630,7 @@ } } else { s->pop = 1; - tindent--; + dec_tindent(); taddnl(); taddstr("fi"); stack = 1; @@ -760,14 +768,14 @@ n->u._subsh.end = state->pc + WC_CURSH_SKIP(state->pc[-1]); } else if (!s->pop) { state->pc = s->u._subsh.end; - tindent--; + dec_tindent(); taddnl(); taddstr("} always {"); tindent++; taddnl(); s->pop = 1; } else { - tindent--; + dec_tindent(); taddnl(); taddstr("}"); stack = 1; -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview