[PATCH] D17263: [compiler-rt][msan] Ensure initialisation before calling __msan_unpoison

Jonas Hahnfeld via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 15 03:41:51 PST 2016


Hahnfeld created this revision.
Hahnfeld added reviewers: eugenis, samsonov, kcc.
Hahnfeld added a subscriber: llvm-commits.

`__msan_unpoison` uses intercepted `memset` which currently leads to a SEGV when linking with `libc++` under CentOS 7.

http://reviews.llvm.org/D17263

Files:
  lib/msan/msan_interceptors.cc

Index: lib/msan/msan_interceptors.cc
===================================================================
--- lib/msan/msan_interceptors.cc
+++ lib/msan/msan_interceptors.cc
@@ -1408,12 +1408,12 @@
   __msan_unpoison(ptr, size)
 #define COMMON_INTERCEPTOR_ENTER(ctx, func, ...)                  \
   if (msan_init_is_running) return REAL(func)(__VA_ARGS__);       \
+  ENSURE_MSAN_INITED();                                           \
   MSanInterceptorContext msan_ctx = {IsInInterceptorScope()};     \
   ctx = (void *)&msan_ctx;                                        \
   (void)ctx;                                                      \
   InterceptorScope interceptor_scope;                             \
-  __msan_unpoison(__errno_location(), sizeof(int)); /* NOLINT */  \
-  ENSURE_MSAN_INITED();
+  __msan_unpoison(__errno_location(), sizeof(int)); /* NOLINT */
 #define COMMON_INTERCEPTOR_DIR_ACQUIRE(ctx, path) \
   do {                                            \
   } while (false)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17263.47974.patch
Type: text/x-patch
Size: 995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160215/6c20d47e/attachment.bin>


More information about the llvm-commits mailing list