Your message dated Mon, 05 Sep 2016 22:20:51 +0000
with message-id <e1bh2g3-0006mx...@franck.debian.org>
and subject line Bug#833727: fixed in emacs24 24.5+1-7
has caused the Debian Bug report #833727,
regarding emacs24: FTBFS with glibc 2.24
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
833727: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833727
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: emacs24
Version: 24.5+1-6+b2
Severity: important
Tags: patch upstream

Dear Maintainer,

glibc 2.24 has removed the possibility to add malloc hooks, as they have
been deprecated for more that 5 years. When emacs is built against this
glibc will switch to its internal malloc implementation. Unfortunately
it hasn't been widely tested and is currently broken in the following
ways:
- When src/gmalloc.c is compiled with gcc-5 or gcc-6, it leads to
  infinite recursion.
- On 64-bit systems with aggressive ASLR (such as ppc64), the emacs
  internal malloc needs a lot of memory (typically 12 GiB).

Both issues have already been fixed upstream. You will find attached
the corresponding patches backported for 2.24. Note that while the
malloc hooks support have been removed from the public interfaces, they
are still available in the library. Therefore existing binaries will
keep working.

Also note that the emacs-25 already contains both fixes.

Could you please do an upload with the two attached patches? glibc 2.24
is already available in experimental and will plan to upload it to sid
in the next days/weeks.

Thanks,
Aurelien


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages emacs24 depends on:
ii  emacs24-bin-common     24.5+1-6+b2
ii  gconf-service          3.2.6-3
ii  libacl1                2.2.52-3
ii  libasound2             1.1.1-2
ii  libatk1.0-0            2.20.0-1
ii  libc6                  2.24-0experimental0
ii  libcairo-gobject2      1.14.6-1+b1
ii  libcairo2              1.14.6-1+b1
ii  libdbus-1-3            1.10.8-1
ii  libfontconfig1         2.11.0-6.4
ii  libfreetype6           2.6.3-3+b1
ii  libgconf-2-4           3.2.6-3
ii  libgdk-pixbuf2.0-0     2.34.0-1
ii  libgif7                5.1.4-0.3
ii  libglib2.0-0           2.48.1-2
ii  libgnutls30            3.5.2-2
ii  libgomp1               6.1.1-10
ii  libgpm2                1.20.4-6.2
ii  libgtk-3-0             3.20.6-2
ii  libice6                2:1.0.9-1+b1
ii  libjpeg62-turbo        1:1.5.0-1
ii  libm17n-0              1.7.0-3+b1
ii  libmagickcore-6.q16-2  8:6.8.9.9-7.2
ii  libmagickwand-6.q16-2  8:6.8.9.9-7.2
ii  libotf0                0.9.13-3
ii  libpango-1.0-0         1.40.1-1
ii  libpangocairo-1.0-0    1.40.1-1
ii  libpng16-16            1.6.23-1
ii  librsvg2-2             2.40.16-1
ii  libselinux1            2.5-3
ii  libsm6                 2:1.2.2-1+b1
ii  libtiff5               4.0.6-2
ii  libtinfo5              6.0+20160625-1
ii  libx11-6               2:1.6.3-1
ii  libxft2                2.3.2-1
ii  libxinerama1           2:1.1.3-1+b1
ii  libxml2                2.9.4+dfsg1-1
ii  libxpm4                1:3.5.11-1+b1
ii  libxrandr2             2:1.5.0-1
ii  libxrender1            1:0.9.9-2
ii  zlib1g                 1:1.2.8.dfsg-2+b1

emacs24 recommends no packages.

Versions of packages emacs24 suggests:
pn  emacs24-common-non-dfsg  <none>

-- no debconf information
>From 4b1436b702d56eedd27a0777fc7232cdfb7ac4f6 Mon Sep 17 00:00:00 2001
From: Wolfgang Jenkner <wjenk...@inode.at>
Date: Sat, 26 Dec 2015 12:12:02 -0800
Subject: [PATCH] Always define gmalloc etc. in src/gmalloc.c

