From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24431 invoked by alias); 1 Nov 2009 01:50:32 -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: 27327 Received: (qmail 6981 invoked from network); 1 Nov 2009 01:50:20 -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.218.210 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=XMUWTqli1pu167yzKE07wGmqDN/8ppi7JnVban1lr7A=; b=kRrOeCCofOgrNVD51+ap7H3OdZHI6VFhSm1rAcfYqCIzMJwCrnvbMtKKN1jVFqLEMb MhOuBZCDZV6LKSTACabYAufpelUi6SM8NUXlO5HJj2/FpLu8UJzwV+ODx/WqPLX6iZvp 6NLujBVeEGt03wpDgLRM1TDz0oJQDNRmbBplM= 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=kJ+ZpP05X91HXlYGGvadpcjwj7a3LUyrOgXAWMizS0RX92E7hHaTYRpfwZHFvqSjJE eink/NQ8XEiIPiadk5SnXlJoZ+MZLuA1X3phhubmp3hXQhp2YNZAp8KLtou0SKDIMCqy 9zwZlKS/piER7WJBjsxg+zkwbt+2aNL7upCxs= MIME-Version: 1.0 In-Reply-To: <200910312300.n9VN0787007148@pws-pc.ntlworld.com> References: <237967ef0910311543y648f6511q3bc5ad097175a80b@mail.gmail.com> <200910312300.n9VN0787007148@pws-pc.ntlworld.com> Date: Sun, 1 Nov 2009 02:50:14 +0100 Message-ID: <237967ef0910311850p2994c4e2ha72944842bc6fa8@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/1 Peter Stephenson : > Mikael Magnusson wrote: >> zlemetacs_qsub = 2 >> s = 0x82d7248 "" >> tt = 0x82d7248 "" > > It looks like it's already gone wrong by that point; s is an empty > string while it thinks the cursor is 2 characters in (which appears to > be correct from the original completion; zlemetaline should show "./x", > which I think it must since that's what's in tmp at this point). > > So somehow the command line string has been emptied incorrectly. I can > fix the symptom at this point but it doesn't look like the real bug. It > would be good to find out where s is being set in get_comp_string(). In > this simple case it should have come from line 1356 (the token type > should be STRING), in which case maybe the clwords array contains > something funny or clwpos is incorrect (it should be 0 from line 1306 or > 1262, I'm not quite sure what the difference is). > > -- > Peter Stephenson > Web page now at http://homepage.ntlworld.com/p.w.stephenson/ > (gdb) break get_comp_string Breakpoint 1 at 0x6fad5420: file zle_tricky.c, line 1067. (gdb) c Continuing. Breakpoint 1, get_comp_string () at zle_tricky.c:1067 1067 int t0, tt0, i, j, k, cp, rd, sl, ocs, ins, oins, ia, parct, varq = 0; (gdb) break 1346 Breakpoint 2 at 0x6fad64b5: file zle_tricky.c, line 1346. (gdb) c Continuing. Breakpoint 2, get_comp_string () at zle_tricky.c:1346 1346 if (inwhat == IN_MATH) (gdb) print inwhat $1 = 0 (gdb) print t0 $3 = 34 (gdb) print ENDINPUT+0 $5 = 37 (gdb) print STRING+0 $7 = 34 (gdb) print clwpos $8 = 0 (gdb) print clwords $9 = (char **) 0x8144278 (gdb) print clwords[0] $10 = 0x82fb758 "" (gdb) s 1348 else if (!t0 || t0 == ENDINPUT) { (gdb) 1354 } else if (t0 == STRING) { (gdb) 1356 s = ztrdup(clwords[clwpos]); (gdb) 1403 if (we > zlemetall) (gdb) print s $11 = 0x82fb7a0 "" for fun i tried '(gdb) set zlemetacs_qsub=0' at the appropriate time and broke out of the loop, got this (eval):3: no such file or directory: it is probably not helpful but you never know. -- Mikael Magnusson