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

Re: 4.3.9: frequent crashes in completion menu selection



On Sun, Jan 18, 2009 at 11:24 AM, Richard Hartmann
<richih.mailinglist@xxxxxxxxx> wrote:
> On Sun, Jan 18, 2009 at 12:47, Andrey Borzenkov <arvidjaar@xxxxxxxxxx> wrote:
>
>> Zsh crashes.
>
> Confirmed for CVS from 13.01.09

It looks like the loop that tries to locate the highlighted match in
the list of completions is running one line too far, but I can't see
why (a) there is no highlighted match and (b) having a format style
causes this to happen.

Program received signal SIGSEGV, Segmentation fault.
0x08109622 in domenuselect (dummy=0x8156c74, dat=0xbfe3d4b0)
    at ../../../zsh-4.0/Src/Zle/complist.c:2433
2433                        if (*p && !mmarked(*p) && **p && mselect
== (**p)->gnum)
(gdb) p p
$1 = (Cmatch **) 0x85d7a90
(gdb) p *p
$2 = (Cmatch *) 0x148
(gdb) where
#0  0x08109622 in domenuselect (dummy=0x8156c74, dat=0xbfe3d4b0)
    at ../../../zsh-4.0/Src/Zle/complist.c:2433
#1  0x0808f80a in runhookdef (h=0x8156c74, d=0xbfe3d4b0)
    at ../../zsh-4.0/Src/module.c:990
#2  0x080f0231 in after_complete (dummy=0x815a3dc, dat=0xbfe3d540)
    at ../../../zsh-4.0/Src/Zle/compcore.c:515
#3  0x0808f86a in runhookdef (h=0x815a3dc, d=0xbfe3d540)
    at ../../zsh-4.0/Src/module.c:996
#4  0x0812e71e in docomplete (lst=0)
    at ../../../zsh-4.0/Src/Zle/zle_tricky.c:869
#5  0x0812d507 in expandorcomplete (args=0x8169abc)
    at ../../../zsh-4.0/Src/Zle/zle_tricky.c:315

Preceding lines are:
2421        mlines = 999999;
2422        mlbeg = 0;
2423        molbeg = -42;
2424        for (;;) {
2425            METACHECK();
2426
2427            if (mline < 0 || mtab_been_reallocated) {
2428                int x, y;
2429                Cmatch **p = mtab;
2430
2431                for (y = 0; y < mlines; y++) {
2432                    for (x = mcols; x > 0; x--, p++)


(gdb) p mlines
$7 = 999999
(gdb) p y
$8 = 1
(gdb) p mtab_been_reallocated
$9 = 1

The only assignment of mtab_been_reallocated = 1 is in complistmatches().



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