all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 42832@debbugs.gnu.org, Paul Eggert <eggert@cs.ucla.edu>
Subject: bug#42832: 28.0.50; "Bus error" when compiling Emacs now on Debian bullseye
Date: Fri, 14 Aug 2020 14:24:48 +0000	[thread overview]
Message-ID: <CAOqdjBcq56XCi6ecs-pY-2sM-45n7-nbo2g3cPi6yCOhLvKwHw@mail.gmail.com> (raw)
In-Reply-To: <CAOqdjBcJxPPCBdZ0EJPf+HqxBFEPh3Xv1+eXHw_Q7CvyMVOW0g@mail.gmail.com>

On Thu, Aug 13, 2020 at 2:08 PM Pip Cet <pipcet@gmail.com> wrote:
> All that sounds to me like we ought to dig down into the core file and
> figure out what happened, since the issue is likely to remain present
> otherwise and it seems somewhat difficult to track down and reproduce.

I have a theory, and it sounds like a somewhat silly bug.

- there's a hash table h in the dumper image
- h->hash points to dynamically allocated storage (as it always does
after my patch)
- the last reference to the hash table dies
- garbage_collect is called and collects h->hash
- h->hash's storage is reallocated for a different vector with a
different start position
- a word (re)appears on the stack which looks like it's a pointer to h
(it isn't, actually)
- garbage_collect is called and calls mark_maybe_pointer(h)
- h is recognized as a pdumper object
- h->hash is marked
- we're now marking a word in the middle of the new vector that
occupies the space that h->hash used to occupy
- in our case, this word is 0xc000000018000005, which is interpreted
as a tagged pointer, dereferencing of which leads to SIGBUS

Is there something which I'm missing which would prevent this scenario?

If no, any ideas on how to fix it? The obvious fix would be to always
mark all pdumped objects, but that has a performance cost. Less
obvious would be clearing the memory in the pdumper image that belongs
to an object that's being "freed", or keeping track of which pdumper
objects are still valid after GC...





  parent reply	other threads:[~2020-08-14 14:24 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12 17:12 bug#42832: 28.0.50; "Bus error" when compiling Emacs now on Debian bullseye Lars Ingebrigtsen
2020-08-12 18:22 ` Lars Ingebrigtsen
2020-08-12 18:30   ` Lars Ingebrigtsen
2020-08-12 18:50     ` Eli Zaretskii
2020-08-12 18:58       ` Lars Ingebrigtsen
2020-08-12 19:28         ` Lars Ingebrigtsen
2020-08-12 19:33           ` Lars Ingebrigtsen
2020-08-12 20:40             ` Paul Eggert
2020-08-12 20:47               ` Lars Ingebrigtsen
2020-08-12 21:42                 ` Pip Cet
2020-08-12 21:54                   ` Lars Ingebrigtsen
2020-08-13 10:05                     ` Pip Cet
2020-08-13 10:12                       ` Lars Ingebrigtsen
2020-08-13 10:15                         ` Lars Ingebrigtsen
2020-08-13 14:08                           ` Pip Cet
2020-08-14 11:48                             ` Lars Ingebrigtsen
2020-08-14 12:05                               ` Pip Cet
2020-08-14 12:34                                 ` Lars Ingebrigtsen
2020-08-14 14:24                             ` Pip Cet [this message]
2020-08-14 15:01                               ` Pip Cet
2020-08-14 15:37                                 ` Lars Ingebrigtsen
2020-08-14 19:08                                   ` Pip Cet
2020-08-14 19:35                                     ` Lars Ingebrigtsen
2020-08-14 21:10                                     ` Lars Ingebrigtsen
2020-08-14 21:48                                     ` Paul Eggert
2020-08-14 22:25                                       ` Pip Cet
2020-08-14 22:52                                         ` Paul Eggert
2020-08-12 22:00                   ` Lars Ingebrigtsen
2020-08-12 18:34   ` Eli Zaretskii
2020-08-12 18:41     ` Lars Ingebrigtsen
2020-08-12 19:26 ` Andreas Schwab

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=CAOqdjBcq56XCi6ecs-pY-2sM-45n7-nbo2g3cPi6yCOhLvKwHw@mail.gmail.com \
    --to=pipcet@gmail.com \
    --cc=42832@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=larsi@gnus.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.