emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 709259d 3/3: Work around AddressSanitizer bug with


From: Paul Eggert
Subject: [Emacs-diffs] master 709259d 3/3: Work around AddressSanitizer bug with vfork
Date: Wed, 17 May 2017 13:59:09 -0400 (EDT)

branch: master
commit 709259dcc501ef991991a35a6ffb2aef02a62c60
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Work around AddressSanitizer bug with vfork
    
    Problem reported by Jim Meyering in:
    http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00246.html
    * src/conf_post.h (vfork) [ADDRESS_SANITIZER]: Define to fork.
    Unfortunately with the AddressSanitizer in Fedora 25 x86-64, the
    vforked child messes up the parent’s shadow memory.  This is too
    bad, as we’d rather have AddressSanitizer catch memory-access bugs
    related to vfork.
---
 src/conf_post.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/conf_post.h b/src/conf_post.h
index 4fc0428..1462bd1 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -302,6 +302,12 @@ extern int emacs_setenv_TZ (char const *);
 # define ATTRIBUTE_NO_SANITIZE_ADDRESS
 #endif
 
+/* gcc -fsanitize=address does not work with vfork in Fedora 25 x86-64.
+   For now, assume that this problem occurs on all platforms.  */
+#if ADDRESS_SANITIZER && !defined vfork
+# define vfork fork
+#endif
+
 /* Some versions of GNU/Linux define noinline in their headers.  */
 #ifdef noinline
 #undef noinline



reply via email to

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