zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Wesley Schwengle <wesley@mintlab.nl>
Cc: zsh-workers@zsh.org
Subject: Re: segfault via completion menu
Date: Mon, 20 May 2019 22:55:55 +0200	[thread overview]
Message-ID: <92606-1558385755.382793@sll5.5oha.0as1> (raw)
In-Reply-To: <CAEpdsiaGRHHZMnV1Aq7+9wwZpE3qH9dV4c-jVfTxMRO810TyHg@mail.gmail.com>

On 9 Apr, Wesley Schwengle wrote:
> today I've experiences a segfault running on an update to date zsh
> from git (6f35d6c0d0eeb80c0145e5226285a8a45ffb5f25)

Thanks for sending this to us.

> I can trigger this in a fairly "large" git repo such as the one I have
> at work, or using the repository of git itself. I've included the
> output of gdb
>
> I can trigger the bug with zsh -f and the attached zshrc:
>
> * cd ~code/git # the git repo from git@github.com:git/git.git
> * zsh -f
> * source the zshrc provided in this e-mail
> * vi Zaaksysteem::Bar::voo::vooo::voo<tab> <nowwaitafewsecs> <ctrl-c>
> * You now get a message: Killed by signal in compadd after 0s
> * vi <tab> # yields a segfault

This seems to be due to interrupting of pattern matching. I was able to
cut this down to something that doesn't involve completion:

  zsh -f
  setopt extendedglob
  () {
    TRAPINT() {
      return 1
    }
    : **/*~(#a10)Zaaksysteem::Bar::voo::vooo::voo
  }

  interrupt the function with Ctrl-C and now do something that involves
  pattern matching, e.g:

  [[ a = :*: ]]

The glob can be varied, it just needs to take long enough to give you
time to catch it with Ctrl-C so pick a big enough directory.

Older versions of zsh didn't have the problem so I've been able to
bisect it down to the change that introduced it:

[827d36077641ca87d1796b9c5cb05e7c44b01919] 36853: replace pushheap/popheap by NEWHEAPS/OLDHEAPS in doshfunc() to optimize memory management

Backing that out on top of master appears to fix the issue. As it was an
optimisation, that might be an option. From reading comments in mem.c,
it's not especially clear to me what newheaps/oldheaps do. There's only
the one other use.

Oliver

  reply	other threads:[~2019-05-20 20:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-09 14:30 Wesley Schwengle
2019-05-20 20:55 ` Oliver Kiddle [this message]
2019-05-21 21:58   ` Daniel Shahaf
2019-05-21 22:19     ` Bart Schaefer
2019-05-22  8:49       ` Peter Stephenson
2019-05-23 16:34         ` Peter Stephenson
2019-05-24 22:34           ` Peter Stephenson
2019-05-31 12:00             ` Wesley Schwengle
2019-05-31 13:29               ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=92606-1558385755.382793@sll5.5oha.0as1 \
    --to=okiddle@yahoo.co.uk \
    --cc=wesley@mintlab.nl \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).