From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10128 invoked by alias); 31 Oct 2009 21:03:25 -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: 27324 Received: (qmail 11941 invoked from network); 31 Oct 2009 21:03:13 -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-SPF: pass (ns1.primenet.com.au: SPF record at ntlworld.com designates 81.103.221.31 as permitted sender) Message-Id: <200910312000.n9VK0VXC003485@pws-pc.ntlworld.com> From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: zsh eats 100% CPU with completion in / In-Reply-To: Message from Mikael Magnusson of "Fri, 30 Oct 2009 22:33:54 +0100." <237967ef0910301433v6b58a1cdo2b31306ba4adda8a@mail.gmail.com> Date: Sat, 31 Oct 2009 20:00:31 +0000 X-Cloudmark-Analysis: v=1.0 c=1 a=KKLPYScoP6YA:10 a=pGLkceISAAAA:8 a=02rWKl3eAAAA:8 a=NLZqzBF-AAAA:8 a=C7LVAQSDiHQOfJzvg78A:9 a=q76WYfilHVbHMhEUYX8rhNpN3LEA:4 a=MSl-tDqOz04A:10 a=iVFYgQKhOj0A:10 a=_dQi-Dcv4p4A:10 Mikael Magnusson wrote: > 2009/10/30 Mikael Magnusson : > > 2009/10/30 Frank Terbeck : > >> The subject is not entirely correct. > >> > >> Zsh eats 100% CPU on a colleague's laptop if you do this: > >> % cd / > >> % cd .. > >> % ./ Thanks for the additional details. So it appears something's going on in this loop in get_comp_string() around line 1439 of zle_tricky.c: for (tt = s; tt < s + zlemetacs_qsub - wb;) { if (*tt == Inbrack) { i++; nb = nnb; ne = tt; tt++; } else if (i && *tt == Outbrack) { i--; tt++; } else { int nclen = MB_METACHARLEN(tt); if (itype_end(tt, IIDENT, 1) == tt) nnb = tt + nclen; tt += nclen; } } It would therefore probably help to know what the various quantities are in this loop: tt, s, zlemetacs_qsub and wb in particular, and also what nclen is being returned. (You might need a debugging build to get these out.) It seems plausible nclen is zero, which obviously causes a problem. If eveything's in range (and unless we're going backwards the loop test suggests it should be) this presumably means we encountered a character we didn't like somewhere, so possibly the LC_CTYPE locale is useful (I would guess it's UTF-8). -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/