Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh eats 100% CPU with completion in /



Mikael Magnusson wrote:
> 2009/10/30 Mikael Magnusson <mikachu@xxxxxxxxx>:
> > 2009/10/30 Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>:
> >> The subject is not entirely correct.
> >>
> >> Zsh eats 100% CPU on a colleague's laptop if you do this:
> >> % cd /
> >> % cd ..
> >> % ./<tab>

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 <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



Messages sorted by: Reverse Date, Date, Thread, Author