Skip to content

[cDAC] Handle interior pointer resolution in GcScanContext #125728

Closed

Description

@max-charlamb

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

Activity

  1. added
    untriaged
    on Mar 18, 2026
  2. dotnet-policy-service commented on Mar 18, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/interop-contrib
    See info in area-owners.md if you want to be subscribed.

  3. added and removed
    untriaged
    on Mar 18, 2026
  4. changed the title [-]cDAC: Handle interior pointer resolution in GcScanContext[/-] [+][cDAC] Handle interior pointer resolution in GcScanContext[/+] on Mar 18, 2026
  5. dotnet-policy-service commented on Mar 18, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
    See info in area-owners.md if you want to be subscribed.

  6. self-assigned this
    on Jun 17, 2026
  7. locked and limited conversation to collaborators on Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions