Iain Lane <[email protected]> writes:

> We noticed in Ubuntu (zesty) that emacs24 was failing to build, like:
>
>> Memory exhausted--use M-x save-some-buffers then exit and restart
>> Emacs
>
> ...I checked in Debian, and the same happens for us here on ppc64 (be).
>
>   
> https://buildd.debian.org/status/fetch.php?pkg=emacs24&arch=ppc64&ver=24.5+1-8&stamp=1485124019&raw=0
>
> Some brief googling led me to
>
>   https://bugzilla.redhat.com/show_bug.cgi?id=1356919
>
> and then onto
>
>   https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24033#11
>
> Which I backported to 24 (25 is fixed), and it made emacs24 build for
> us.
>
> The patch is attached if you want it.

Thanks for the help -- first I'd like to figure out how this patch
relates to

  debian/patches/0022-Emacs-should-work-with-glibc-2.24-on-ppc64.patch

Which I think may already include effectively the same code, though
guarded differently and in a different location.  i.e. I wonder if that
patch either needs adjustment, or replacement.


> From ff3fc21e24edffccce0d42065833e852a6792bd2 Mon Sep 17 00:00:00 2001
> From: Paul Eggert <[email protected]>
> Date: Tue, 19 Jul 2016 15:23:14 +0200
> Subject: Port to glibc 2.24 (pre-release) + ppc64
>
> Backported to Debian/Ubuntu by Iain Lane <[email protected]> to fix
> memory exhaustion failures on ppc64el.
>
> Backport from master (Bug#24033).
> Inspired by a suggestion by Florian Weimer in:
> https://sourceware.org/ml/libc-alpha/2016-07/msg00425.html
> * src/emacs.c (main) [__PPC64__]:
> Special case for __PPC64__, which needs ASLR disabled in
> dumped Emacs too.
> ---
>  src/emacs.c | 24 ++++++++++++++++++++++--
>  1 file changed, 22 insertions(+), 2 deletions(-)
>
> Index: emacs24-24.5+1/src/emacs.c
> ===================================================================
> --- emacs24-24.5+1.orig/src/emacs.c
> +++ emacs24-24.5+1/src/emacs.c
> @@ -723,6 +723,27 @@ main (int argc, char **argv)
>    stack_base = &dummy;
>  #endif
>  
> +#if defined HAVE_PERSONALITY_ADDR_NO_RANDOMIZE && defined __PPC64__
> +  /* This code partly duplicates the HAVE_PERSONALITY_LINUX32 code
> +     below.  This duplication is planned to be fixed in a later
> +     Emacs release.  */
> +# define ADD_NO_RANDOMIZE 0x0040000
> +  int pers = personality (0xffffffff);
> +  if (! (pers & ADD_NO_RANDOMIZE)
> +      && 0 <= personality (pers | ADD_NO_RANDOMIZE))
> +    {
> +      /* Address randomization was enabled, but is now disabled.
> +      Re-execute Emacs to get a clean slate.  */
> +      execvp (argv[0], argv);
> +
> +      /* If the exec fails, warn the user and then try without a
> +      clean slate.  */
> +      perror (argv[0]);
> +    }
> +# undef ADD_NO_RANDOMIZE
> +#endif
> +
> +
>  #ifdef G_SLICE_ALWAYS_MALLOC
>    /* This is used by the Cygwin build.  It's not needed starting with
>       cygwin-1.7.24, but it doesn't do any harm.  */
>

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4

Reply via email to