[PATCH] D114818: [libunwind] Fix unwind_leaffunction test

Vlad Vereschaka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 2 11:12:08 PST 2021


vvereschaka added inline comments.


================
Comment at: libunwind/test/unwind_leaffunction.pass.cpp:44
 __attribute__((noinline)) void crashing_leaf_func(void) {
-  raise(SIGSEGV);
+  __builtin_trap();
 }
----------------
leonardchan wrote:
> danielkiss wrote:
> > `craching_lead_func` could become a function with only 1 or 2 instructions ( just `brk` or `brk+ret`). 
> > The first instruction is where unwind restores the pc but later it adjusts so it will point to the previous function actually so wrong FDE will be used for the unwinding which causes the skipped frames.
> > https://github.com/llvm/llvm-project/blob/main/libunwind/src/UnwindCursor.hpp#L1933
> > 
> > this "nop" is just a workaround which IMHO fine for now.
> > unwind may need to differentiate between the sync and async unwind cases. 
> Can confirm just adding the `nop` there allows for this test to pass on arm. I'll confirm on x64 then commandeer this patch and file a bug for this. Thanks for helping investigate this.
I also confirm that the 'nop' there fixes the test on Aarch64/Ubuntu Linux 18.04 board.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114818/new/

https://reviews.llvm.org/D114818



More information about the llvm-commits mailing list