unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Thomas Fitzsimmons <fitzsim@fitzsim.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 33174-done@debbugs.gnu.org
Subject: bug#33174: 27.0.50; Dump fails on GNU/Linux ppc64le
Date: Sun, 18 Nov 2018 22:14:44 -0500	[thread overview]
Message-ID: <m3sgzxu5az.fsf@fitzsim.org> (raw)
In-Reply-To: <0de7486c-04d1-a13d-4490-b79c4b8f68e2@cs.ucla.edu> (Paul Eggert's message of "Tue, 13 Nov 2018 06:42:42 -0800")

[-- Attachment #1: Type: text/plain, Size: 1916 bytes --]

Paul Eggert <eggert@cs.ucla.edu> writes:

> Thomas Fitzsimmons wrote:
>> It looks like the second patch still disables ASLR unconditionally on
>> PPC64.  If you want to suggest experiments I can try on my system, maybe
>> I can attempt a fix so that ASLR can be disabled only during dumping on
>> PPC64 like on other archiectures.  Or do you know that's an
>> impossibility for some reason?
>
> I don't recall the reason that ppc64 is different, but you can
> experiment by applying the attached patch. To help with the detective
> work you might look at the thread containing this email:
>
> https://sourceware.org/ml/libc-alpha/2016-07/msg00538.html

I read through that thread, then tried the patch.  I was surprised that
everything seems to work:

   - Bootstrap works within a reasonable amount of RAM (limited with
     ulimit -d to make sure it didn't spike up to 12 GB).

   - The Emacs process (run as ./src/emacs from the build directory):

      - does not use 12 GB of RAM (i.e., RAM usage is reasonable after
        opening a C file, src/xdisp.c).

      - has a /proc/<pid>/personality value of 00000000.

      - runs subprocesses with a /proc/self/personality value of
        00000000.

My system has glibc 2.24.  src/config.h has "#define HYBRID_MALLOC 1".
Hybrid malloc was proposed as a proper fix during that discussion, but
wasn't enabled by default at the time.  Given that I configured with
just "./configure --with-x-toolkit=lucid", it seems that hybrid malloc
is enabled by default now.  I'm not sure if this would now work on older
glibc versions as well, but in case it doesn't, what about something
like the attached for master?

Are there other tests I should try, to reveal problems?  If the patch
looks OK, I should probably also test it on Fedora as part of a local
Rawhide Emacs package build, since lots of the discussion was about
getting that working reliably.

Thanks,
Thomas


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Enable-ASLR-on-PPC64-glibc-versions-2.24.patch --]
[-- Type: text/x-diff, Size: 977 bytes --]

From d69509b909bc35b0908e40a9be741e9ef38b3402 Mon Sep 17 00:00:00 2001
From: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Date: Sun, 18 Nov 2018 11:07:49 -0500
Subject: [PATCH] Enable ASLR on PPC64 when glibc version is >= 2.24

* src/sysdep.c (maybe_disable_address_randomization): Disable
randomization on PPC64 only when glibc version is less than 2.24.
---
 src/sysdep.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/sysdep.c b/src/sysdep.c
index ddcb594f66..1a863e65ab 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -164,7 +164,8 @@ maybe_disable_address_randomization (bool dumping, int argc, char **argv)
   if (argc < 2 || strcmp (argv[1], aslr_disabled_option) != 0)
     {
       bool disable_aslr = dumping;
-# ifdef __PPC64__
+# if defined(__PPC64__) \
+  && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 24))
       disable_aslr = true;
 # endif
       exec_personality = disable_aslr ? personality (0xffffffff) : -1;
-- 
2.11.0


      reply	other threads:[~2018-11-19  3:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-27 10:35 bug#33174: 27.0.50; Dump fails on GNU/Linux ppc64le Thomas Fitzsimmons
2018-10-27 13:16 ` Thomas Fitzsimmons
2018-10-27 20:26   ` Paul Eggert
2018-10-28  8:05     ` Paul Eggert
2018-10-28 12:56       ` Thomas Fitzsimmons
2018-10-28 19:22         ` Paul Eggert
2018-10-30  1:28           ` Thomas Fitzsimmons
2018-10-30  2:16             ` Paul Eggert
2018-10-29  1:47     ` Thomas Fitzsimmons
2018-10-29  7:22       ` Paul Eggert
2018-10-30  2:44         ` Thomas Fitzsimmons
2018-10-30  5:58           ` Paul Eggert
2018-10-30  9:30             ` Thomas Fitzsimmons
2018-11-12  6:39               ` Paul Eggert
2018-11-12 17:24                 ` Andy Moreton
2018-11-13  2:29                 ` Thomas Fitzsimmons
2018-11-13 14:42                   ` Paul Eggert
2018-11-19  3:14                     ` Thomas Fitzsimmons [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3sgzxu5az.fsf@fitzsim.org \
    --to=fitzsim@fitzsim.org \
    --cc=33174-done@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    /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.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).