emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 49ba754: Remove AddressSanitizer bug workaround


From: Paul Eggert
Subject: [Emacs-diffs] master 49ba754: Remove AddressSanitizer bug workaround
Date: Sat, 9 Jun 2018 02:54:55 -0400 (EDT)

branch: master
commit 49ba7544c2ebbcfc50ce1e02add6bd739f475c4c
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Remove AddressSanitizer bug workaround
    
    This workaround no longer appears to be needed.
    * src/alloc.c (USE_ALIGNED_ALLOC): Don’t leave undefined
    merely because ADDRESS_SANITIZER is defined, as that bug
    in -fsanitize=address appears to have been fixed.  See:
    https://github.com/google/sanitizers/issues/337
    * src/conf_post.h (vfork): Improve comment.
---
 src/alloc.c     | 9 ++++-----
 src/conf_post.h | 3 ++-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/alloc.c b/src/alloc.c
index 4186347..f600c89 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1146,11 +1146,10 @@ lisp_free (void *block)
 verify (POWER_OF_2 (BLOCK_ALIGN));
 
 /* Use aligned_alloc if it or a simple substitute is available.
-   Address sanitization breaks aligned allocation, as of gcc 4.8.2 and
-   clang 3.3 anyway.  Aligned allocation is incompatible with
-   unexmacosx.c, so don't use it on Darwin.  */
+   Aligned allocation is incompatible with unexmacosx.c, so don't use
+   it on Darwin unless CANNOT_DUMP.  */
 
-#if ! ADDRESS_SANITIZER && !defined DARWIN_OS
+#if !defined DARWIN_OS || defined CANNOT_DUMP
 # if (defined HAVE_ALIGNED_ALLOC                                       \
       || (defined HYBRID_MALLOC                                                
\
          ? defined HAVE_POSIX_MEMALIGN                                 \
@@ -1446,7 +1445,7 @@ laligned (void *p, size_t size)
 static void *
 lmalloc (size_t size)
 {
-#if USE_ALIGNED_ALLOC
+#ifdef USE_ALIGNED_ALLOC
   if (! MALLOC_IS_GC_ALIGNED && size % GCALIGNMENT == 0)
     return aligned_alloc (GCALIGNMENT, size);
 #endif
diff --git a/src/conf_post.h b/src/conf_post.h
index bf2cfc4..30f3b95 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -350,7 +350,8 @@ extern int emacs_setenv_TZ (char const *);
 # define ATTRIBUTE_NO_SANITIZE_UNDEFINED
 #endif
 
-/* gcc -fsanitize=address does not work with vfork in Fedora 25 x86-64.
+/* gcc -fsanitize=address does not work with vfork in Fedora 28 x86-64.  See:
+   https://lists.gnu.org/r/emacs-devel/2017-05/msg00464.html
    For now, assume that this problem occurs on all platforms.  */
 #if ADDRESS_SANITIZER && !defined vfork
 # define vfork fork



reply via email to

[Prev in Thread] Current Thread [Next in Thread]