Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM
	autolearn=ham autolearn_force=no version=3.4.1
Subject: Re: Segfault when displaying completion lists
To: zsh-workers@zsh.org
References: <1454972312.10740.8.camel@gladbachcity.de>
From: Eric Cook <llua@gmx.com>
X-Enigmail-Draft-Status: N1110
Message-ID: <56B92722.7070004@gmx.com>
Date: Mon, 8 Feb 2016 18:39:14 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <1454972312.10740.8.camel@gladbachcity.de>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:05jOhIeIe+FFB12eFD40PeNQYqqGjvTiXbitFcVsimEyBfFeh2q
 X3P4EOqtzwu2Xz72+aWJlw0O6G+oxPePudBd5V17Y+Sjd89D56FCe5ffYNtFGrV0qew8pbM
 KzmuGKSfg3dG2NZRlJajvBmlnCT01iab59mmbTzP8CfyoNTfAYwTHJQa1ZbIT4FCtrr7nkf
 q8Zsfwg9HIF7qFWJzwZdQ==
X-UI-Out-Filterresults: notjunk:1;V01:K0:+c4I49GkDrI=:Y0StyBSDY8zit8m6dMbSIP
 U+orKTD1lHcd8ubT5WrtqzwFgExNsG/ilgTYNThbkZUxJmRD2jvoTuUuROZXBxdaIO0BLyRcH
 olihVKHGopCtQM0cc6cDbFkc9CNfpKxHJm+0ivWexrPEBJB6glfWU92wv3ew4PCJx2Kuh5SKx
 ZoIZUTZq9Di56bsDVOSDqcxd5LL6nZ7jWRFszj6aA23i3CZz1VMeQy9e8wLdSX2ZRJl+v9Ld2
 xx8K5FWBj9QpbuOcX1hB6r6ZUsyLyVqnHoG+gxVwotFoMC1ac++1tVQ3Ym5dsaqpqHrv1vzzt
 KLbguNAwlZ//c2yVrt0+3r05GZHoQovFPh2yXVBcIu1HvA2v/I1vKUvkekLfRTStgYdfwIK2a
 p8uHNnxQMmwa8YdhnAmHO89Hjri8XKiz1oLD+DsJRfN64ROkeD2hD9tAN1rgQKoxmVfppRxMl
 xO5Wd4v1Nz3xeKLUGKHvfFfua6hXNdCiLrGVDcO79mLX9g2QmAbSXbWdYt/o7tB2rIldCAhUg
 OD7Yxar1GjAsvEWDyaOVJANMFqDnJbjWskB8GAfgrGTXAxkCjabvsHeQIWnrx41Ml8Ca6FTHT
 FDkWSXHCfEk6msiVFcUUAt/fKmlHTy4GiyaYcs4JF0Ww4bIC5QUiB3Hfd7GzEnucTgWncKHdo
 xaaVws9DXy5p8/5GVvHps1gsa39HyWpbPXYKpAOEymWzENLKEFo5pjh3YYUT9wAKGQj/R5Z2b
 80j3dy7NlJvrWO+jfljmg2S+RTHhLjW5CZrFXktls9I3tLjUdykqqi4ZTVHq7d0qAGO3wEljK
 6AH/hxq
X-Seq: zsh-workers 37921

On 02/08/2016 05:58 PM, Christian Heinrich wrote:
> Hello,
> 
> I'm running ZSH 5.2-3 on my Debian Testing system. This error existed
> previously, too, but I only found the time today to find a minimal
> setup for this. Here we go:
> 
> % zsh --norcs
> % zmodload zsh/complist
> % autoload -U compinit && compinit -d ~/.zsh/cache/zcompdump 
> % zstyle ':completion:*' list-prompt '%p'
> % bindkey -d
> % ls /usr/lib/<TAB>
> Now a huge list should be displayed with a pager. Press "Arrow Down"
> and it should segfault.
> 
> 
> This does not happen if the "zsh/complist" module is not loaded.
> 
> Another interesting observation:
> 
> After the <TAB>, press backspace instead of "arrow down" and remove the
> whole command (do not accept the line). Type "bindkey -d" (yes, a 2nd
> time) and accept. Type "ls /usr/lib/<TAB>" again and press backspace.
> It segfaults now, although backspacing worked the first time.
> 
> Maybe someone can find the reason for this? I do have EDITOR="vim" set,
> but it appears as if it happens with EDITOR="emacs" as well.
> 
> 
> Thanks!
> 
> Christian
> 

This is a guess:

menu selection requires a keymap named menuselect to function. you can view
it with ''bindkey -l''. This keymap is provided by the complist module
that you loaded initially, then sequentially deleted with ''bindkey -d''
returning the keymaps back to a default state.

The zsh/complist is loaded automatically on first use of menuselect,
which explains why ''zmodload zsh/complist'' is required for the segfault.

If my guess is true, zsh should handle the menuselect keymap not existing more elegantly.
But i wouldn't expect menuselect to be of much use without keybinds.

