Repository navigation
[cDAC] Validate global reads against descriptor types - #130725
Merged
max-charlamb merged 4 commits intoJul 16, 2026
Merged
max-charlamb merged 4 commits into
max-charlamb merged 4 commits into
Conversation
|
Azure Pipelines: Successfully started running 4 pipeline(s). 11 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.
Pull request overview
This PR tightens cDAC contract-descriptor global reading by adding debug-time validation that the requested read shape (numeric / pointer / string) matches the global’s descriptor type annotation, and refactors type-compatibility checks into a shared helper used by both field and global validation.
Changes:
- Add debug assertions to
ContractDescriptorTargetglobal read paths to validate descriptor type compatibility for numeric, pointer, and string reads. - Introduce
TargetTypeHelpersto share compatibility logic between field validation (TargetFieldExtensions) and global validation. - Add new unit tests covering mismatched global read/type scenarios across target architectures.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/tests/UnitTests/ContractDescriptor/TargetTests.cs | Adjusts existing global stringy-value test data to avoid declaring a string type when a numeric interpretation is also provided. |
| src/native/managed/cdac/tests/UnitTests/ContractDescriptor/GlobalTypeValidationTests.cs | Adds focused DEBUG-only tests to assert type-mismatch diagnostics for global reads. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader/ContractDescriptorTarget.cs | Adds descriptor-type validation assertions and separates numeric global lookup from typed conversion paths. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/TargetTypeHelpers.cs | Adds shared (currently public) helper methods for validating primitive/pointer/string type compatibility. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/TargetFieldExtensions.cs | Refactors existing field-type validation to use the new shared helper methods. |
max-charlamb
marked this pull request as ready for review
July 14, 2026 20:45
|
Azure Pipelines: Successfully started running 4 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
max-charlamb
force-pushed
the
dev/max-charlamb/cdac-global-type-validation
branch
from
July 15, 2026 02:23
1d60916 to
495c99d
Compare
max-charlamb
marked this pull request as draft
July 15, 2026 02:23
Co-authored-by: Copilot <[email protected]> Copilot-Session: 03cf8dec-e644-4631-8802-f2b3fccd523a
max-charlamb
force-pushed
the
dev/max-charlamb/cdac-global-type-validation
branch
from
July 15, 2026 02:26
495c99d to
2d6cc69
Compare
Co-authored-by: Copilot <[email protected]> Copilot-Session: 03cf8dec-e644-4631-8802-f2b3fccd523a
Co-authored-by: Copilot <[email protected]> Copilot-Session: 03cf8dec-e644-4631-8802-f2b3fccd523a
max-charlamb
marked this pull request as ready for review
July 15, 2026 13:38
|
Azure Pipelines: Successfully started running 5 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: Copilot <[email protected]> Copilot-Session: 03cf8dec-e644-4631-8802-f2b3fccd523a
rcj1
approved these changes
Jul 16, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
pointer,nint, andnuintdescriptor typesStressLogMaxModuleswith its nativenuinttypeFixes #126749
Testing
Note
This PR description was generated with GitHub Copilot.