HomePhabricator

[sanitizer] Disable fast_unwind_on_malloc as default for arm-linux-gnu

Authored by zatrazz on Oct 12 2020, 10:23 AM.

Description

[sanitizer] Disable fast_unwind_on_malloc as default for arm-linux-gnu

ARM thumb/thumb2 frame pointer is inconsistent on GCC and Clang [1]
and fast-unwider is also unreliable when mixing arm and thumb code [2].

The fast unwinder on ARM tries to probe and compare the frame-pointer
at different stack layout positions and it works reliable only on
systems where all the libraries were built in arm mode (either with
gcc or clang) or with clang in thmb mode (which uses the same stack
frame pointer layout in arm and thumb).

However when mixing objects built with different abi modes the
fast unwinder is still problematic as shown by the failures on the
AddressSanitizer.ThreadStackReuseTest. For these failures, the
malloc is called by the loader itself and since it has been built
with a thum enabled gcc, the stack frame is not correctly obtained
and the suppression rule is not applied (resulting in a leak warning).

The check for fast-unwinder-works is also changed: instead of checking
f it is explicit enabled in the compiler flags, it now checks if
compiler defined thumb pre-processor.

This should fix BZ#44158.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92172
[2] https://bugs.llvm.org/show_bug.cgi?id=44158

Reviewed By: eugenis

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

Details

Committed
zatrazzOct 12 2020, 10:36 AM
Reviewer
eugenis
Differential Revision
D88958: [sanitizer] Disable fast_unwind_on_malloc as default for arm-linux-gnu
Parents
rG012dd42e027e: [X86] Support -march=x86-64-v[234]
Branches
Unknown
Tags
Unknown