Uh oh!
There was an error while loading. Please reload this page.
[cDac] Fix failing cDac test on OSX - #129462
Conversation
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
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
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
leculver
commented
Jun 16, 2026
/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. |
Uh oh!
There was an error while loading. Please reload this page.
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: * Updated `AssertPointerType` in `TargetFieldExtensions.cs` to accept `"nint"` and `"nuint"` as valid pointer type names, in addition to `"pointer"`, enabling proper handling of managed fields typed as `IntPtr`/`UIntPtr`. Test and contract descriptor alignment: * Modified the test contract for the `_memory` field in `ObjectiveCMarshalTests.cs` to explicitly set its type as `"nint"`, ensuring that the pointer read path is validated against the real managed contract descriptor. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.