Fix aarch64 stacktrace unwinding.

PiperOrigin-RevId: 910322805
Change-Id: I7a4b80e306ebfe62f36098376c4e4df396ddb8dc
This commit is contained in:
Mike Kruskal
2026-05-04 17:01:47 -07:00
committed by Copybara-Service
parent db10d46386
commit 74b81df26c

View File

@@ -212,6 +212,17 @@ static int UnwindImpl(void **result, uintptr_t *frames, int *sizes,
stack_info.sig_stack_low = stack_info.stack_low;
stack_info.sig_stack_high = kUnknownStackEnd;
#if defined(__linux__)
// Similarly for the signal stack, retrieve the information into sig_stack and
// then pass it down per call. Calling sigaltstack with nullptr as the first
// argument doesn't change the signal stack.
stack_t sig_stack;
if (sigaltstack(nullptr, &sig_stack) == 0) {
stack_info.sig_stack_low = reinterpret_cast<uintptr_t>(sig_stack.ss_sp);
stack_info.sig_stack_high = stack_info.sig_stack_low + sig_stack.ss_size;
}
#endif
// The frame pointer points to low address of a frame. The first 64-bit
// word of a frame points to the next frame up the call chain, which normally
// is just after the high address of the current frame. The second word of