Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh eats 100% CPU with completion in /
- X-seq: zsh-workers 27338
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: zsh eats 100% CPU with completion in /
- Date: Mon, 2 Nov 2009 22:30:08 +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=aqLn+gcG6TyzIwPVuVyHtUcltfyGNbp6QxMBupGAKOw=; b=l2kPPs8NzwgTw1hfXgfc/LO0CB5RGfKVSXDV8krzj1MLwIJ9FJEceP8EO4up1Aa0oC TGPY4r92lbmBI3VlbsMdOmJsYkYVnzH5jELXuDjkSmsFhRVmPerhHo5fFsb+QFd1pAVI w1uwlqh3ul+T7/kPKCOLrM/gP2Ktgvmjd0iEQ=
- 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=VaFFKEF2yn5+w9QEu7Qt4RdukAQNnBB/HTPwvwvZ0P3h1OMma/0CGuBcrJuDotutjS ygrU6P+j72UeOkUVrTtayzL+OsMZ9glfCstn1xOwZ3NekiYwU6taPLhlW5SuTTHx0P22 V5ysT3ixFBoEw/gath1nhqSZxTnleBl0HbIsc=
- In-reply-to: <237967ef0911021306y33467270l6a1cf921cefbe037@xxxxxxxxxxxxxx>
- 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> <237967ef0911011657n54279c54ja8fce16a1861ff4f@xxxxxxxxxxxxxx> <237967ef0911011726q7550593ax30bc61f1a736e725@xxxxxxxxxxxxxx> <20091102163858.11415153@news01> <237967ef0911021258x5403c976m281fb66ee7488b59@xxxxxxxxxxxxxx> <237967ef0911021306y33467270l6a1cf921cefbe037@xxxxxxxxxxxxxx>
2009/11/2 Mikael Magnusson <mikachu@xxxxxxxxx>:
> 2009/11/2 Mikael Magnusson <mikachu@xxxxxxxxx>:
>
>> Here we are,
>>
>> (gdb) watch lextok2['/']
>> Hardware watchpoint 9: lextok2['/']
>> Continuing.
>> Hardware watchpoint 9: lextok2['/']
>>
>> Old value = 47 '/'
>> New value = 0 '\000'
>> 0x080c962f in xsymlinks (s=0x818e8f1 "..") at utils.c:696
>> 696 *p = '\0';
>>
>> (start over and add breakpoints (i'm not in reversible now just to be safe))
>>
>> 692 if (!strcmp(xbuf, "/"))
>> (gdb) print xbuf
>> $22 = '\000' <repeats 8191 times>
>> (gdb) n
>> 694 p = xbuf + strlen(xbuf);
>> (gdb)
>> 695 while (*--p != '/');
>> (gdb) n
>> at this point i pressed ctrl-c because i was curious what was taking
>> so long. Apparently this loops over all memory until it finds a slash,
>> which takes a while under gdb. Also apparently, the first / it finds
>> is in lextok2.
>
> And this seems to fix it. Not sure if checking that inside the loop is the best
> place, but there seems to be some freeing of *pp going on that I
> didn't feel like
> investigating. Maybe checking xbuf before slashsplit would work?
And of course, I have no idea if *xbuf being '\0' is indicative of
some other bug.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author