summaryrefslogtreecommitdiffstats
path: root/compiler-rt
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2014-06-06 07:35:35 +0000
committerKostya Serebryany <kcc@google.com>2014-06-06 07:35:35 +0000
commit558b3363a795b59e2b596d7d83e05953de270e60 (patch)
tree1f6893f9d5ab736e07835aabbd97f56c755b39d2 /compiler-rt
parent27f333d3ad9c2c3d276c854cc60b45eada4d1494 (diff)
downloadbcm5719-llvm-558b3363a795b59e2b596d7d83e05953de270e60.tar.gz
bcm5719-llvm-558b3363a795b59e2b596d7d83e05953de270e60.zip
[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
llvm-svn: 210315
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/lib/asan/asan_thread.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler-rt/lib/asan/asan_thread.cc b/compiler-rt/lib/asan/asan_thread.cc
index 1d45573b8a1..48ff4011d80 100644
--- a/compiler-rt/lib/asan/asan_thread.cc
+++ b/compiler-rt/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();
}
OpenPOWER on IntegriCloud