From: Paul Eggert Date: Wed, 17 May 2017 17:58:11 +0000 (-0700) Subject: Work around AddressSanitizer bug with vfork X-Git-Tag: emacs-26.0.90~521^2~379 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=709259dcc501ef991991a35a6ffb2aef02a62c60;p=emacs.git 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. --- diff --git a/src/conf_post.h b/src/conf_post.h index 4fc0428df5a..1462bd16c75 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