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

Re: zsh eats 100% CPU with completion in /



2009/11/1 Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>:
> 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 <p.w.stephenson@xxxxxxxxxxxx>
> 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



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