fix(dyninst): Fix use-after-unmap from filename-keyed DwarfHandle cache - #29
Merged
Merged
Conversation
1 task
Author
|
ROCm/rocm-systems#10255 (comment) |
There was a problem hiding this comment.
Pull request overview
Fixes a use-after-unmap hazard in Dyninst’s DWARF handling by preventing DwarfHandle reuse when a filename-cache hit refers to a handle built from a different Elf_X instance than the one currently being parsed.
Changes:
- Validate cached
DwarfHandleentries by comparingorigFile()against the incomingElf_X*. - Evict filename-cache entries that don’t match the current
Elf_Xto force rebuilding a fresh handle.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
sputhala-amd
approved these changes
Aug 19, 2026
sputhala-amd
left a comment
There was a problem hiding this comment.
Once this fix is merged, is the plan to revert ROCm/rocm-systems#10171?
dgaliffiAMD
approved these changes
Aug 22, 2026
Author
IIRC, yes. |
1 task
kcossett-amd
added a commit
to ROCm/rocm-systems
that referenced
this pull request
Aug 27, 2026
## Motivation <!-- Explain the purpose of this PR and the goals it aims to achieve. --> Reverts the workaround introduced in #10171 by updating dyninst submodule to the commit that contains the fix (ROCm/dyninst#29). See both PRs for details. ## Technical Details <!-- Explain the changes along with any relevant GitHub links. --> - Reverts #10171 - Bump dyninst submodule to d5adcef5fb64965beee445d16ce2a6f2c08c2496 ## Issue Tracking <!-- Include a GitHub Issue and/or JIRA ID. Do not post any full JIRA links here. --> <!-- GitHub issue: #1234 --> <!-- JIRA ID: EXAMPLECOMPONENT-1234 --> JIRA ID: AIPROFSYST-730 ## Test Plan <!-- Explain any relevant testing done to verify this PR. --> Workflows (ASan must pass) ## Test Result <!-- Briefly summarize test outcomes. --> See workflows. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md.
amd-josnarlo
pushed a commit
to ROCm/rocm-systems
that referenced
this pull request
Aug 28, 2026
## Motivation <!-- Explain the purpose of this PR and the goals it aims to achieve. --> Reverts the workaround introduced in #10171 by updating dyninst submodule to the commit that contains the fix (ROCm/dyninst#29). See both PRs for details. ## Technical Details <!-- Explain the changes along with any relevant GitHub links. --> - Reverts #10171 - Bump dyninst submodule to d5adcef5fb64965beee445d16ce2a6f2c08c2496 ## Issue Tracking <!-- Include a GitHub Issue and/or JIRA ID. Do not post any full JIRA links here. --> <!-- GitHub issue: #1234 --> <!-- JIRA ID: EXAMPLECOMPONENT-1234 --> JIRA ID: AIPROFSYST-730 ## Test Plan <!-- Explain any relevant testing done to verify this PR. --> Workflows (ASan must pass) ## Test Result <!-- Briefly summarize test outcomes. --> See workflows. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md.
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.
Motivation
For background on the issue being fixed, see ROCm/rocm-systems#10171
The problem is that the
DwarfHandlecache is keyed only on filename, so it hands back a handle bound to anElf_Xwhose image~Symtabalready unmapped; this verifies the binding and rebuilds the entry when it differs.Technical Details
Reuse a cached
DwarfHandleonly when itsorigFile()matches theElf_Xbeing passed in, otherwise drop the stale entry and build a new handle.Test Plan
ROCm/rocm-systems#10255 (comment)
Test Result
See Test PR on rocprofiler-systems, all tests pass.
Submission Checklist