[PATCH] D14710: [tsan] Skip malloc/free interceptors when we're inside symbolizer on OS X

Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 06:53:23 PST 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL253460: [tsan] Skip malloc/free interceptors when we're inside symbolizer on OS X (authored by kuba.brecka).

Changed prior to commit:
  http://reviews.llvm.org/D14710?vs=40302&id=40504#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D14710

Files:
  compiler-rt/trunk/lib/tsan/rtl/tsan_malloc_mac.cc

Index: compiler-rt/trunk/lib/tsan/rtl/tsan_malloc_mac.cc
===================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_malloc_mac.cc
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_malloc_mac.cc
@@ -28,20 +28,30 @@
   void *p =                                     \
       user_alloc(cur_thread(), StackTrace::GetCurrentPc(), size, alignment)
 #define COMMON_MALLOC_MALLOC(size)      \
+  if (cur_thread()->in_symbolizer)      \
+    return REAL(malloc)(size);          \
   SCOPED_INTERCEPTOR_RAW(malloc, size); \
   void *p = user_alloc(thr, pc, size)
-#define COMMON_MALLOC_REALLOC(ptr, size) \
+#define COMMON_MALLOC_REALLOC(ptr, size)      \
+  if (cur_thread()->in_symbolizer)            \
+    return REAL(realloc)(ptr, size);          \
   SCOPED_INTERCEPTOR_RAW(realloc, ptr, size); \
-  void *p = user_realloc(thr, pc, ptr, size);
-#define COMMON_MALLOC_CALLOC(count, size) \
+  void *p = user_realloc(thr, pc, ptr, size)
+#define COMMON_MALLOC_CALLOC(count, size)      \
+  if (cur_thread()->in_symbolizer)             \
+    return REAL(calloc)(count, size);          \
   SCOPED_INTERCEPTOR_RAW(calloc, size, count); \
-  void *p = user_calloc(thr, pc, size, count);
-#define COMMON_MALLOC_VALLOC(size) \
-  SCOPED_INTERCEPTOR_RAW(valloc, size); \
-  void *p = user_alloc(thr, pc, size, GetPageSizeCached());
-#define COMMON_MALLOC_FREE(ptr) \
+  void *p = user_calloc(thr, pc, size, count)
+#define COMMON_MALLOC_VALLOC(size)                          \
+  if (cur_thread()->in_symbolizer)                          \
+    return REAL(valloc)(size);                              \
+  SCOPED_INTERCEPTOR_RAW(valloc, size);                     \
+  void *p = user_alloc(thr, pc, size, GetPageSizeCached())
+#define COMMON_MALLOC_FREE(ptr)      \
+  if (cur_thread()->in_symbolizer)   \
+    return REAL(free)(ptr);          \
   SCOPED_INTERCEPTOR_RAW(free, ptr); \
-  user_free(thr, pc, ptr);
+  user_free(thr, pc, ptr)
 #define COMMON_MALLOC_SIZE(ptr) \
   uptr size = user_alloc_usable_size(ptr);
 #define COMMON_MALLOC_FILL_STATS(zone, stats)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14710.40504.patch
Type: text/x-patch
Size: 2095 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151118/3fd3a82d/attachment.bin>


More information about the llvm-commits mailing list