[cDAC] Tolerate missing WKS card-table slot in reduced dumps - #132938
Open
steveisok wants to merge 1 commit into
Open
[cDAC] Tolerate missing WKS card-table slot in reduced dumps#132938steveisok wants to merge 1 commit into
steveisok wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9a58113d-e1d8-4ed2-9113-9f1de69cd49e
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
Review tier: Lite
Findings: None
What changed in this PR
This PR updates the cDAC GC workstation heap contract to treat the GCHeapCardTable global slot as optional when the slot’s target memory can’t be read, returning a null card table pointer while still providing valid heap and generation data.
Changes:
- Make
GCHeapWKS.CardTableresilient to an unreadable card-table slot by usingTryReadPointerand falling back toTargetPointer.Null. - Relax DEBUG cross-validation in
SOSDacImpl.GetGCHeapStaticDatato tolerate a zero card table when the legacy DAC still reports a non-zero value. - Add unit test coverage for both readable and unreadable card-table slot scenarios, including validating
GetGCHeapStaticDataoutput.
| File | Description |
|---|---|
| src/native/managed/cdac/tests/UnitTests/GCTests.cs | Adds tests for readable vs unreadable workstation card-table slot, and validates GetGCHeapStaticData returns a null card table without breaking generation data. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs | Narrows DEBUG-only cross-validation to allow card_table == 0 for reduced-dump scenarios in GetGCHeapStaticData. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/GCHeapWKS.cs | Switches card-table read to TryReadPointer with a TargetPointer.Null fallback to tolerate unreadable target memory. |
Contributor
|
I don't think this is the root cause of the issue; rather, we are trying to read memory at gc_heap::card_table which we do not preserve in a dump. |
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.
Windows CDB
/mwsingle-file dumps can omit the workstation GC card-table pointer slot while retaining the GC data needed for heap walking. Treat that slot as optional and report a null card table when unreadable, allowingIGC.GetHeapDataandGetGCHeapStaticDatato continue returning valid heap and generation data.Also narrows debug cross-validation for this known mismatch and adds coverage for readable and missing card-table slots.
Tests:
GCTests(36 passed)Note
This pull request description was generated with GitHub Copilot.