This is a work-around to prevent the compiler from using semantic
knowledge about malloc for optimization purposes.  E.g., gcc 5.2
with -O2 replaces most of calloc's definition by a call to calloc;
see Bug#22085.
* src/gmalloc.c [!HYBRID_MALLOC] (malloc, realloc, calloc)
(aligned_alloc, free): Do not undef.  Instead, define these as
functions (perhaps renamed to gmalloc etc.) in terms of gmalloc etc.
---
 src/gmalloc.c | 36 +++++++++++++++++++++++++++++++++---
 1 file changed, 33 insertions(+), 3 deletions(-)

diff --git a/src/gmalloc.c b/src/gmalloc.c
index a88f4ab..90a52a1 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -49,6 +49,17 @@ extern "C"
 
 #include <stddef.h>
 
+#undef malloc
+#undef realloc
+#undef calloc
+#undef aligned_alloc
+#undef free
+#define malloc gmalloc
+#define realloc grealloc
+#define calloc gcalloc
+#define aligned_alloc galigned_alloc
+#define free gfree
+#define malloc_info gmalloc_info
 
 /* Allocate SIZE bytes of memory.  */
 extern void *malloc (size_t size);
@@ -1747,6 +1758,42 @@ valloc (size_t size)
   return aligned_alloc (pagesize, size);
 }
 
+#undef malloc
+#undef realloc
+#undef calloc
+#undef aligned_alloc
+#undef free
+
+void *
+malloc (size_t size)
+{
+  return gmalloc (size);
+}
+
+void *
+calloc (size_t nmemb, size_t size)
+{
+  return gcalloc (nmemb, size);
+}
+
+void
+free (void *ptr)
+{
+  gfree (ptr);
+}
+
+void *
+aligned_alloc (size_t alignment, size_t size)
+{
+  return galigned_alloc (alignment, size);
+}
+
+void *
+realloc (void *ptr, size_t size)
+{
+  return grealloc (ptr, size);
+}
+
 #ifdef GC_MCHECK
 
 /* Standard debugging hooks for `malloc'.
-- 
2.8.1

>From e95b023163e96538b15f030b7176b7ec59cf86f5 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Fri, 15 Jul 2016 13:07:09 +0200
Subject: [PATCH] Port to glibc 2.24 (pre-release) + ppc64

Inspired by a suggestion by Florian Weimer in:
https://sourceware.org/ml/libc-alpha/2016-07/msg00425.html
* configure.ac (HAVE_PERSONALITY_ADDR_NO_RANDOMIZE):
Rename from HAVE_PERSONALITY_LINUX32, and check for
ADDR_NO_RANDOMIZE (the crucial thing) instead of for LINUX32.
All uses changed.
* src/emacs.c (main) [HAVE_PERSONALITY_ADDR_NO_RANDOMIZE]:
Use ADDR_NO_RANDOMIZE from personality.h rather than inventing the
flag ourselves.  Just set that flag, rather than also setting the
persona.  When doing it, avoid functions like putenv that may
allocate memory.
---
 admin/CPP-DEFINES |  2 +-
 configure.ac      | 20 +++++++++++---------
 src/emacs.c       | 30 ++++++++++++++----------------
 3 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES
index c7ec8ce..5e6146b 100644
--- a/admin/CPP-DEFINES
+++ b/admin/CPP-DEFINES
@@ -244,7 +244,7 @@ HAVE_NET_IF_DL_H
 HAVE_NET_IF_H
 HAVE_NLIST_H
 HAVE_OTF_GET_VARIATION_GLYPHS
-HAVE_PERSONALITY_LINUX32
+HAVE_PERSONALITY_ADDR_NO_RANDOMIZE
 HAVE_PNG
 HAVE_PNG_H
 HAVE_POSIX_MEMALIGN
diff --git a/configure.ac b/configure.ac
index dd1af5b..c94ecb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1478,15 +1478,17 @@ AC_CHECK_HEADERS_ONCE(
   sys/resource.h
   sys/utsname.h pwd.h utmp.h util.h)
 
-AC_MSG_CHECKING(if personality LINUX32 can be set)
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/personality.h>]], [[personality (PER_LINUX32)]])],
-               emacs_cv_personality_linux32=yes,
-	       emacs_cv_personality_linux32=no)
-AC_MSG_RESULT($emacs_cv_personality_linux32)
-
-if test $emacs_cv_personality_linux32 = yes; then
-  AC_DEFINE(HAVE_PERSONALITY_LINUX32, 1,
-            [Define to 1 if personality LINUX32 can be set.])
+AC_CACHE_CHECK([for ADDR_NO_RANDOMIZE],
+  [emacs_cv_personality_addr_no_randomize],
+  [AC_COMPILE_IFELSE(
+     [AC_LANG_PROGRAM([[#include <sys/personality.h>]],
+		      [[personality (personality (0xffffffff)
+				     | ADDR_NO_RANDOMIZE)]])],
+     [emacs_cv_personality_addr_no_randomize=yes],
+     [emacs_cv_personality_addr_no_randomize=no])])
+if test $emacs_cv_personality_addr_no_randomize = yes; then
+  AC_DEFINE([HAVE_PERSONALITY_ADDR_NO_RANDOMIZE], [1],
+            [Define to 1 if personality flag ADDR_NO_RANDOMIZE exists.])
 fi
 
 dnl On Solaris 8 there's a compilation warning for term.h because
diff --git a/src/emacs.c b/src/emacs.c
index bb85733..b221984 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -99,7 +99,7 @@ extern void moncontrol (int mode);
 #include <sys/resource.h>
 #endif
 
-#ifdef HAVE_PERSONALITY_LINUX32
+#ifdef HAVE_PERSONALITY_ADDR_NO_RANDOMIZE
 #include <sys/personality.h>
 #endif
 
@@ -833,24 +833,22 @@ main (int argc, char **argv)
   dumping = !initialized && (strcmp (argv[argc - 1], "dump") == 0
 			     || strcmp (argv[argc - 1], "bootstrap") == 0);
 
-#ifdef HAVE_PERSONALITY_LINUX32
-  if (dumping && ! getenv ("EMACS_HEAP_EXEC"))
+#ifdef HAVE_PERSONALITY_ADDR_NO_RANDOMIZE
+  if (dumping)
     {
-      /* Set this so we only do this once.  */
-      xputenv ("EMACS_HEAP_EXEC=true");
-
-      /* A flag to turn off address randomization which is introduced
-         in linux kernel shipped with fedora core 4 */
-#define ADD_NO_RANDOMIZE 0x0040000
-      personality (PER_LINUX32 | ADD_NO_RANDOMIZE);
-#undef  ADD_NO_RANDOMIZE
-
-      execvp (argv[0], argv);
+      int pers = personality (0xffffffff);
+      if (! (pers & ADDR_NO_RANDOMIZE)
+	  && 0 <= personality (pers | ADDR_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, try to dump anyway.  */
-      emacs_perror (argv[0]);
+	  /* If the exec fails, warn and then try without a clean slate.  */
+	  perror (argv[0]);
+	}
     }
