[libcxx-commits] [PATCH] D158655: [libunwind][AIX] Fix problem with stepping up from a leaf function when unwinding started in a signal handler

Hubert Tong via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 25 13:15:40 PDT 2023


hubert.reinterpretcast added inline comments.


================
Comment at: libunwind/src/UnwindCursor.hpp:2504
+    // sigcontext is used as the return address.
+    if (!usedLRFromSigContext)
+      newRegisters.setSP(lastStack);
----------------
I don't think there should a condition here at all. A fix needs to be made at line 2324 (otherwise the wrong link area would be used for retrieving a saved LR when `stores_bc` is `0` and `saves_lr` is `1`).


================
Comment at: libunwind/src/UnwindCursor.hpp:2324
   // lastStack points to the stack frame of the next routine up.
   pint_t lastStack = *(reinterpret_cast<pint_t *>(registers.getSP()));
 
----------------
hubert.reinterpretcast wrote:
> This only covers the case when `stores_bc` is `1` in the traceback table.
@xingxue, is a change coming for this? I think this also falls into "cases that arise when unwinding past a signal handler".


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158655



More information about the libcxx-commits mailing list