[llvm-commits] [compiler-rt] r148476 - /compiler-rt/trunk/lib/asan/asan_thread_registry.cc

Evgeniy Stepanov eugeni.stepanov at gmail.com
Thu Jan 19 06:04:57 PST 2012


No, I did not hit this issue in practice. Just a precaution.

On Thu, Jan 19, 2012 at 5:57 PM, Evgeniy Stepanov
<eugeni.stepanov at gmail.com> wrote:
> 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)) {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list