From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15506 invoked from network); 25 May 2020 11:03:29 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 25 May 2020 11:03:29 -0000 Received: (qmail 9131 invoked by alias); 25 May 2020 11:03:19 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45911 Received: (qmail 11487 invoked by uid 1010); 25 May 2020 11:03:19 -0000 X-Qmail-Scanner-Diagnostics: from mail-lj1-f175.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25821. spamassassin: 3.4.4. Clear:RC:0(209.85.208.175):SA:0(-2.0/5.0):. Processed in 1.334874 secs); 25 May 2020 11:03:19 -0000 X-Envelope-From: marlon.richert@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.208.175 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=4UPU+a0W8imJSyve5sqlzqgMO92gucKfN5Q6brLN45c=; b=Z/Wh4A9tCNqPD4DY6EOpGCWsznJXzI5tsIUaC0CqW26hlOLeU1WHQiwbL4F7mHAELg pB61J5TiXem5w5qEqDjxbcbl9NCcrW1k5NCmg2qR9pnjFiqp3zxTuZcivoWbYXllpTaG HHxYdcFXD9E7eff7AxlU6zlo7QsieXHMpcXkF9Edr2oDWrKnBajJAxFwAy2kj/Hix3mH 3YbG6zuoNDtdJT438fTISvN8YT74/g0USM8maOD8vDRZU3016TvLQXol63adOjFP8y4a 8U85kouBv56OMGf/w978YCOUJGPVW2Pgdif3dhyN8Y3i5b4hxdBsBoeBbwG+/rXjhJSB RTYg== X-Gm-Message-State: AOAM531aKiKB6EQS+r16lXcoAQVJq+lpbN6ONlIn8gYsPZTRtowqJ27s 63N7h92jEDfXLge/1lDufux0vdNguuQF7Ug3bdw2otRs X-Google-Smtp-Source: ABdhPJwY7Uu9DaA3KidEWYMMAfc0rSepnPuyr+PTJaqKgT4fKRAt50MTOvzCjcqSDVt4Fo0C+Ru0wMKQG8WwCh3huV0= X-Received: by 2002:a2e:164f:: with SMTP id 15mr13402728ljw.67.1590404558908; Mon, 25 May 2020 04:02:38 -0700 (PDT) MIME-Version: 1.0 From: Marlon Richert Date: Mon, 25 May 2020 14:02:27 +0300 Message-ID: Subject: Zsh crashes on `compadd` when using `_history` completer & zstyle `ignored-patterns` is set To: Zsh hackers list Content-Type: multipart/alternative; boundary="000000000000c86ef305a676eafd" --000000000000c86ef305a676eafd Content-Type: text/plain; charset="UTF-8" *Given* - A .zshrc file containing the following lines: HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history HISTSIZE=2000 SAVEHIST=1000 autoload -Uz compinit compinit zstyle ':completion:*' ignored-patterns '' - A `${ZDOTDIR:-$HOME}/.zsh_history` file that contains >1000 lines of history. *When* 1. I start a new shell with `zsh -dxv &>! ~/zsh-debug.log` 2. I press `^[/` to activate `_history-complete-older` (or anything else that uses the `_history` completer). *Then* - Zsh crashes with the message `zsh: segmentation fault`. - `~/zsh-debug.log` ends in the following lines: +_history:60> _wanted -1V history-words expl 'history word' compadd -Q -a hslice +_wanted:3> local -a __targs __gopt +_wanted:5> zparseopts -D -a __gopt 1 2 V J x 'C:=__targs' +_wanted:7> _tags history-words +_tags:3> local prev +_tags:10> [[ history-words = -- ]] +_tags:15> (( 1 )) +_tags:19> local curcontext=history-words:history:: order tag nodef tmp +_tags:21> [[ history-words = -C?* ]] +_tags:24> [[ history-words = -C ]] +_tags:29> [[ history-words = -(|-) ]] +_tags:31> zstyle -a :completion:history-words:history::: group-order order +_tags:36> comptags -i history-words:history:: history-words +_tags:40> [[ -n '' ]] +_tags:43> zstyle -a :completion:history-words:history::: tag-order order +_tags:44> (( ! 0 )) +_tags:55> [[ -z '' ]] +_tags:55> comptry history-words +_tags:60> comptags -T +_tags:62> return +_wanted:9> _tags +_tags:3> local prev +_tags:10> [[ '' = -- ]] +_tags:15> (( 0 )) +_tags:67> comptags -N +_wanted:10> _all_labels -1 -V history-words expl 'history word' compadd -Q -a hslice +_all_labels:3> local __gopt __len __tmp __pre __suf __ret=1 __descr __spec __prev +_all_labels:5> [[ -1 = - ]] +_all_labels:10> __gopt=( ) +_all_labels:11> zparseopts -D -a __gopt 1 2 V J x +_all_labels:13> __tmp=8 +_all_labels:14> __len=7 +_all_labels:15> [[ __tmp -lt __len ]] +_all_labels:18> [[ __tmp -eq 7 ]] +_all_labels:22> __pre=4 +_all_labels:23> __suf=5 +_all_labels:26> comptags -A history-words curtag __spec +_all_labels:27> (( 7 > _tags_level )) +_all_labels:27> _comp_tags='' +_all_labels:28> _tags_level=7 +_all_labels:29> _comp_tags=' history-words ' +_all_labels:30> [[ history-words = *[^\\]:* ]] +_all_labels:37> _description -1 -V history-words expl 'history word' +_description:3> local name nopt xopt format gname hidden hide match opts tag +_description:4> local -a ign gropt sort +_description:6> opts=( ) +_description:8> xopt=( -X ) +_description:9> nopt=( ) +_description:10> zparseopts -K -D -a nopt 1 2 'V=gropt' 'J=ign' 'x=xopt' +_description:12> 3='history word' +_description:13> [[ -n 'history word' ]] +_description:13> _lastdescr=( '' 'history word' ) +_description:15> zstyle -s :completion:history-words:history:::history-words group-name gname +_description:18> _setup history-words -default- +_setup:3> local val nm=0 +_setup:5> [[ 2 -eq 1 ]] +_setup:7> zstyle -a :completion:history-words:history:::history-words list-colors val +_setup:21> [[ history-words = default ]] +_setup:27> zstyle -s :completion:history-words:history:::history-words show-ambiguity val +_setup:32> zstyle -t :completion:history-words:history:::history-words list-packed +_setup:34> [[ 2 -eq 1 ]] +_setup:37> compstate[list]=ambiguous +_setup:40> zstyle -t :completion:history-words:history:::history-words list-rows-first +_setup:42> [[ 2 -eq 1 ]] +_setup:45> compstate[list]=ambiguous +_setup:48> zstyle -t :completion:history-words:history:::history-words last-prompt +_setup:50> [[ 2 -eq 1 ]] +_setup:53> compstate[last_prompt]=yes +_setup:56> zstyle -t :completion:history-words:history:::history-words accept-exact +_setup:58> [[ 2 -eq 1 ]] +_setup:61> compstate[exact]='' +_setup:64> [[ _last_nmatches -ge 0 ]] +_setup:67> zstyle -a :completion:history-words:history:::history-words menu val +_setup:71> _last_nmatches=-1 +_setup:74> [[ '' != always ]] +_setup:75> zstyle -s :completion:history-words:history:::history-words force-list val +_description:20> name=expl +_description:22> zstyle -s :completion:history-words:history:::history-words format format +_description:23> zstyle -s :completion:history-words:history:::descriptions format format +_description:25> zstyle -s :completion:history-words:history:::history-words hidden hidden +_description:30> zstyle -s :completion:history-words:history:::history-words matcher match +_description:32> [[ -n '' ]] +_description:36> [[ -z -V ]] +_description:47> gropt=( -o nosort ) +_description:50> [[ -z '' ]] +_description:51> zstyle -a :completion:history-words:history:::history-words ignored-patterns _comp_ignore +_description:54> zstyle -s :completion:history-words:history:::history-words ignore-line hidden +_description:70> (( 1 )) +_description:70> opts=( -F _comp_ignore ) +_description:75> tag=history-words +_description:77> shift 2 +_description:78> [[ -z 'history word' ]] +_description:80> [[ -n '' ]] +_description:84> [[ -n '' ]] +_description:91> [[ -n '' ]] +_description:94> set -A expl -F _comp_ignore -1 -o nosort -J -default- +_description:98> (( 0 )) +_description:99> local fakestyle descr +_description:100> fakestyle=fake +_description:101> zstyle -a :completion:history-words:history:::history-words fake match +_description:102> continue +_description:100> fakestyle=fake-always +_description:101> zstyle -a :completion:history-words:history:::history-words fake-always match +_description:102> continue +_description:115> return 0 +_all_labels:39> compadd -F _comp_ignore -1 -o nosort -J -default- -Q -a hslice *Additional notes:* If I - remove the line `zstyle ':completion:*' ignored-patterns ''` or - change it to `zstyle ':completion:*:^(history-words)' ignored-patterns ''` or - remove the histfile, then the crash no longer happens. It doesn't matter what the actual value of `ignored-patterns` is. Whenever it is used with the `_history` completer, Zsh crashes on the same line. --000000000000c86ef305a676eafd--