diff options
author | Kostya Serebryany <kcc@google.com> | 2014-06-06 07:35:35 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2014-06-06 07:35:35 +0000 |
commit | 496ca25b928ad50620c2be3440902a611721d6af (patch) | |
tree | fdeded30b7149b675be9c6acb106535e02a944fc /lib/asan/asan_thread.cc | |
parent | 99116e544d39c0692f5a3d3494bb6788950a4ee9 (diff) |
[asan] initialize fake_stack_ to 0 before we call SetThreadStackAndTls, because that may actually try to use fake_stack_ (still don't know how). Yet another case where we desperately want https://sourceware.org/glibc/wiki/ThreadPropertiesAPI
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@210315 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_thread.cc')
-rw-r--r-- | lib/asan/asan_thread.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/asan/asan_thread.cc b/lib/asan/asan_thread.cc index 1d45573b8..48ff4011d 100644 --- a/lib/asan/asan_thread.cc +++ b/lib/asan/asan_thread.cc @@ -141,7 +141,10 @@ FakeStack *AsanThread::AsyncSignalSafeLazyInitFakeStack() { } void AsanThread::Init() { + fake_stack_ = 0; // Will be initialized lazily if needed. + CHECK_EQ(this->stack_size(), 0U); SetThreadStackAndTls(); + CHECK_GT(this->stack_size(), 0U); CHECK(AddrIsInMem(stack_bottom_)); CHECK(AddrIsInMem(stack_top_ - 1)); ClearShadowForThreadStackAndTLS(); @@ -149,7 +152,6 @@ void AsanThread::Init() { VReport(1, "T%d: stack [%p,%p) size 0x%zx; local=%p\n", tid(), (void *)stack_bottom_, (void *)stack_top_, stack_top_ - stack_bottom_, &local); - fake_stack_ = 0; // Will be initialized lazily if needed. AsanPlatformThreadInit(); } |