[libcxx-commits] [PATCH] D114818: [libunwind] Fix unwind_leaffunction test

Daniel Kiss via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 2 07:14:19 PST 2021


danielkiss added inline comments.


================
Comment at: libunwind/test/unwind_leaffunction.pass.cpp:44
 __attribute__((noinline)) void crashing_leaf_func(void) {
-  raise(SIGSEGV);
+  __builtin_trap();
 }
----------------
`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. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114818



More information about the libcxx-commits mailing list