diff --git a/compiler-rt/lib/asan/asan_thread.cpp b/compiler-rt/lib/asan/asan_thread.cpp --- a/compiler-rt/lib/asan/asan_thread.cpp +++ b/compiler-rt/lib/asan/asan_thread.cpp @@ -507,6 +507,14 @@ void GetAllThreadAllocatorCachesLocked(InternalMmapVector *caches) {} +void ForEachExtraThreadStackRange(RangeIteratorCallback callback, void *arg) { + GetAsanThreadRegistryLocked()->RunCallbackForEachThreadLocked( + [](ThreadContextBase *tctx, void *arg) { + ForEachExtraStackRange(tctx->os_id, ForEachExtraStackRangeCb, arg); + }, + arg); +} + void ForEachExtraStackRange(tid_t os_id, RangeIteratorCallback callback, void *arg) { __asan::AsanThread *t = __asan::GetAsanThreadByOsIDLocked(os_id); diff --git a/compiler-rt/lib/hwasan/hwasan_thread.cpp b/compiler-rt/lib/hwasan/hwasan_thread.cpp --- a/compiler-rt/lib/hwasan/hwasan_thread.cpp +++ b/compiler-rt/lib/hwasan/hwasan_thread.cpp @@ -194,6 +194,7 @@ void GetAllThreadAllocatorCachesLocked(InternalMmapVector *caches) {} +void ForEachExtraThreadStackRange(RangeIteratorCallback callback, void *arg) {} void ForEachExtraStackRange(tid_t os_id, RangeIteratorCallback callback, void *arg) {} diff --git a/compiler-rt/lib/lsan/lsan_common.h b/compiler-rt/lib/lsan/lsan_common.h --- a/compiler-rt/lib/lsan/lsan_common.h +++ b/compiler-rt/lib/lsan/lsan_common.h @@ -105,6 +105,7 @@ void GetAllThreadAllocatorCachesLocked(InternalMmapVector *caches); void ForEachExtraStackRange(tid_t os_id, RangeIteratorCallback callback, void *arg); +void ForEachExtraThreadStackRange(RangeIteratorCallback callback, void *arg); void GetAdditionalThreadContextPtrsLocked(InternalMmapVector *ptrs); void GetRunningThreadsLocked(InternalMmapVector *threads); diff --git a/compiler-rt/lib/lsan/lsan_common_fuchsia.cpp b/compiler-rt/lib/lsan/lsan_common_fuchsia.cpp --- a/compiler-rt/lib/lsan/lsan_common_fuchsia.cpp +++ b/compiler-rt/lib/lsan/lsan_common_fuchsia.cpp @@ -147,12 +147,8 @@ // just for the allocator cache, and to call ForEachExtraStackRange, // which ASan needs. if (flags()->use_stacks) { - GetLsanThreadRegistryLocked()->RunCallbackForEachThreadLocked( - [](ThreadContextBase *tctx, void *arg) { - ForEachExtraStackRange(tctx->os_id, ForEachExtraStackRangeCb, - arg); - }, - ¶ms->argument->frontier); + ForEachExtraThreadStackRange(ForEachExtraStackRangeCb, + ¶ms->argument->frontier); } params->callback(SuspendedThreadsListFuchsia(), params->argument); diff --git a/compiler-rt/lib/lsan/lsan_thread.cpp b/compiler-rt/lib/lsan/lsan_thread.cpp --- a/compiler-rt/lib/lsan/lsan_thread.cpp +++ b/compiler-rt/lib/lsan/lsan_thread.cpp @@ -75,6 +75,8 @@ ///// Interface to the common LSan module. ///// +void ForEachExtraThreadStackRange(tid_t os_id, RangeIteratorCallback callback, + void *arg) {} void ForEachExtraStackRange(tid_t os_id, RangeIteratorCallback callback, void *arg) {}