[PATCH] D14377: [tsan] Allow memmove interceptor to be used when TSan is not initialized
Kuba Brecka via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 5 02:50:49 PST 2015
kubabrecka created this revision.
kubabrecka added reviewers: samsonov, kcc, dvyukov, glider.
kubabrecka added subscribers: llvm-commits, zaks.anna, ismailp, jasonk, jevinskie.
A call to memmove is used early during new thread initialization on OS X. This patch uses the `COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED` check, similarly to how we deal with other early-used interceptors.
http://reviews.llvm.org/D14377
Files:
lib/tsan/rtl/tsan_interceptors.cc
Index: lib/tsan/rtl/tsan_interceptors.cc
===================================================================
--- lib/tsan/rtl/tsan_interceptors.cc
+++ lib/tsan/rtl/tsan_interceptors.cc
@@ -630,9 +630,11 @@
}
TSAN_INTERCEPTOR(void*, memmove, void *dst, void *src, uptr n) {
- SCOPED_TSAN_INTERCEPTOR(memmove, dst, src, n);
- MemoryAccessRange(thr, pc, (uptr)dst, n, true);
- MemoryAccessRange(thr, pc, (uptr)src, n, false);
+ if (!COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) {
+ SCOPED_TSAN_INTERCEPTOR(memmove, dst, src, n);
+ MemoryAccessRange(thr, pc, (uptr)dst, n, true);
+ MemoryAccessRange(thr, pc, (uptr)src, n, false);
+ }
return REAL(memmove)(dst, src, n);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14377.39335.patch
Type: text/x-patch
Size: 690 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151105/60121487/attachment.bin>
More information about the llvm-commits
mailing list