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
Summary
The cDAC's GCInfo decoder (
GcScanner/GCInfoDecoder) does not support x86 (32-bit). WhenWalkStackReferencesruns 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 0GCRoots_RefsPointToValidObjects— expects at least one valid object ref, gets 0These 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:
GcSlotFlags, stack slot bases)GcInfoDecoderpaths 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.csandGCInfoDecoder.cscurrently only handles the 64-bit encoding.Affected files
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GCInfo/GCInfoDecoder.cssrc/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/GC/GcScanner.cssrc/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/ContextHolder.cs