Skip to content

Conversation

@umanwizard
Copy link
Collaborator

Cherry-pick of open-telemetry#1027 -- see there for PR description

When the current address is a return address, we need to subtract one
to get the real call instruction.

Anecdotally, fixing this bug seems to substantially improve unwinding
for Rust aarch64 binaries compiled in debug mode. The reason for this
is that our heuristic for getting the frame pointer doesn't work in
function epilogues, and in debug builds, you often have a call
instruction immediately followed by the function epilogue. So due to
this off-by-one error, we'll think we're in the epilogue and not
correctly unwind the fp.

It seems much less common in release builds, probably because it is
much more unusual to have a call immediately followed by the function
epilogue (because the optimizer will replace that sequence by a tail call).
@umanwizard umanwizard force-pushed the aarch64-debug-offbyone branch from a85879e to 0aaa538 Compare December 18, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants