From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.bugs Subject: bug#33174: 27.0.50; Dump fails on GNU/Linux ppc64le Date: Mon, 12 Nov 2018 17:24:27 +0000 Message-ID: <8636s68b04.fsf@gmail.com> References: <39df62a1-58fb-0e5c-88a6-3eaae4e865d4@cs.ucla.edu> <9fbbce6a-ca72-e4e2-1456-49e146542896@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1542044267 24152 195.159.176.226 (12 Nov 2018 17:37:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Nov 2018 17:37:47 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (windows-nt) To: 33174@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 12 18:37:43 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 1gMG9d-0006Ai-BS for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Nov 2018 18:37:41 +0100 Original-Received: from localhost ([::1]:49948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMGBj-0007GK-PZ for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Nov 2018 12:39:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMFyP-0001aZ-O5 for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2018 12:26:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMFyM-0001mH-Hc for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2018 12:26:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44040) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gMFyM-0001m7-DR for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2018 12:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gMFyM-00034G-9z for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2018 12:26:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Andy Moreton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Nov 2018 17:26:02 +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: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.154204350211719 (code B ref -1); Mon, 12 Nov 2018 17:26:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Nov 2018 17:25:02 +0000 Original-Received: from localhost ([127.0.0.1]:48298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gMFxO-00032s-5m for submit@debbugs.gnu.org; Mon, 12 Nov 2018 12:25:02 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gMFxM-00032O-I3 for submit@debbugs.gnu.org; Mon, 12 Nov 2018 12:25:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMFxG-0000bH-Kp for submit@debbugs.gnu.org; Mon, 12 Nov 2018 12:24:55 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:54941) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gMFxG-0000b9-G0 for submit@debbugs.gnu.org; Mon, 12 Nov 2018 12:24:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMFxF-0000ZS-IF for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2018 12:24:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMFxC-0000Y2-DJ for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2018 12:24:53 -0500 Original-Received: from [195.159.176.226] (port=54146 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gMFx8-0000Q7-FN for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2018 12:24:48 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gMFup-0004LV-NJ for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2018 18:22:23 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 69 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:HyV+mknBpCMHCftXuBD6wB0J90I= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:152323 Archived-At: On Sun 11 Nov 2018, Paul Eggert wrote: > Thomas Fitzsimmons wrote: >> Actually, EMACS_HEAP_EXEC is true! > > OK, thanks, that explains things. I installed the first attached patch to the > emacs-26 branch as a quick hack to work around the problem, and the second > attached patch to the master branch to come up with a better way to address > the underlying issue that doesn't involve fiddling with environment variables. > Please let us know if this doesn't work for your platform, as I've tested this > only on x86-64. The second patch (applied to master) breaks the build on Windows. > diff --git a/src/lisp.h b/src/lisp.h > index eb6762678c..383d61274c 100644 > --- a/src/lisp.h > +++ b/src/lisp.h > @@ -4325,9 +4325,12 @@ struct tty_display_info; > > /* Defined in sysdep.c. */ > #ifdef HAVE_PERSONALITY_ADDR_NO_RANDOMIZE > -extern bool disable_address_randomization (void); > +extern int maybe_disable_address_randomization (bool, int, char **); > #else > -INLINE bool disable_address_randomization (void) { return false; } > +INLINE void > +maybe_disable_address_randomization (bool dumping, int argc, char **argv) > +{ > +} The return type must be consistent as it is used by its caller: C:/emacs/git/emacs/master/src/emacs.c: In function 'main': C:/emacs/git/emacs/master/src/emacs.c:709:8: error: void value not ignored as it ought to be argc = maybe_disable_address_randomization (dumping, argc, argv); ^ The obvious fix seems to work: #ifdef HAVE_PERSONALITY_ADDR_NO_RANDOMIZE extern int maybe_disable_address_randomization (bool, int, char **); #else INLINE int maybe_disable_address_randomization (bool dumping, int argc, char **argv) { return argc; } #endif > +int > +maybe_disable_address_randomization (bool dumping, int argc, char **argv) > { [snipped] > + if (argc < 2 || strcmp (argv[1], aslr_disabled_option) != 0) > + { [snipped] > + } > + else > + { > + /* Our earlier incarnation already disabled ASLR. */ > + argc--; > + memmove (&argv[1], &argv[2], argc * sizeof *argv); > + } This looks wrong: the memmove size is one element too long, and if argc was 2 then there is an out of bounds access. AndyM