HomePhabricator

[asan] Fix stack-use-after-free checks on non-main thread on Fuchsia

Authored by zarvox on Oct 24 2020, 2:24 PM.

Description

[asan] Fix stack-use-after-free checks on non-main thread on Fuchsia

While some platforms call AsanThread::Init() from the context of the
thread being started, others (like Fuchsia) call AsanThread::Init()
from the context of the thread spawning a child. Since
AsyncSignalSafeLazyInitFakeStack writes to a thread-local, we need to
avoid calling it from the spawning thread on Fuchsia. Skipping the call
here on Fuchsia is fine; it'll get called from the new thread lazily on first
attempted access.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D89607