[cDac] Fix failing cDac test on OSX#129462
Merged
Merged
Conversation
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates cDAC’s managed contract type validation for pointer-sized fields so that fields reported as "nint"/"nuint" can be consumed via the pointer read/write helpers, aligning debug-time validation with how managed signatures encode IntPtr/UIntPtr.
Changes:
- Extend
TargetFieldExtensions.AssertPointerTypeto accept"nint"and"nuint"in addition to"pointer". - Update
ObjectiveCMarshalTests’ mocked contract descriptor forObjcTrackingInformation._memoryto useTypeName = "nint".
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/tests/UnitTests/ObjectiveCMarshalTests.cs | Adjusts the mocked type descriptor so the test reflects the real managed descriptor type name for IntPtr. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/TargetFieldExtensions.cs | Broadens debug-only pointer type validation to treat "nint"/"nuint" as valid pointer-sized representations for pointer reads/writes. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
max-charlamb
approved these changes
Jun 16, 2026
Open
3 tasks
Contributor
Author
|
/ba-g This resolves a real test break and needs to be checked in, the arm64 timeouts are unrelated...and I haven't been able to get them to run all day. |
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.
Fixes failing OSX cDac test. I think this is a regression from #128961.
This pull request updates the handling of pointer types in managed code to better align with how .NET expresses raw pointers. The main change is to allow fields typed as
IntPtr/UIntPtr(reported as"nint"/"nuint") to be treated as pointers by the contract reader, improving compatibility and correctness when reading pointer-sized fields.Improvements to pointer type handling:
AssertPointerTypeinTargetFieldExtensions.csto accept"nint"and"nuint"as valid pointer type names, in addition to"pointer", enabling proper handling of managed fields typed asIntPtr/UIntPtr.Test and contract descriptor alignment:
_memoryfield inObjectiveCMarshalTests.csto explicitly set its type as"nint", ensuring that the pointer read path is validated against the real managed contract descriptor.