[llvm-commits] [compiler-rt] r148476 - /compiler-rt/trunk/lib/asan/asan_thread_registry.cc
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Thu Jan 19 05:57:45 PST 2012
Author: eugenis
Date: Thu Jan 19 07:57:45 2012
New Revision: 148476
URL: http://llvm.org/viewvc/llvm-project?rev=148476&view=rev
Log:
Make the Android TSD workaround more reliable.
By scanning the thread list backwards.
Modified:
compiler-rt/trunk/lib/asan/asan_thread_registry.cc
Modified: compiler-rt/trunk/lib/asan/asan_thread_registry.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_thread_registry.cc?rev=148476&r1=148475&r2=148476&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_thread_registry.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_thread_registry.cc Thu Jan 19 07:57:45 2012
@@ -136,7 +136,10 @@
AsanThread *AsanThreadRegistry::FindThreadByStackAddress(uintptr_t addr) {
ScopedLock lock(&mu_);
- for (int tid = 0; tid < n_threads_; tid++) {
+ // Main thread (tid = 0) stack limits are pretty much guessed; for the other
+ // threads we ask libpthread, so their limits must be correct.
+ // Scanning the thread list backwards makes this function more reliable.
+ for (int tid = n_threads_ - 1; tid >= 0; tid--) {
AsanThread *t = thread_summaries_[tid]->thread();
if (!t) continue;
if (t->fake_stack().AddrIsInFakeStack(addr) || t->AddrIsInStack(addr)) {
More information about the llvm-commits
mailing list