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

Re: Crash on tab completion



On Mon, Sep 5, 2016 at 3:42 AM, Patrick Hilhorst
<patrickhilhorst97@xxxxxxxxx> wrote:
> Hello all,
>
> I recently made a typo in my .zshrc that caused tab complete to crash zsh:
>
> alias cpp_check="clang-tidy
> -checks=\"-*,cppcoreguidelines-*,clang-analyzer-*,misc-*,modernize-*,performance-*,readability-*"
>
> I presume this is because it tries to expand all asterisks. If any more
> documentation is required, you can reach me at this address, since I’m not
> subscribed to this mailing list.


% cpp_check  zle_tricky.c:658: BUG: 0 <= wb (-86) <= zlemetacs (9) <=
we (9) is not true!
BUG: substring ends in the middle of a metachar in ztrsub()


The "BUG: substring ..." line repeats 16 times and then zsh crashes.
Happens with the latest build from the repository.  Doesn't have
anything to do with the glob characters, it's all because of the
un-terminated double-quote in the expansion of the alias.  Also
crashes when compsys is NOT loaded, but without ever printing the
second BUG: line.  Seems to be because wb is computed with the alias
expanded, but then the alias is unwound before trying to update the
command line.



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