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

Re: segfault on menu-select



On Fri, 13 Aug 2010 08:57:08 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Aug 13, 10:08am, Philipp Hartwig wrote:
> }
> } Note that in order to reproduce the issue it really seems to be 
> } necessary to have the 4 lines
> } 
> } autoload -Uz compinit
> } compinit
> } zmodload -i zsh/complist
> } bindkey '^o' menu-select
> } 
> } in your .zshrc. Just typing them or sourcing a file containing them will 
> } not lead to the crash in my case, even without the "-f" option.
> 
> Hmm, indeed.  I'm finally able to reproduce this.  It's also necessary to
> have invoked completion once before trying menu-select, just hitting ^o
> won't do it (in fact, won't do *anything*, which is slightly suspicious).

Check.

I won't tell you what valgrind said, it was really quite rude.  That and
the core dumps I got seemed to point the finger at amatches.

It's not this simple, is it?  It's a little difficult to see how this
could be wrong, but this is the completion system we're talking about.

Index: Src/Zle/compresult.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compresult.c,v
retrieving revision 1.78
diff -p -u -r1.78 compresult.c
--- Src/Zle/compresult.c	24 Apr 2009 09:00:38 -0000	1.78
+++ Src/Zle/compresult.c	13 Aug 2010 20:38:07 -0000
@@ -2284,6 +2284,8 @@ invalidate_list(void)
     zsfree(minfo.postbr);
     minfo.postbr = minfo.prebr = NULL;
     compwidget = NULL;
+    nmatches = 0;
+    amatches = NULL;
 
     return 0;
 }

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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