all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Daniel Colascione <dancol@dancol.org>, emacs-devel@gnu.org
Subject: Re: Failing to GC killed buffers considered harmful
Date: Sun, 29 Mar 2020 19:07:40 +0000	[thread overview]
Message-ID: <CAOqdjBcXy=EErkkspU8=BshzktpYpFCaJ72AJWAbf3gJWGGJpQ@mail.gmail.com> (raw)
In-Reply-To: <83sghr3skn.fsf@gnu.org>

On Sun, Mar 29, 2020 at 6:48 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > From: Pip Cet <pipcet@gmail.com>
> > Date: Sun, 29 Mar 2020 16:46:03 +0000
> > Cc: Daniel Colascione <dancol@dancol.org>, emacs-devel@gnu.org
> >
> > > We could, of course, remove the assertion, but then we are left with a
> > > dead buffer that will never be GC'ed, AFAIU, because objects that come
> > > from the portable dump are considered constantly marked.
> >
> > The same is true of all other objects, though, right?
>
> You mean, that they are considered marked?  Yes.

Well, if my initial experiments are correct, we correctly remove the
killed buffer from the all_buffers list; we simply fail to free the
memory it occupied. That seems like an acceptable loss to me.

> > It seems like it's simply a bad assert to me.
>
> Which one?

The one in buffer.c:

      /* Only buffers with allocated buffer text should be present at
     this point in temacs.  */
      FOR_EACH_BUFFER (b)
        {
      eassert (b->text->beg != NULL);
    }

> > The problem appears to be that "all_buffers" points to a killed
> > buffer, and is remembered by pdumper.
>
> Yes, because pdumper dumps all the Lisp objects present at that point,
> after performing GC.  What else can it do?

My understanding is that pdumper only dumps Lisp objects reachable
from the heap (not the stack). Buffers are an exception only because
of all_buffers, which we could rebuild from the dumped buffers.

The call to garbage_collect in Fdump_emacs_portable doesn't actually
reduce image size.



  reply	other threads:[~2020-03-29 19:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-29 14:23 Failing to GC killed buffers considered harmful Eli Zaretskii
2020-03-29 16:45 ` Stefan Monnier
2020-03-29 18:54   ` Eli Zaretskii
2020-03-29 19:06     ` Daniel Colascione
2020-03-29 19:24       ` Eli Zaretskii
2020-03-29 16:46 ` Pip Cet
2020-03-29 18:48   ` Eli Zaretskii
2020-03-29 19:07     ` Pip Cet [this message]
2020-03-29 19:12       ` Daniel Colascione
2020-03-29 19:25         ` Pip Cet
2020-03-29 19:28           ` Eli Zaretskii
2020-03-30 15:36             ` Pip Cet
2020-03-30 15:53               ` dancol
2020-03-30 17:07             ` Stefan Monnier
2020-03-30 17:02   ` Stefan Monnier
2020-03-30 18:32     ` Stefan Monnier
2020-03-30 18:51       ` Eli Zaretskii
2020-03-30 19:14         ` Daniel Colascione
2020-03-30 19:40         ` Stefan Monnier
2020-03-31 14:07           ` Eli Zaretskii
2020-03-31 14:09       ` Eli Zaretskii
2020-03-31 21:57         ` Stefan Monnier
2020-03-31 14:58       ` Pip Cet
2020-03-31 16:52         ` Stefan Monnier
2020-03-31 18:23           ` Pip Cet
2020-03-31 19:20             ` Stefan Monnier

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='CAOqdjBcXy=EErkkspU8=BshzktpYpFCaJ72AJWAbf3gJWGGJpQ@mail.gmail.com' \
    --to=pipcet@gmail.com \
    --cc=dancol@dancol.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.