Skip to content

Commit 64699d3

Browse files
xingxue-ibmtru
authored andcommitted
[libunwind][AIX] Fix the wrong traceback from signal handler (#101069)
Patch [#92291](#92291) causes wrong traceback from a signal handler for AIX because the AIX unwinder uses the traceback table at the end of each function instead of FDE/CIE for unwinding. This patch adds a condition to exclude traceback table based unwinding from the code added by the patch. (cherry picked from commit d90fa61)
1 parent 63cf3d4 commit 64699d3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

libunwind/src/UnwindCursor.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2589,7 +2589,8 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {
25892589
--pc;
25902590
#endif
25912591

2592-
#if !(defined(_LIBUNWIND_SUPPORT_SEH_UNWIND) && defined(_WIN32))
2592+
#if !(defined(_LIBUNWIND_SUPPORT_SEH_UNWIND) && defined(_WIN32)) && \
2593+
!defined(_LIBUNWIND_SUPPORT_TBTAB_UNWIND)
25932594
// In case of this is frame of signal handler, the IP saved in the signal
25942595
// handler points to first non-executed instruction, while FDE/CIE expects IP
25952596
// to be after the first non-executed instruction.

libunwind/test/aix_signal_unwind.pass.sh.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// a correct traceback when the function raising the signal does not save
1111
// the link register or does not store the stack back chain.
1212

13-
// REQUIRES: target=powerpc{{(64)?}}-ibm-aix
13+
// REQUIRES: target=powerpc{{(64)?}}-ibm-aix{{.*}}
1414

1515
// Test when the function raising the signal does not save the link register
1616
// RUN: %{cxx} -x c++ %s -o %t.exe -DCXX_CODE %{flags} %{compile_flags}

0 commit comments

Comments
 (0)