zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: <zsh-workers@zsh.org>
Subject: Re: segfault via completion menu
Date: Thu, 23 May 2019 17:34:18 +0100	[thread overview]
Message-ID: <1558629258.12004.5.camel@samsung.com> (raw)
In-Reply-To: <1558514961.5043.7.camel@samsung.com>

On Wed, 2019-05-22 at 09:49 +0100, Peter Stephenson wrote:
> On Tue, 2019-05-21 at 15:19 -0700, Bart Schaefer wrote:
> It'll be something in the prog passed into pattry() from evalcond() and
> I'm guesing in this case the pprog in that function came from
> stat->prog->pats[npat] so was fished out of the existing programme
> rather than compiled locally.

If so, something in the following assumptions is being violated, but I
can't see what from looking at the code.

- Whenever we initialise or copy pats[*] we set it to point to a dummy
pattern, ensuring we recompile the pattern next time.

- If we compile the pattern, we only save it if the code it's
being saved into is not on the heap.  (Which it shouldn't be
here, as this is a shell function.)

- If we save it we always use permanent memory.

Possibly adding some debug flags to check the heapiness of patterns at
various points might show something.  (Guess we should check it
is coming from a previously saved version rather than a newly
compiled version, though I don't see how the latter could cause
a crash.)

pws


  reply	other threads:[~2019-05-23 16:35 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
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 [this message]
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=1558629258.12004.5.camel@samsung.com \
    --to=p.stephenson@samsung.com \
    --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).