Summary
The cDAC's GcScanContext in GcScanContext.cs currently throws NotImplementedException when encountering interior pointers (GC_CALL_INTERIOR flag) with ResolveInteriorPointers set to true.
Current Behavior
Both GCEnumCallback and GCReportCallback methods contain:
if (flags.HasFlag(GcScanFlags.GC_CALL_INTERIOR) && ResolveInteriorPointers)
{
// TODO(stackref): handle interior pointers
throw new NotImplementedException();
}
Expected Behavior
When an interior pointer is reported (e.g., pointing to the middle of an object), the cDAC should resolve it to the containing object's base address, matching the behavior of the native DAC's GcStackReferenceData reporting.
This is not currently hit in the common EnumerateStackRefs path because ResolveInteriorPointers defaults to false, but it could be needed by future consumers or when the cDAC is used for SOS scenarios that require resolved object addresses.
Context
This was identified during review of PR #125505 (cDAC stack reference walking). The relevant code is at:
src/native/managed/cdac/.../Contracts/StackWalk/GC/GcScanContext.cs lines 48-52, 81-85
cc @maxcharlamb
Summary
The cDAC's
GcScanContextinGcScanContext.cscurrently throwsNotImplementedExceptionwhen encountering interior pointers (GC_CALL_INTERIORflag) withResolveInteriorPointersset totrue.Current Behavior
Both
GCEnumCallbackandGCReportCallbackmethods contain:Expected Behavior
When an interior pointer is reported (e.g., pointing to the middle of an object), the cDAC should resolve it to the containing object's base address, matching the behavior of the native DAC's
GcStackReferenceDatareporting.This is not currently hit in the common
EnumerateStackRefspath becauseResolveInteriorPointersdefaults tofalse, but it could be needed by future consumers or when the cDAC is used for SOS scenarios that require resolved object addresses.Context
This was identified during review of PR #125505 (cDAC stack reference walking). The relevant code is at:
src/native/managed/cdac/.../Contracts/StackWalk/GC/GcScanContext.cslines 48-52, 81-85cc @maxcharlamb