HomeFreeBSD

Temporarily disable libunwind's FrameHeaderCache, until there is a

Description

Temporarily disable libunwind's FrameHeaderCache, until there is a
resolution for https://bugs.llvm.org/show_bug.cgi?id=47181.

The cache implementation depends on dl_iterate_phdr(3) ensuring that its
callbacks are not called simultaneously for multiple threads, but that
is only the case for the dl_iterate_phdr() implementation in rtld.

In a statically linked executable, libc's dl_iterate_phdr() is used,
which does no such locking. If multiple threads then call into the
unwinder at the same time, it is possible to trigger a segfault.

In particular, the statically linked lld which is built during the
cross-tools stage can segfault in this way, because it starts multiple
worker threads that can exit in parallel. Since our pthread_exit(3)
invokes the unwinder, it will therefore call into it in parallel too.

(cherry picked from commit 9ff1cc58cd72f7109ae728ca32935cf9e8ca8ced)

Details

Provenance
dimAuthored on Aug 15 2020, 10:58 PM
Parents
rG8d0d3376d6d3: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
Branches
Unknown
Tags
Unknown