Repository navigation
Fix macOS single-file runtime info capture - #134353
max-charlamb merged 1 commit into
Conversation
MachOModule::TryLookupSymbol returns a relocated target address, but createdump added the module base again before reading DotNetRuntimeInfo. Use the returned address directly and clarify the lookup contract. Co-authored-by: Copilot <[email protected]> Copilot-Session: fef3d44c-e682-4eee-9fcf-f621dda46b83
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The change is narrowly scoped, matches the Mach-O reader’s existing “relocated address” computation, and fixes the only confirmed incorrect use site in the macOS single-file createdump path.
Review effort: Lite
Findings: None
What changed in this PR
Fixes macOS createdump’s single-file runtime info capture by treating MachOModule::TryLookupSymbol results as already-relocated target virtual addresses (rather than module-relative offsets), avoiding an erroneous second base addition when reading DotNetRuntimeInfo.
Changes:
- Document
MachOModule::TryLookupSymbolas returning a relocated target address and rename out-parameters accordingly. - Rename local variables in the Mach-O reader export path to reflect “address” semantics.
- Fix macOS single-file
DotNetRuntimeInforead to use the symbol’s relocated address directly (instead ofmodule.BaseAddress() + symbolOffset).
| File | Description |
|---|---|
| src/coreclr/debug/dbgutil/machoreader.h | Documents TryLookupSymbol address semantics and renames the out-parameter to symbolAddress. |
| src/coreclr/debug/dbgutil/machoreader.cpp | Renames locals/out-params to reflect absolute-address semantics; implementation continues to return m_loadBias + n_value. |
| src/coreclr/debug/createdump/crashinfomac.cpp | Fixes single-file DotNetRuntimeInfo read to use the relocated symbol address directly, preventing double-basing. |
|
/ba-g All tests passed, stuck on Monitor Helix Jobs |
|
/backport to release/11.0 |
|
Started backporting to |
Backport of #134353 to release/11.0 /cc @steveisok @max-charlamb ## Customer Impact - [ ] Customer reported - [ ] Found internally [Select one or both of the boxes. Describe how this issue impacts customers, citing the expected and actual behaviors and scope of the issue. If customer-reported, provide the issue number.] ## Regression - [ ] Yes - [ ] No [If yes, specify when the regression was introduced. Provide the PR or commit if known.] ## Testing [How was the fix verified? How was the issue missed previously? What tests were added?] ## Risk [High/Medium/Low. Justify the indication by mentioning how risks were measured and addressed.] **IMPORTANT**: If this backport is for a servicing release, please verify that: - For .NET 8 and .NET 9: The PR target branch is `release/X.0-staging`, not `release/X.0`. - For .NET 10+: The PR target branch is `release/X.0` (no `-staging` suffix). ## Package authoring no longer needed in .NET 9 **IMPORTANT**: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version. Keep in mind that we still need package authoring in .NET 8 and older versions. Co-authored-by: Max Charlamb <[email protected]> Co-authored-by: Max Charlamb <[email protected]> Copilot-Session: fef3d44c-e682-4eee-9fcf-f621dda46b83
Summary
DotNetRuntimeInfoMachOModule::TryLookupSymbolreturns an absolute target addressDetails
MachOModule::TryLookupSymbolreturnsm_loadBias + n_value, which is already the symbol's relocated address in the target process. The macOS single-file createdump path added the module base again, causing theDotNetRuntimeInforead to target an invalid address. SinceReadMemoryalso registers the containing page for the dump, the failed read could leave reduced dumps without the runtime version and legacy DAC identity.Validation
MachOModule::TryLookupSymbolcallers for similar address handling