Skip to content

cDAC: GCInfo decoder does not support x86 #126359

@max-charlamb

Description

@max-charlamb

Summary

The cDAC's GCInfo decoder (GcScanner / GCInfoDecoder) does not support x86 (32-bit). When WalkStackReferences runs on an x86 dump, it returns zero GC references because the GCInfo encoding on x86 differs from the AMD64/ARM64 format that the decoder currently implements.

Repro

Run the cDAC dump tests on an x86 build:

  • GCRoots_WalkStackReferences_FindsRefs — expects at least one stack reference, gets 0
  • GCRoots_RefsPointToValidObjects — expects at least one valid object ref, gets 0

These tests are currently skipped on x86 via [SkipOnArch("x86", "GCInfo decoder does not support x86")] in PR #125505.

Details

The x86 GCInfo encoding uses a different format than AMD64/ARM64:

  • Different register numbering
  • EBP-frame vs ESP-frame distinction
  • Different slot encoding (GcSlotFlags, stack slot bases)
  • Separate GcInfoDecoder paths in the native runtime (src/coreclr/gc/env/gcenv.structs.h, src/coreclr/inc/gcinfodecoder.h)

The managed cDAC decoder in src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/GC/GcScanner.cs and GCInfoDecoder.cs currently only handles the 64-bit encoding.

Affected files

  • src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GCInfo/GCInfoDecoder.cs
  • src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/GC/GcScanner.cs
  • src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/ContextHolder.cs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions