Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh eats 100% CPU with completion in /
- X-seq: zsh-workers 27332
 
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
 
- To: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
 
- Subject: Re: zsh eats 100% CPU with completion in /
 
- Date: Mon, 2 Nov 2009 01:57:49 +0100
 
- Cc: zsh-workers@xxxxxxx
 
- 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:cc:content-type;        bh=KxsSg/5QvP5paLk+Q0yrIlv5UE8eIPLYn0p4TOwE7co=;        b=KFt93Wf0On900tbcbDblU+8TfkoTrzRV0y7gyDodSk9uGIlxWfaXKY9ZeQPGXS5NQG         0OHTTY+n5KAD1ZGcfUvk6kcGG0T5Xuy15Ad0exhy+0XS+Xbd11tjhkliCUgrR4Gvrpbo         AO8RYZ00tjcBylvn9mms9XrbNY3AGGNL/DvXc=
 
- 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         :cc:content-type;        b=We810a4WNvq1Ja6BykqdTWuTViS0+DKZFfEzJ53lPibZ313F3GOA7J8EyiH4fEDtr7         Lma1ATx4wN8W6NXf/zp1nYeYNmol0vtRTeDve9vKCoHdzgxxbzSznnUDRxCXnOrHc9QD         OVUx9Clo5oye2EiiVUrpi0iWnbc+Rt3Kbw454=
 
- In-reply-to: <200911012220.nA1MKgjM005270@xxxxxxxxxxxxxxxxxxx>
 
- List-help: <mailto:zsh-workers-help@zsh.org>
 
- List-id: Zsh Workers List <zsh-workers.zsh.org>
 
- List-post: <mailto:zsh-workers@zsh.org>
 
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
 
- References: <mikachu@xxxxxxxxx>	 <237967ef0911011312u307ecf19kbabf9fecf867cec1@xxxxxxxxxxxxxx>	 <200911012220.nA1MKgjM005270@xxxxxxxxxxxxxxxxxxx>
 
