[all-commits] [llvm/llvm-project] 039126: [sanitizer] Disable fast_unwind_on_malloc as defau...

Adhemerval Zanella via All-commits all-commits at lists.llvm.org
Mon Oct 12 10:36:38 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 039126c97d39fbd8ca6a82f103db8f2591e793cd
      https://github.com/llvm/llvm-project/commit/039126c97d39fbd8ca6a82f103db8f2591e793cd
  Author: Adhemerval Zanella <adhemerval.zanella at linaro.org>
  Date:   2020-10-12 (Mon, 12 Oct 2020)

  Changed paths:
    M compiler-rt/CMakeLists.txt
    M compiler-rt/lib/sanitizer_common/sanitizer_flags.inc
    M compiler-rt/test/asan/TestCases/Linux/clang_gcc_abi.cpp
    M compiler-rt/test/asan/lit.cfg.py
    M compiler-rt/test/asan/lit.site.cfg.py.in

  Log Message:
  -----------
  [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




More information about the All-commits mailing list