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

Re: 4.3.9: frequent crashes in completion menu selection



On Sun, 18 Jan 2009 15:47:31 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> 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

Might be this simple:  mtab_been_reallocated doesn't work the
first time through the loop, because we've just reset some key parameters
before the loop, and Andrey's results clearly show this is happening when
you start a new completion.  That variable was added to fix a bug with
redisplaying within menu completion.

Index: Src/Zle/complist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v
retrieving revision 1.118
diff -u -r1.118 complist.c
--- Src/Zle/complist.c	6 Aug 2008 02:21:03 -0000	1.118
+++ Src/Zle/complist.c	20 Jan 2009 10:36:46 -0000
@@ -2421,6 +2421,7 @@
     mlines = 999999;
     mlbeg = 0;
     molbeg = -42;
+    mtab_been_reallocated = 0;
     for (;;) {
 	METACHECK();
 
-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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