-#endif /* HAVE_PERSONALITY_LINUX32 */
+#endif
 
 #if defined (HAVE_SETRLIMIT) && defined (RLIMIT_STACK)
   /* Extend the stack space available.
-- 
2.8.1


--- End Message ---
--- Begin Message ---
Source: emacs24
Source-Version: 24.5+1-7

We believe that the bug you reported is fixed in the latest version of
emacs24, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 833...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Rob Browning <r...@defaultvalue.org> (supplier of updated emacs24 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Mon, 05 Sep 2016 15:05:00 -0500
Source: emacs24
Binary: emacs24-lucid emacs24-lucid-dbg emacs24-nox emacs24-nox-dbg emacs24 
emacs24-dbg emacs24-bin-common emacs24-common emacs24-el
Architecture: source amd64 all
Version: 24.5+1-7
Distribution: unstable
Urgency: medium
Maintainer: Rob Browning <r...@defaultvalue.org>
Changed-By: Rob Browning <r...@defaultvalue.org>
Description:
 emacs24    - GNU Emacs editor (with GTK+ GUI support)
 emacs24-bin-common - GNU Emacs editor's shared, architecture dependent files
 emacs24-common - GNU Emacs editor's shared, architecture independent 
infrastructur
 emacs24-dbg - Debugging symbols for emacs24
 emacs24-el - GNU Emacs LISP (.el) files
 emacs24-lucid - GNU Emacs editor (with Lucid GUI support)
 emacs24-lucid-dbg - Debugging symbols for emacs24-lucid
 emacs24-nox - GNU Emacs editor (without GUI support)
 emacs24-nox-dbg - Debugging symbols for emacs24-nox
Closes: 828000 833215 833727
Changes:
 emacs24 (24.5+1-7) unstable; urgency=medium
 .
   * debian/control: make Source-Version source:Version.  Thanks to
     Guillem Jover for reporting the problem. (Closes: 833215)
 .
   * Restore GTK+ toolbar icons.
     Add 0020-Emacs-should-show-GTK-icons-again.patch to include the relevant
     upstream code.  Thanks to Juerg Haefliger for reporting the problem and
     pointing out the relevant upstream commit. (Closes: 828000)
 .
   * Fix malloc handling with newer gcc (>= 5.2).
     Add 0021-Emacs-should-work-with-gcc-5.2-and-newer.patch to incorporate
     the relevant upstream code.  Thanks to Aurelien Jarno for reporting the
     problem and backporting the fix.
 .
   * Support glibc 2.24.
     Add 0022-Emacs-should-work-with-glibc-2.24-on-ppc64.patch to incorporate
     the relevant upstream code. Thanks to Aurelien Jarno for reporting the
     problem and backporting the fix. (Closes: 833727)
Checksums-Sha1:
 72f203516d018529ea00702f105f9a787a90ccf8 2705 emacs24_24.5+1-7.dsc
 70cb6a01a58848b86ce9e33bfd6e62ff44cfe3cb 72184 emacs24_24.5+1-7.debian.tar.xz
 ef27a916ae618ae0bb43b46bb623232e304fa1a6 259240 
emacs24-bin-common-dbgsym_24.5+1-7_amd64.deb
 12f676cee32fec1113328ee0347ff9d213039be8 256934 
emacs24-bin-common_24.5+1-7_amd64.deb
 bc4882973a02dd45eb1be356ed818f234706f6ee 12870564 
emacs24-common_24.5+1-7_all.deb
 6e56f73f3456f6c3dfee2de07ce52938a5e3bda0 4923574 emacs24-dbg_24.5+1-7_amd64.deb
 0b5b9cbd2b6f03d38c4c4e60eb9e2371fe1a2bb1 15440048 emacs24-el_24.5+1-7_all.deb
 f9cc586cc9370ad19cf5f7851e1657980d69115b 4974720 
emacs24-lucid-dbg_24.5+1-7_amd64.deb
 90a31fe83190d8f461603dcb218f7dad1db675f6 3566118 
emacs24-lucid_24.5+1-7_amd64.deb
 33651d13f92939b7256d5c72e7872a881aa62b5d 3617560 
emacs24-nox-dbg_24.5+1-7_amd64.deb
 1a888f374f642f5494b2c6f76595748ea01e830c 3183164 emacs24-nox_24.5+1-7_amd64.deb
 dfc550cae2788f89d2323faf8b96246af860fd77 3559754 emacs24_24.5+1-7_amd64.deb
Checksums-Sha256:
 924744291de0d758fc614de434b61fb4973c336e7da653d9e7e1c58346a747fd 2705 
emacs24_24.5+1-7.dsc
 e2008f4167c6eff12cf50aa753e2006f56fe6230effc6d90ee78a5d44c7ed24a 72184 
emacs24_24.5+1-7.debian.tar.xz
 8483bd6bb0f2844dabd79facda1948ec326e963e04f1c1390700773dd5bffd99 259240 
emacs24-bin-common-dbgsym_24.5+1-7_amd64.deb
 692200a2f3bd38ab317b45ecc563236e98790c21341a921f00fc5e8b5d9e5be7 256934 
emacs24-bin-common_24.5+1-7_amd64.deb
 b660426496d475dcf7d76ef9de930e9bdd01dca67cd8585057409700c53fa3da 12870564 
emacs24-common_24.5+1-7_all.deb
 229403d1e86a9ced8206b1e94e5acc15ca690a40b5b881bd9298eb94ffc0d5b3 4923574 
emacs24-dbg_24.5+1-7_amd64.deb
 0c1e79c63eb6435d5274803a7e30fc6018e2272256215cd7921c0aff2adb8c57 15440048 
emacs24-el_24.5+1-7_all.deb
 ef1dc9471623da8d249ba9a22520334aebd2e213a23051cfdf71a946536b0b4b 4974720 
emacs24-lucid-dbg_24.5+1-7_amd64.deb
 8801d2c0b73e0ddf56b210f9a1c048749233e5071e76dbeed44075381f572cec 3566118 
emacs24-lucid_24.5+1-7_amd64.deb
 855045742dbcffbc0fa2b2334786441c4784e1d1bde53d72569a3faa44a2ee7d 3617560 
emacs24-nox-dbg_24.5+1-7_amd64.deb
 f174380b87484f41b71a7ca7c25e74b2329b7cd7ba35cbb1f49f0782be8bef3f 3183164 
emacs24-nox_24.5+1-7_amd64.deb
 01253d50456377c7306321b4e78a9860137beacad98d477ecd8353af270c609d 3559754 
emacs24_24.5+1-7_amd64.deb
Files:
 b341a948ab43d08168d1e53f32ae171a 2705 editors optional emacs24_24.5+1-7.dsc
 bea723087c9ee6b2bf5c9760f37bedf5 72184 editors optional 
emacs24_24.5+1-7.debian.tar.xz
 12470aa3532696b2f2c9c17639be7c1c 259240 debug extra 
emacs24-bin-common-dbgsym_24.5+1-7_amd64.deb
 c6b7162339fc770b87e14fb4f007fa33 256934 editors optional 
emacs24-bin-common_24.5+1-7_amd64.deb
 26d8ab2956c6b5123f134b1589eca8c6 12870564 editors optional 
emacs24-common_24.5+1-7_all.deb
 2cf1cf1283ee23ad28b64d3cbb9fa2b9 4923574 debug extra 
emacs24-dbg_24.5+1-7_amd64.deb
 e7ddf4a442cfe318d55e8e8c7614cc8d 15440048 editors optional 
emacs24-el_24.5+1-7_all.deb
 af2d3b76158a61ec59c562f86c362f92 4974720 debug extra 
emacs24-lucid-dbg_24.5+1-7_amd64.deb
 2c190f5869f6516e3b79cc113a586347 3566118 editors optional 
emacs24-lucid_24.5+1-7_amd64.deb
 7e552a5c08c1acd9a73ba23880554091 3617560 debug extra 
emacs24-nox-dbg_24.5+1-7_amd64.deb
 617cebc7098cb4adceebcf1677256edc 3183164 editors optional 
emacs24-nox_24.5+1-7_amd64.deb
 b48304253edb96428a3d7425ddf1915e 3559754 editors optional 
emacs24_24.5+1-7_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJXzei9AAoJEO7xFsVaWkLxN6EP/iiXDDNsx3BnDMxPIYLQVDbv
j212aoZ6WqK7yNi5VpK+pnaB9NwheVL/JB7TmKjwMoYKA+1ZypZqXR575QGQrb4e
eyIGHOt33f2xXimcf1B/yDiALgbTIG5wqYPcmDGca8v4B2/FUXSGyt+bH2m2yMLt
WJcmN3YJ3SWiDUJpC3cBCbWx4weo62hcgsb+ihvFK8o3UmkikTxvdNrcAT90uxwd
oCEBk5nVNHJCB9RC5G6rOU5BW31Xprx8/FHlMVjzsHAAYoRm209Kg4dehl7L7WRH
Om02dDlTV1pelUmMuSm+JqgcNkHzT+3edRtNeuiPyzuQ1yd+QkhonqHAZQdD+UZT
5ltwc/fZQ/+Mv8ctf+V+Ll1rAHPwAWY6aQnxFuiN4zQXLlXoW94PG3BBPSdixfuE
3QZGtGRFY9kHpviNIsSvwKKqYTszIf0hzSnjqB0FB9kK8LeWW6piRT66yn9DG1TT
WohzdpTEHIaccgYaunzQlpO0p0mbM/uLP3tvpZh+x/3RpwbkbqC/v0BwnSBsa0Gy
uzW1KWsulc9pVmdx9lPJZXa+NOrO0uTBupn+RwJEjfu1FCLp7D1T5b/W1acv3uIJ
0zEWRC/HlOhgy8OXA3wpfVo2NPRu14wzDxtawQL8ajNEUFDd9mKLPL/kxqnIh3BO
/4wIeMp1D5Q0fMV+2S7M
=Li0N
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to