>From 709259dcc501ef991991a35a6ffb2aef02a62c60 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 17 May 2017 10:58:11 -0700 Subject: [PATCH] Work around AddressSanitizer bug with vfork MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 -- 2.9.4