native tracer: fix unwinding eh_frame entries ending in a call instuction#1382
Merged
Merged
Conversation
23ac131 to
597c437
Compare
…ction It seems compilers can fairly often generate .eh_frame entries ending in a 'call' instruction. The unwinder would match the immediate next eh_frame in this case as it was not taking into account unwinding state. Since we now have 'return_address' state available, use that to adjust the lookup address to be able to match the CALL instruction at the end of FDE. The problem this introduces is unwinding signal frame handlers. Those are injected to the stack, and the FDE typically does not cover the preceding byte (which is not a CALL instruction or even part of the FDE). To keep things working, adjust the signal frame command address by -1 so that unwindier will find the signal handler FDE.
597c437 to
85e79be
Compare
christos68k
approved these changes
May 1, 2026
florianl
approved these changes
May 4, 2026
This was referenced May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It seems compilers can fairly often generate .eh_frame entries ending in a 'call' instruction. The unwinder would match the immediate next eh_frame in this case as it was not taking into account unwinding state. Since we now have 'return_address' state available, use that to adjust the lookup address to be able to match the CALL instruction at the end of FDE.
The problem this introduces is unwinding signal frame handlers. Those are injected to the stack, and the FDE typically does not cover the preceding byte (which is not a CALL instruction or even part of the FDE). To keep things working, adjust the signal frame command address by -1 so that unwindier will find the signal handler FDE.