From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10560 invoked by alias); 2 Nov 2009 21:30:17 -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: 27338 Received: (qmail 11230 invoked from network); 2 Nov 2009 21:30:14 -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 _spf.google.com designates 209.85.219.207 as permitted sender) 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= MIME-Version: 1.0 In-Reply-To: <237967ef0911021306y33467270l6a1cf921cefbe037@mail.gmail.com> References: <237967ef0911011312u307ecf19kbabf9fecf867cec1@mail.gmail.com> <200911012220.nA1MKgjM005270@pws-pc.ntlworld.com> <237967ef0911011657n54279c54ja8fce16a1861ff4f@mail.gmail.com> <237967ef0911011726q7550593ax30bc61f1a736e725@mail.gmail.com> <20091102163858.11415153@news01> <237967ef0911021258x5403c976m281fb66ee7488b59@mail.gmail.com> <237967ef0911021306y33467270l6a1cf921cefbe037@mail.gmail.com> Date: Mon, 2 Nov 2009 22:30:08 +0100 Message-ID: <237967ef0911021330r6f733a5v9536bbe2f237ccf9@mail.gmail.com> Subject: Re: zsh eats 100% CPU with completion in / From: Mikael Magnusson To: Peter Stephenson Cc: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 2009/11/2 Mikael Magnusson : > 2009/11/2 Mikael Magnusson : > >> 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' >> (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