Skip to content

Conversation

@pcc
Copy link
Contributor

@pcc pcc commented Dec 19, 2025

… offset

Some linkers such as lld will create program headers with multiple mappings of the same file offset. This can lead to problems when a symbol of interest to rr, such as __aarch64_ldadd4_relax, is covered by more than one mapping, as that will lead to us finding the function in multiple mappings. For that symbol in particular, we can end up misinterpreting the instructions in the wrong mapping and incorrectly computing an address to write to, which can lead to an assertion failure, or worse, silent memory corruption. Fix it by changing resolve_address to check whether the mapping is the correct one (fully covers the appropriate program header and has the same memory permissions) before returning the address.

… offset

Some linkers such as lld will create program headers with multiple
mappings of the same file offset. This can lead to problems when a symbol
of interest to rr, such as __aarch64_ldadd4_relax, is covered by more
than one mapping, as that will lead to us finding the function in multiple
mappings. For that symbol in particular, we can end up misinterpreting the
instructions in the wrong mapping and incorrectly computing an address
to write to, which can lead to an assertion failure, or worse, silent
memory corruption. Fix it by changing resolve_address to check whether
the mapping is the correct one (fully covers the appropriate program
header and has the same memory permissions) before returning the address.
@rocallahan rocallahan merged commit 5dbba89 into rr-debugger:master Dec 19, 2025
5 checks passed
@rocallahan
Copy link
Collaborator

Thanks!

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