Subject: bug#36649: 27.0.50; pure space and pdumper

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 16 May 2021 15:38:26 +0200

Eli Zaretskii <[email-masked]> writes:

> Looks like some memory problem: xrealloc segfaults.
>
> Don't we need to disable ASLR for unexec to work?  And doesn't that
> require setfattr or paxctl commands to be available?  If not, how do
> we disable ASLR in bootstrap-emacs and emacs binaries on GNU/Linux?

Hm...  the PROBLEMS file has this:

----
These segfaults should not occur on most modern systems, because the
Emacs build procedure uses the command 'setfattr' or 'paxctl' to mark
the Emacs executable as requiring non-randomized address space, and
Emacs uses the 'personality' system call to disable address space
randomization when dumping.
----

Is that correct?  I thought we had ASLR switched on on GNU/Linux builds?

----
To work around the ASLR problem in either an older or a newer kernel,
you can temporarily disable the feature while building Emacs.  On
GNU/Linux you can do so using the following command (as root).

    echo 0 > /proc/sys/kernel/randomize_va_space
----

I tried this recipe now on Debian/bullseye, but the unexec build still
segfaults.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no