From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Thomas Fitzsimmons Newsgroups: gmane.emacs.bugs Subject: bug#33174: 27.0.50; Dump fails on GNU/Linux ppc64le Date: Sun, 18 Nov 2018 22:14:44 -0500 Message-ID: References: <39df62a1-58fb-0e5c-88a6-3eaae4e865d4@cs.ucla.edu> <9fbbce6a-ca72-e4e2-1456-49e146542896@cs.ucla.edu> <0de7486c-04d1-a13d-4490-b79c4b8f68e2@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1542597069 1440 195.159.176.226 (19 Nov 2018 03:11:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 19 Nov 2018 03:11:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 33174-done@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 19 04:11:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gOZxo-0000GK-Rm for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Nov 2018 04:11:05 +0100 Original-Received: from localhost ([::1]:54094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOZzv-0003Ii-4k for geb-bug-gnu-emacs@m.gmane.org; Sun, 18 Nov 2018 22:13:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOZzl-0003IX-Bk for bug-gnu-emacs@gnu.org; Sun, 18 Nov 2018 22:13:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOZzi-0003BA-3v for bug-gnu-emacs@gnu.org; Sun, 18 Nov 2018 22:13:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55300) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gOZzh-0003Au-Uk for bug-gnu-emacs@gnu.org; Sun, 18 Nov 2018 22:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gOZzh-0005fv-Ox for bug-gnu-emacs@gnu.org; Sun, 18 Nov 2018 22:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Thomas Fitzsimmons Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Nov 2018 03:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33174 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33174-done@debbugs.gnu.org id=D33174.154259715021770 (code D ref 33174); Mon, 19 Nov 2018 03:13:01 +0000 Original-Received: (at 33174-done) by debbugs.gnu.org; 19 Nov 2018 03:12:30 +0000 Original-Received: from localhost ([127.0.0.1]:59558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gOZzB-0005f3-Qk for submit@debbugs.gnu.org; Sun, 18 Nov 2018 22:12:30 -0500 Original-Received: from mail-it1-f177.google.com ([209.85.166.177]:33511) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gOZz8-0005eo-G4 for 33174-done@debbugs.gnu.org; Sun, 18 Nov 2018 22:12:28 -0500 Original-Received: by mail-it1-f177.google.com with SMTP id p11-v6so6252538itf.0 for <33174-done@debbugs.gnu.org>; Sun, 18 Nov 2018 19:12:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fitzsim-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=zJP0ZYDSJiD7OLS6oLubLxKdYuiXsUv0rY0DpDS7oO8=; b=qKx/JnAyPL3HE24JO7/TImOd4hqd9yRCG18iI5vyiwJwoD7ocJtcaBL//Hc8gQMqvf F4JQHHb045I34PTDbG7XLTCK+MD+bKSMdQuID9OEo+NV/WiONyRw4l9YvoMFEFZ9XnVL mYx1/yg5ObCBlzAy3xQ0azrNjz6JIwC/y4de+BFw+DByrHxGm6bTQ6YPpm3LhhlgLuOB hR9oULvYSJwONiyMKGnqhGUFEvJ0oJWXn0VMaHUEk6nc6igxu/88/hAiEK0QcXskk41i CsPLxIINbg+y/IEzi8YHbarSNhEzo3pIG3ADGLVYX1V/TkR8C8p1BTfJkwQeFx7U7KyG HxVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=zJP0ZYDSJiD7OLS6oLubLxKdYuiXsUv0rY0DpDS7oO8=; b=G30HYJTmI5FLwOzjj+L3RcL6/Az7ZRTsNCTQRVTBmbNgD8PXHkLYqA36FanCitPRM9 QcNsN7bRAVuh4QJSyHCDFtoDCzEjKZhp3waYaGadcHvioYOTs7e1AEYEKw2VBh9cfgjJ 3HwwSnJPxqUM72W1WSr3CFhGQPizvAtM772YMlV1fXBYCq4FeWujj8SzDZtrIgxAdYss /Rmqam1uQiCphHbpAUjKjBMu8aROU7Fc8+Sl4+6q+myEzhQnwGDZJee8DZfInwK9yO3g PWeZeemHmTZv1PR4fFootGSMUe/CLjQ3pOlg/G0Gyo5SS1MhSW+IjaMALopoNAj/XWdu LqCQ== X-Gm-Message-State: AGRZ1gICWV2yr2VV/dnkjYfOjADh47zMEzBwywL8+gsmQXu/o86Q3QIB H+qC8s0kYxRVPtSF1b72tkThQu77xcTzrw== X-Google-Smtp-Source: AJdET5egNu34JaQ8J4RZtAECq2NPeTsRmw5+2pcQw5vsdJRXzb0r4e5FOGsWaDbo4ecWSzwcgt2f6g== X-Received: by 2002:a02:a98e:: with SMTP id q14-v6mr17650535jam.109.1542597140564; Sun, 18 Nov 2018 19:12:20 -0800 (PST) Original-Received: from localhost.localdomain (69-165-165-189.dsl.teksavvy.com. [69.165.165.189]) by smtp.gmail.com with ESMTPSA id i135sm8319823iti.34.2018.11.18.19.12.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Nov 2018 19:12:19 -0800 (PST) In-Reply-To: <0de7486c-04d1-a13d-4490-b79c4b8f68e2@cs.ucla.edu> (Paul Eggert's message of "Tue, 13 Nov 2018 06:42:42 -0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152522 Archived-At: --=-=-= Content-Type: text/plain Paul Eggert 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//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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Enable-ASLR-on-PPC64-glibc-versions-2.24.patch >From d69509b909bc35b0908e40a9be741e9ef38b3402 Mon Sep 17 00:00:00 2001 From: Thomas Fitzsimmons 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 --=-=-=--