all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: Daniel Colascione <dancol@dancol.org>
Cc: 47125@debbugs.gnu.org
Subject: bug#47125: 28.0.50; pdumper assumes compile time page size remains valid
Date: Sun, 14 Mar 2021 08:16:21 +0000	[thread overview]
Message-ID: <CAOqdjBct4ANydH48Ye6HyA_ETN+gThD7s3wMrK-WPrJQwYpvTQ@mail.gmail.com> (raw)
In-Reply-To: <90eb70a9-e482-3c08-9f14-8b813bdf0042@dancol.org>

On Sun, Mar 14, 2021 at 5:43 AM Daniel Colascione <dancol@dancol.org> wrote:
> On 3/13/21 9:37 PM, Eli Zaretskii wrote:
>
> >> From: Pip Cet <pipcet@gmail.com>
> >> Date: Sat, 13 Mar 2021 21:38:16 +0000
> >>
> >> I'm running Debian GNU/Linux (the Linux part is not provided by
> >> Debian) on an Apple M1-based machine. This currently involves running
> >> a kernel compiled with a 16 KB page size (the only fully functional
> >> kernel is currently available as a binary as recompilation of the
> >> alleged source fails to produce a fully working kernel).
> >>
> >> The Debian-packaged Emacs version does not start. Compiling from
> >> scratch works fine.
> >>
> >> After some investigation, this is because pdumper assumes that an
> >> address aligned according to the page size at build time is
> >> sufficiently aligned for mmap to work with the MAP_FIXED flag, when it
> >> comes to loading the dump. That's not true because the Debian Emacs
> >> was apparently built with a 4 KB page size, so it will not run on a
> >> system with a 16 KB page size.
> >>
> >> I've confirmed that I get the same error on current master if I modify
> >> getpagesize to return 4096 rather than the correct value.
> >>
> >> I think it would be best to handle this case gracefully, and I thought
> >> pdumper already did that, but it appears to simply fail.
> >>
> >> There are good reasons for increasing the page size, so this is likely
> >> to happen more often and on other architectures with varying page
> >> sizes.
> > CC'ing Daniel, in case he has comments and/or suggestions.
>
> We should modify this function to do what the doc comment says then. :-)
> I'm not sure if there's any reliable way to know what the worst case
> allocation granularity actually is: a quick grep through /usr/include
> didn't turn up anything. Maybe we should just use a minimum of 16kB
> here? It's not as if we'd be wasting a ton of RAM doing so.

Linux also offers 64KB pages, so I believe Andreas is correct, that
would be better.

Should we verify that getpagesize isn't problematic when loading the dump?

Thanks
Pip





  parent reply	other threads:[~2021-03-14  8:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-13 21:38 bug#47125: 28.0.50; pdumper assumes compile time page size remains valid Pip Cet
2021-03-14  5:37 ` Eli Zaretskii
2021-03-14  5:43   ` Daniel Colascione
2021-03-14  7:34     ` Andreas Schwab
2021-03-14  7:36       ` Daniel Colascione
2021-03-14  8:16     ` Pip Cet [this message]
2021-03-28 15:46       ` Lars Ingebrigtsen
2021-03-28 16:16         ` Eli Zaretskii
2021-03-28 17:13           ` Lars Ingebrigtsen

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=CAOqdjBct4ANydH48Ye6HyA_ETN+gThD7s3wMrK-WPrJQwYpvTQ@mail.gmail.com \
    --to=pipcet@gmail.com \
    --cc=47125@debbugs.gnu.org \
    --cc=dancol@dancol.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.