summaryrefslogtreecommitdiff
path: root/lib/asan/asan_rtl.cc
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-10-12 22:33:57 +0000
committerReid Kleckner <rnk@google.com>2016-10-12 22:33:57 +0000
commitd3c013b9deae818346f31918f8c61d7cbb97a4d3 (patch)
tree194f5de4b3cc3f1e66748c424cf93a1120eced2d /lib/asan/asan_rtl.cc
parent25a8f31ff3fb0c0802d27ed865be7b7747539458 (diff)
Make __asan_handle_no_return a no-op during initialization
Some of our existing tests hang on the new Windows bot with this stack: 770, clang_rt.asan_dynamic-i386.dll!__asan::AsanTSDGet+0x3e 771, clang_rt.asan_dynamic-i386.dll!__asan::GetCurrentThread+0x9 772, clang_rt.asan_dynamic-i386.dll!__asan_handle_no_return+0xe 773, clang_rt.asan_dynamic-i386.dll!__asan_wrap__except_handler4_common+0x12 774, ntdll.dll!wcstombs+0xb0 (No unwind info) 775, ntdll.dll!ZwWow64CallFunction64+0x2001 (No unwind info) 776, ntdll.dll!ZwWow64CallFunction64+0x1fd3 (No unwind info) 777, ntdll.dll!KiUserExceptionDispatcher+0xf (No unwind info) 778, clang_rt.asan_dynamic-i386.dll!destroy_fls+0x13 779, ntdll.dll!RtlLockHeap+0xea (No unwind info) 780, ntdll.dll!LdrShutdownProcess+0x7f (No unwind info) 781, ntdll.dll!RtlExitUserProcess+0x81 (No unwind info) 782, kernel32.dll!ExitProcess+0x13 (No unwind info) 783, clang_rt.asan_dynamic-i386.dll!__sanitizer::internal__exit+0xc 784, clang_rt.asan_dynamic-i386.dll!__sanitizer::Die+0x3d 785, clang_rt.asan_dynamic-i386.dll!__asan::AsanInitInternal+0x50b 786, clang_rt.asan_dynamic-i386.dll!__asan::Allocator::Allocate+0x1c 787, clang_rt.asan_dynamic-i386.dll!__asan::Allocator::Calloc+0x43 We hang because AsanDie tries to defend against multi-threaded death by infinite looping if someone is already exiting. We might want to reconsider that, but one easy way to avoid getting here is not to let our noreturn interceptors call back into fragile parts of ASan. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@284067 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_rtl.cc')
-rw-r--r--lib/asan/asan_rtl.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/asan/asan_rtl.cc b/lib/asan/asan_rtl.cc
index 97ce9f84f..8925f24d3 100644
--- a/lib/asan/asan_rtl.cc
+++ b/lib/asan/asan_rtl.cc
@@ -637,6 +637,9 @@ static AsanInitializer asan_initializer;
using namespace __asan; // NOLINT
void NOINLINE __asan_handle_no_return() {
+ if (asan_init_is_running)
+ return;
+
int local_stack;
AsanThread *curr_thread = GetCurrentThread();
uptr PageSize = GetPageSizeCached();