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 | 558b3363a795b59e2b596d7d83e05953de270e60 (patch) | |
| tree | 1f6893f9d5ab736e07835aabbd97f56c755b39d2 /compiler-rt | |
| parent | 27f333d3ad9c2c3d276c854cc60b45eada4d1494 (diff) | |
| download | bcm5719-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.cc | 4 |
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(); } |

