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

Core dump in compdescribe (Re: problem with _arguments)

On Jul 26,  9:24pm, Adam Spiers wrote:
} Subject: problem with _arguments
} _foo () {
}   _arguments \
}     '-l[]' \
}     ':description for first param: ' \
}     '*:description for files:_files'
} }
} But with the latest CVS:
} $ foo -<TAB>
} $ foo -
} ---- description for first param
} What am I doing wrong, or is it a bug?

I think it's a bug.  The value of `next' at _arguments line 341 is
"-l:message for option" but nothing is ever done with it after that.
It does the right thing if the ':description for first param: ' is
removed (though you can only see "message for option" if you ask for
an explicit listing with `foo -<C-d>').

Fiddling with this, I caused a core dump in computil:

zagzig<5> compdef _foo foo
zagzig<6> foo -
_describe:compdescribe:36: invalid argument: -Q

Program received signal SIGSEGV, Segmentation fault.
0x80d486b in cd_get (params=0xbfffb208)
    at ../../../zsh-3.1.6/Src/Zle/computil.c:173
173             for (p = set->strs; *p; p++)
(gdb) where 2
#0  0x80d486b in cd_get (params=0xbfffb208)
    at ../../../zsh-3.1.6/Src/Zle/computil.c:173
#1  0x80d4d9c in bin_compdescribe (nam=0x400e83c8 "compdescribe", 
    args=0xbfffb204, ops=0xbfffb27c "", func=0)
    at ../../../zsh-3.1.6/Src/Zle/computil.c:276

I didn't think the entire 168 stack frames would be useful.  I got this
core dump when I accidentally deleted the word "option" at _arguments
line 342:

           next=( "$next[@]" "$odirect[@]" )
-          _describe -o option \
+          _describe -o \
                     next -Q -M "$matcher" -- \
                     direct -QS '' -M "$matcher" -- \
                     equal -QqS= -M "$matcher"

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

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