[compiler-rt] 8b1984b - Revert "tsan: fix tls_race3 test on darwin"
Amy Kwan via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 1 14:42:39 PDT 2021
Author: Amy Kwan
Date: 2021-10-01T16:42:31-05:00
New Revision: 8b1984bb8ca497c0d43b882ed997677d14be0a2e
URL: https://github.com/llvm/llvm-project/commit/8b1984bb8ca497c0d43b882ed997677d14be0a2e
DIFF: https://github.com/llvm/llvm-project/commit/8b1984bb8ca497c0d43b882ed997677d14be0a2e.diff
LOG: Revert "tsan: fix tls_race3 test on darwin"
This reverts commit ade5023c54cffcbefe0557b5473d55b06e40809b.
Reverting this commit as it is dependent on a test breaking the PPC BE bots.
Added:
Modified:
compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp b/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp
index 388b3836d7d1..0ca068a2b318 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp
@@ -283,17 +283,13 @@ uptr ExtractLongJmpSp(uptr *env) {
}
#if !SANITIZER_GO
-extern "C" void __tsan_tls_initialization() {}
-
void ImitateTlsWrite(ThreadState *thr, uptr tls_addr, uptr tls_size) {
// The pointer to the ThreadState object is stored in the shadow memory
// of the tls.
uptr tls_end = tls_addr + tls_size;
uptr thread_identity = (uptr)pthread_self();
- const uptr pc = StackTrace::GetNextInstructionPc(
- reinterpret_cast<uptr>(__tsan_tls_initialization));
if (thread_identity == main_thread_identity) {
- MemoryRangeImitateWrite(thr, pc, tls_addr, tls_size);
+ MemoryRangeImitateWrite(thr, /*pc=*/2, tls_addr, tls_size);
} else {
uptr thr_state_start = thread_identity;
uptr thr_state_end = thr_state_start + sizeof(uptr);
@@ -301,8 +297,10 @@ void ImitateTlsWrite(ThreadState *thr, uptr tls_addr, uptr tls_size) {
CHECK_LE(thr_state_start, tls_addr + tls_size);
CHECK_GE(thr_state_end, tls_addr);
CHECK_LE(thr_state_end, tls_addr + tls_size);
- MemoryRangeImitateWrite(thr, pc, tls_addr, thr_state_start - tls_addr);
- MemoryRangeImitateWrite(thr, pc, thr_state_end, tls_end - thr_state_end);
+ MemoryRangeImitateWrite(thr, /*pc=*/2, tls_addr,
+ thr_state_start - tls_addr);
+ MemoryRangeImitateWrite(thr, /*pc=*/2, thr_state_end,
+ tls_end - thr_state_end);
}
}
#endif
More information about the llvm-commits
mailing list