[all-commits] [llvm/llvm-project] fdd424: [ubsan] Fix print_stacktrace=1:fast_unwind_on_fata...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Apr 12 11:24:32 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fdd424e37abf3fa411c07f1e08fee72cfe7bb25b
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-04-12 (Tue, 12 Apr 2022)

  Changed paths:
    M compiler-rt/lib/ubsan/ubsan_diag.cpp
    A compiler-rt/test/ubsan/TestCases/Misc/Linux/diag-stacktrace.cpp

  Log Message:
  [ubsan] Fix print_stacktrace=1:fast_unwind_on_fatal=0 to correctly fallback to fast unwinder

ubsan_GetStackTrace (from 52b751088b11547e0f4ef0589ebbe5e57752c68c) called by
~ScopeReport leaves top/bottom zeroes in the
`!WillUseFastUnwind(request_fast_unwind)` code path.
When BufferedStackTrace::Unwind falls back to UnwindFast,
`if (stack_top < 4096) return;` will return early, leaving just one frame in the stack trace.

Fix this by always initializing top/bottom like 261d6e05d5574bec753ea6b7e9a7f99229927753.

Reviewed By: eugenis, yln

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

More information about the All-commits mailing list