Fix cDAC server GC free region enumeration - #132704
Open
max-charlamb wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d56e1d60-7e1a-4353-8d3f-27deac700b4f
|
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 |
max-charlamb
marked this pull request as ready for review
August 24, 2026 15:39
max-charlamb
requested review from
noahfalk and
rcj1
and
a lite review from Copilot
August 24, 2026 15:39
|
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
There was a problem hiding this comment.
Pull request overview
Fixes server GC free-region enumeration in cDAC by treating GCHeapSVR.FreeRegions as an inline array (address-of field) rather than a pointer value, preventing invalid reads during enumeration.
Changes:
- Switch
GCHeapSVR.FreeRegionsfrom[Field]to[FieldAddress]so the contract uses the field’s address. - Add a unit test covering server heap inline
FreeRegionsenumeration across standard architectures.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/native/managed/cdac/tests/UnitTests/GCMemoryRegionTests.cs | Adds coverage for enumerating server GC inline free-region arrays via mocked heap layout. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/GC/GCHeapSVR.cs | Updates FreeRegions to use [FieldAddress] so enumeration uses the inline array base address. |
max-charlamb
enabled auto-merge (squash)
August 24, 2026 19:16
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.
Server GC stores
free_regionsas an inline array within each GC heap. The cDAC model currently treats this field as a pointer, causing the first list'snum_free_regionsvalue to be interpreted as an address. This can produce invalid reads such as0x2bwhen enumerating server GC free regions.This changes
GCHeapSVR.FreeRegionsto useFieldAddressand adds unit coverage for the server GC inline free-region array across all target architectures.Tests:
Microsoft.Diagnostics.DataContractReader.Tests: 3,098 passedNote
This pull request description was generated with GitHub Copilot.