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

Re: Bug#314597: zsh segfaults randomly when tabcompleting file with lots of spaces



I have not yet been able to reproduce this.

> Hi, while dealing with a virus attachment to an email I received, zsh
> segfaulted while tabcompleting the file name.
> 
> The file name is:
> instructions.htm                                                                      .scr
> 
> (i.e. "instructions.htm" + a lot of spaces + ".scr", obviously an
> attempt to trick windows users into running an executable).
> 
> I haven't found a way to reproduce this every time, but the following
> seems to trigger a segfault after a few iterations:
> 
> touch instructions.htm\ \ \ \ \ \ ........lots of spaces ....\ \.scr<enter>
> mkdir k<enter>
> mv ins<tab> k <ctrl+c>
> mv ins<tab> k <ctrl+c>
> strings ins<tab>
> 
> Here's a gdb 'bt' backtrace from when the bug occurs:
> 
> (gdb) bt
> #0  0xb7e9c33b in strlen () from /lib/tls/libc.so.6
> #1  0xb7c4837d in unambig_data () from
> /usr/lib/zsh/4.2.5/zsh/complete.so
> #2  0xb7c48e76 in do_single () from /usr/lib/zsh/4.2.5/zsh/complete.so
> #3  0xb7c4989c in do_menucmp () from /usr/lib/zsh/4.2.5/zsh/complete.so
> #4  0xb7beb702 in ?? () from /usr/lib/zsh/4.2.5/zsh/complist.so
> #5  0x00000000 in ?? ()
> #6  0x00000000 in ?? ()
> #7  0x0000000a in ?? ()
> #8  0x00000000 in ?? ()
> #9  0xb7e95dcb in free () from /lib/tls/libc.so.6
> #10 0x0808833a in runhookdef ()
> #11 0xb7c3b020 in after_complete () from
> /usr/lib/zsh/4.2.5/zsh/complete.so
> #12 0x0808837e in runhookdef ()
> #13 0xb7c6ce02 in parambeg () from /usr/lib/zsh/4.2.5/zsh/zle.so
> #14 0xb7c6c27b in expandorcomplete () from /usr/lib/zsh/4.2.5/zsh/zle.so
> #15 0xb7c6bebd in completecall () from /usr/lib/zsh/4.2.5/zsh/zle.so
> #16 0xb7c61587 in execzlefunc () from /usr/lib/zsh/4.2.5/zsh/zle.so
> #17 0xb7c60c37 in zlecore () from /usr/lib/zsh/4.2.5/zsh/zle.so
> #18 0xb7c611df in zleread () from /usr/lib/zsh/4.2.5/zsh/zle.so
> #19 0x08077ea2 in ingetc ()
> #20 0x08077c61 in ingetc ()
> #21 0x080701ce in iaddtoline ()
> #22 0x0807d776 in gettok ()
> ---Type <return> to continue, or q <return> to quit---
> #23 0x0807d165 in yylex ()
> #24 0x08090f27 in parse_event ()
> #25 0x0807500a in loop ()
> #26 0x08077962 in zsh_main ()
> #27 0x0805268b in main ()
> 
> Here's some of the .zshrc options I use:
> 
> setopt menucomplete
> setopt autolist
> autoload -U compinit
> compinit
> zmodload -i zsh/complist
> zstyle ':completion:*' menu select=0
> zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
> 



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