summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2018-09-28 14:41:25 +0000
committerHans Wennborg <hans@hanshq.net>2018-09-28 14:41:25 +0000
commit83cd9b32dd90d4926ef12a4008a96c5dc19f91b8 (patch)
tree995f8996e94f1b69bc8db759e22566871958c391
parent428c1196d8a163cfb42133cf404751534ba44e2d (diff)
downloadbcm5719-llvm-83cd9b32dd90d4926ef12a4008a96c5dc19f91b8.tar.gz
bcm5719-llvm-83cd9b32dd90d4926ef12a4008a96c5dc19f91b8.zip
Revert r342652 "[winasan] Unpoison the stack in NtTerminateThread"
This seems to cause the thread's exit code to be clobbered, breaking Chromium tests. Also revert follow-up r342654. > In long-running builds we've seen some ASan complaints during thread creation that we suspect are due to leftover poisoning from previous threads whose stacks occupied that memory. This patch adds a hook that unpoisons the stack just before the NtTerminateThread syscall. > > Differential Revision: https://reviews.llvm.org/D52091 llvm-svn: 343322
-rw-r--r--compiler-rt/lib/asan/asan_win.cc12
-rw-r--r--compiler-rt/test/asan/TestCases/Windows/dll_host.cc1
2 files changed, 1 insertions, 12 deletions
diff --git a/compiler-rt/lib/asan/asan_win.cc b/compiler-rt/lib/asan/asan_win.cc
index c8af8c92068..5661d911cab 100644
--- a/compiler-rt/lib/asan/asan_win.cc
+++ b/compiler-rt/lib/asan/asan_win.cc
@@ -154,14 +154,6 @@ INTERCEPTOR_WINAPI(DWORD, CreateThread,
asan_thread_start, t, thr_flags, tid);
}
-INTERCEPTOR_WINAPI(void, NtTerminateThread, void *rcx) {
- // Unpoison the terminating thread's stack because the memory may be re-used.
- NT_TIB *tib = (NT_TIB *)NtCurrentTeb();
- uptr stackSize = (uptr)tib->StackBase - (uptr)tib->StackLimit;
- __asan_unpoison_memory_region(tib->StackLimit, stackSize);
- return REAL(NtTerminateThread(rcx));
-}
-
// }}}
namespace __asan {
@@ -177,9 +169,7 @@ void InitializePlatformInterceptors() {
ASAN_INTERCEPT_FUNC(CreateThread);
ASAN_INTERCEPT_FUNC(SetUnhandledExceptionFilter);
- CHECK(::__interception::OverrideFunction("NtTerminateThread",
- (uptr)WRAP(NtTerminateThread),
- (uptr *)&REAL(NtTerminateThread)));
+
#ifdef _WIN64
ASAN_INTERCEPT_FUNC(__C_specific_handler);
#else
diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_host.cc b/compiler-rt/test/asan/TestCases/Windows/dll_host.cc
index 324bd586d33..512f930bc34 100644
--- a/compiler-rt/test/asan/TestCases/Windows/dll_host.cc
+++ b/compiler-rt/test/asan/TestCases/Windows/dll_host.cc
@@ -29,7 +29,6 @@
// IMPORT: __asan_wrap_HeapReAlloc
// IMPORT: __asan_wrap_HeapSize
// IMPORT: __asan_wrap_CreateThread
-// IMPORT: __asan_wrap_NtTerminateThread
// IMPORT: __asan_wrap_RaiseException
// IMPORT: __asan_wrap_RtlRaiseException
// IMPORT: __asan_wrap_SetUnhandledExceptionFilter
OpenPOWER on IntegriCloud