zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: Oliver Kiddle <okiddle@yahoo.co.uk>,
	Wesley Schwengle <wesley@mintlab.nl>,
	 "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: segfault via completion menu
Date: Tue, 21 May 2019 15:19:23 -0700	[thread overview]
Message-ID: <CAH+w=7Z2yT_SeyjE=ObXJw-yFW71rfSn3iv+WqvcmX6VLJY1-A@mail.gmail.com> (raw)
In-Reply-To: <90e15b90-14bb-4ef0-9aef-cc15c0fa0935@www.fastmail.com>

On Tue, May 21, 2019 at 2:59 PM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
>
> Oliver Kiddle wrote on Mon, 20 May 2019 20:57 +00:00:
> > 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.
>
> It's not too clear to me either.

Operationally, the difference between pushheap() and NEWHEAPS() is
that pushing scans the entire list of existing heap blocks and moves
them out of the way in favor of new empty blocks.  This is
time-consuming and eats a lot of memory if you're in a tightly
recursive function (read back through the articles leading up to the
change).  In contrast, NEWHEAPS() just starts an entirely new chain of
heap blocks without reference to the existing chain.

If an error occurs as a result of NEWHEAPS()/OLDHEAPS() in the context
of workers/36853, it ought to be traceable to something leaking
heap-allocated storage across boundaries, and probably means there was
a memory leak when interrupting a pattern match before, which this has
turned into an error by freeing the previously leaked space.

  reply	other threads:[~2019-05-21 22:20 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 [this message]
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='CAH+w=7Z2yT_SeyjE=ObXJw-yFW71rfSn3iv+WqvcmX6VLJY1-A@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=d.s@daniel.shahaf.name \
    --cc=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).