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

Re: zsh deep freeze (probably autocompletion-related)



2009/12/7 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>:
> On Dec 7,  5:03pm, Einar Lielmanis wrote:
> }
> } Steps to reproduce:
> }
> } "rm ./\" [enter] [tab]
> }
> } zsh freezes hard and cannot be terminated; kill -9 ir required.
>
> I get a crash rather than a freeze.
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x080bfe09 in chuck (str=0xb7d37000 "$\003\001 \020")
>    at ../../zsh-4.0/Src/utils.c:1795
> 1795        while ((str[0] = str[1]))
> (gdb) where
> #0  0x080bfe09 in chuck (str=0xb7d37000 "$\003\001 \020")
>    at ../../zsh-4.0/Src/utils.c:1795
> #1  0x08131568 in get_comp_string ()
>    at ../../../zsh-4.0/Src/Zle/zle_tricky.c:1259
> #2  0x0812ff58 in docomplete (lst=0)
>    at ../../../zsh-4.0/Src/Zle/zle_tricky.c:659
> #3  0x0812f395 in completeword (args=0x816d01c)
>    at ../../../zsh-4.0/Src/Zle/zle_tricky.c:232
> #4  0x0812f2b9 in completecall (args=0x816d01c)
>    at ../../../zsh-4.0/Src/Zle/zle_tricky.c:208
> #5  0x08121bbc in execzlefunc (func=0x815b3f0, args=0x816d01c, set_bindk=0)
>    at ../../../zsh-4.0/Src/Zle/zle_main.c:1312
> #6  0x08121263 in zlecore () at ../../../zsh-4.0/Src/Zle/zle_main.c:1050
> #7  0x08121817 in zleread (lp=0x816ddc8, rp=0x0, flags=3, context=1)
>    at ../../../zsh-4.0/Src/Zle/zle_main.c:1213
> #8  0x081235a8 in zle_main_entry (cmd=1, ap=0xbfeee6e4 "\221ÃC")
>    at ../../../zsh-4.0/Src/Zle/zle_main.c:1866
> #9  0x0807df9c in zleentry (cmd=1) at ../../zsh-4.0/Src/init.c:1305
> #10 0x0807e7c7 in inputline () at ../../zsh-4.0/Src/input.c:278
>
> (gdb) up
> #1  0x08131568 in get_comp_string ()
>    at ../../../zsh-4.0/Src/Zle/zle_tricky.c:1259
> 1259                    chuck(tt + zlemetacs - wb - qsub);
> (gdb) p tt
> $3 = 0xb7d33898 "./x"
> (gdb) p zlemetacs
> $4 = 7
> (gdb) p wb
> $5 = 3
> (gdb) p qsub
> $6 = 0
>
> Looks like zlemetacs is too large.

I get a loop, so i pressed ctrl-c

Program received signal SIGINT, Interrupt.
mb_metacharinit () at utils.c:449
(gdb) bt
#0  mb_metacharinit () at utils.c:449
#1  0x080cee63 in itype_end (ptr=0x819bde2 "", itype=128, once=1) at
utils.c:3312
#2  0x6f92bf00 in get_comp_string () at zle_tricky.c:1450
#3  0x6f929784 in docomplete (lst=4) at zle_tricky.c:659
#4  0x6f928c27 in expandorcomplete (args=0x6f93ed60) at zle_tricky.c:315
#5  0x6f9287ca in completecall (args=0x6f93ed60) at zle_tricky.c:208
#6  0x6f9181a8 in execzlefunc (func=0x6f93cd40, args=0x6f93ed60, set_bindk=0)
    at zle_main.c:1312
#7  0x6f917613 in zlecore () at zle_main.c:1050
#8  0x6f917d45 in zleread (lp=0x80efb58, rp=0x0, flags=3, context=1)
at zle_main.c:1213
#9  0x6f919e93 in zle_main_entry (cmd=1, ap=0x77ffe3f4 "\016") at
zle_main.c:1866
#10 0x08086fc6 in zleentry (cmd=1) at init.c:1304
#11 0x08087889 in inputline () at input.c:278
#12 0x080876f8 in ingetc () at input.c:214
#13 0x0807d881 in ihgetc () at hist.c:263
#14 0x08090743 in gettokstr (c=10, sub=0) at lex.c:1245
#15 0x0808fefa in gettok () at lex.c:929
#16 0x0808edf4 in zshlex () at lex.c:364
#17 0x080ad75a in par_simple (complex=0x77ffe720, nr=0) at parse.c:1661
#18 0x080ab887 in par_cmd (complex=0x77ffe720) at parse.c:879
#19 0x080ab354 in par_pline (complex=0x77ffe720) at parse.c:728
#20 0x080ab304 in par_sublist2 (complex=0x77ffe720) at parse.c:709
#21 0x080ab16e in par_sublist (complex=0x77ffe758) at parse.c:664
#22 0x080aabc7 in par_event () at parse.c:477
#23 0x080aab3e in parse_event () at parse.c:454
#24 0x080844f5 in loop (toplevel=1, justonce=0) at init.c:132
#25 0x0808733f in zsh_main (argc=2, argv=0x77ffe8b4) at init.c:1454
#26 0x080553d6 in main (argc=Cannot access memory at address 0x0


(gdb) bt full 3
#0  mb_metacharinit () at utils.c:449
No locals.
#1  0x080cee63 in itype_end (ptr=0x819bde2 "", itype=128, once=1) at
utils.c:3312
No locals.
#2  0x6f92bf00 in get_comp_string () at zle_tricky.c:1450
        nclen = 0
        nnb = 0x819bde2 ""
        nb = 0x0
        ne = 0x0
        t0 = 34
        tt0 = 34
        i = 0
        j = 0
        k = 0
        cp = 0
        rd = 0
        sl = 3
        ocs = 2013257460
        ins = 0
        oins = 0
        ia = 0
        parct = 0
        varq = 0
        ona = 0
        qsub = 0
        zlemetacs_qsub = 9
        redirpos = 0
        s = 0x819bde0 "./"
        tmp = 0x817c648 "echo ./\\\n"
        p = 0x0
        tt = 0x819bde2 ""
---Type <return> to continue, or q <return> to quit---
        rdop = "\000\066\220o\350\336\377w<\032\000p\005\000\000\000\200\065\020\b"
        linptr = 0x6ffd6860 "echo ./\\\nx"
        u = 0x817c651 ""


and stepping forward a bit, all the counters used for += things are 0,
since tt is just an empty string.

3313		while (*ptr) {
(gdb)
3378	    return (char *)ptr;
(gdb)
3379	}
(gdb)
get_comp_string () at zle_tricky.c:1451
1451			    nnb = tt + nclen;
(gdb)
1452			tt += nclen;
(gdb) print nclen
$2 = 0

-- 
Mikael Magnusson



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