2009/11/1 Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>:
> Mikael Magnusson wrote:
>> I did the break after typing ./ and before pressing tab.
>
> Nothing leapt out of that.  "tokstr" seems to be coming back as "." and
> then the "." gets removed, as far as I can see, but looking at it out of
> context I might be wrong.
>
> Might be worth checking zlemetacs as well as zlemetaline and zlemetall
> on entry to get_comp_string() in case they're already wrong, otherwise
> it's probably down in the bowels of gettok() where it puts together the
> string it's returning.  I suspect a counting error---one of the myriad
> substractions to correct for all the things that need fixing on the way
> through the position calculations is wrong.
Before I actually have to start thinking and looking at the code, does
this tell you anything? In the working trace, I didn't do the cd ..
(this is from break zshlex)
I tried breaking on gettok but it appears my modules don't have debug
symbols, I might get back in a while if anything interesting shows up there.
--- /tmp/working	2009-11-02 01:43:42.060760548 +0100
+++ /tmp/broken	2009-11-02 01:46:26.331314015 +0100
@@ -357,14 +357,6 @@
 (gdb)
 1248			for (tt1 = tt; *tt1; tt1++) {
 (gdb)
-1249			    if (*tt1 == Snull) {
-(gdb)
-1248			for (tt1 = tt; *tt1; tt1++) {
-(gdb)
-1249			    if (*tt1 == Snull) {
-(gdb)
-1248			for (tt1 = tt; *tt1; tt1++) {
-(gdb)
 1258		    if (addedx && tt)
 (gdb)
 1259			chuck(tt + zlemetacs - wb - qsub);
@@ -496,7 +488,7 @@
 get_comp_string () at zle_tricky.c:1435
 1435		if (itype_end(s, IIDENT, 1) == s)
 (gdb)
-itype_end (ptr=0x8192ca8 "./", itype=128, once=1) at utils.c:3308
+itype_end (ptr=0x82fb8c0 "", itype=128, once=1) at utils.c:3308
 3308	    if (isset(MULTIBYTE) &&
 (gdb)
 3310		mb_metacharinit();
@@ -506,55 +498,9 @@
 (gdb)
 449	}
 (gdb)
-itype_end (ptr=0x8192ca8 "./", itype=128, once=1) at utils.c:3311
+itype_end (ptr=0x82fb8c0 "", itype=128, once=1) at utils.c:3311
 3311		while (*ptr) {
 (gdb)
-3313		    int len = mb_metacharlenconv(ptr, &wc);
-(gdb)
-mb_metacharlenconv (s=0x8192ca8 "./", wcp=0x77991ac8) at utils.c:4254
-4254	    if (!isset(MULTIBYTE)) {
-(gdb)
-4270	    if (itok(*s)) {
-(gdb)
-4276	    return mb_metacharlenconv_r(s, wcp, &mb_shiftstate);
-(gdb)
-mb_metacharlenconv_r (s=0x8192ca8 "./", wcp=0x77991ac8,
mbsp=0x80f0ccc) at utils.c:4205
-4205	    size_t ret = MB_INVALID;
-(gdb)
-4210	    for (ptr = s; *ptr; ) {
-(gdb)
-4211		if (*ptr == Meta) {
-(gdb)
-4216		    inchar = *ptr;
-(gdb)
-4217		ptr++;
-(gdb)
-4218		ret = mbrtowc(&wc, &inchar, 1, mbsp);
-(gdb)
-4220		if (ret == MB_INVALID)
-(gdb)
-4222		if (ret == MB_INCOMPLETE)
-(gdb)
-4224		if (wcp)
-(gdb)
-4225		    *wcp = wc;
-(gdb)
-4226		return ptr - s;
-(gdb)
-4237	}
-(gdb)
-mb_metacharlenconv (s=0x8192ca8 "./", wcp=0x77991ac8) at utils.c:4277
-4277	}
-(gdb)
-itype_end (ptr=0x8192ca8 "./", itype=128, once=1) at utils.c:3315
-3315		    if (!len)
-(gdb)
-3318		    if (wc == WEOF) {
-(gdb)
-3324		    } else if (len == 1 && isascii(*ptr)) {
-(gdb)
-3326			if (!zistype(*ptr,itype))
-(gdb)
 3376	    return (char *)ptr;
 (gdb)
 3377	}
@@ -562,150 +508,30 @@
 get_comp_string () at zle_tricky.c:1436
 1436		    nnb = s + MB_METACHARLEN(s);
 (gdb)
-mb_metacharlenconv (s=0x8192ca8 "./", wcp=0x0) at utils.c:4254
+mb_metacharlenconv (s=0x82fb8c0 "", wcp=0x0) at utils.c:4254
 4254	    if (!isset(MULTIBYTE)) {
 (gdb)
 4270	    if (itok(*s)) {
 (gdb)
 4276	    return mb_metacharlenconv_r(s, wcp, &mb_shiftstate);
 (gdb)
-mb_metacharlenconv_r (s=0x8192ca8 "./", wcp=0x0, mbsp=0x80f0ccc) at
utils.c:4205
+mb_metacharlenconv_r (s=0x82fb8c0 "", wcp=0x0, mbsp=0x80f0ccc) at utils.c:4205
 4205	    size_t ret = MB_INVALID;
 (gdb)
 4210	    for (ptr = s; *ptr; ) {
 (gdb)
-4211		if (*ptr == Meta) {
-(gdb)
-4216		    inchar = *ptr;
+4229	    if (wcp)
 (gdb)
-4217		ptr++;
+4232	    memset(mbsp, 0, sizeof(*mbsp));
 (gdb)
-4218		ret = mbrtowc(&wc, &inchar, 1, mbsp);
+4233	    if (ptr > s) {
 (gdb)
-4220		if (ret == MB_INVALID)
-(gdb)
-4222		if (ret == MB_INCOMPLETE)
-(gdb)
-4224		if (wcp)
-(gdb)
-4226		return ptr - s;
+4236		return 0;		/* Probably shouldn't happen */
 (gdb)
 4237	}
 (gdb)
-mb_metacharlenconv (s=0x8192ca8 "./", wcp=0x0) at utils.c:4277
+mb_metacharlenconv (s=0x82fb8c0 "", wcp=0x0) at utils.c:4277
 4277	}
 (gdb)
 get_comp_string () at zle_tricky.c:1439
 1439		for (tt = s; tt < s + zlemetacs_qsub - wb;) {
-- 
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author