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

Re: Zsh crashes on `compadd` when using `_history` completer & zstyle `ignored-patterns` is set



Marlon Richert wrote on Thu, 28 May 2020 10:49 +0300:
> On Tue, 26 May 2020 at 21:48, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> 
> >
> > I followed these steps as follows:
> >
> > [[[
> > $ cd "$(mktemp -d)"
> > $ tee .zshrc
> > HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
> > HISTSIZE=2000
> > SAVEHIST=1000
> > autoload -Uz compinit
> > compinit
> > zstyle ':completion:*' ignored-patterns ''
> > <pressed Ctrl+D>
> > $ yes | head -1001 > .zsh_history
> > $ ZDOTDIR=$PWD $builddir/Src/zsh -d
> > % bindkey -e
> > % <pressed M-/>
> > ]]]
> >
> > The terminal beeped and no crash happened.
> >
> > What's your $ZSH_VERSION and $ZSH_PATCHLEVEL?
> >  
> 
> $ZSH_VERSION = 5.8
> $ZSH_PATCHLEVEL = zsh-5.8-0-g77d203f
> 
> Could the contents of my histfile have an influence on this? If you do `yes
> | head -1001 > .zsh_history`, then there is no realistic data in the
> histfile.
> 

That's possible, yes.  Can _you_ reproduce the bug using the steps I posted?

I don't have your $HISTFILE, but I can't reproduce the issue if
I substitute my $HISTFILE (using «cp $HISTFILE ./.zsh_history») into the
above steps, and it's longer than 1000 lines.

> I noticed that if I start Zsh without a histfile, then the problem does not
> occur.

What if you start zsh with a empty histfile?

If you can reproduce the problem with your usual histfile but not with
an empty one, try reducing your histfile to the smallest one that does
still reproduce the problem.  There are generic instructions at
http://www.zsh.org/cgi-bin/mla/redirect?WORKERNUMBER=45791, if you
aren't familiar with the procedure.  (They're written for .zshrc but
you can apply them to $HISTFILE as well.)

Can you try reproducing the bug in zsh built from master?

Cheers,

Daniel



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