Skip to content

Enable cDAC-only dump analysis mode and add CI test legs#5755

Draft
max-charlamb wants to merge 3 commits intodotnet:mainfrom
max-charlamb:cdac-only-testing
Draft

Enable cDAC-only dump analysis mode and add CI test legs#5755
max-charlamb wants to merge 3 commits intodotnet:mainfrom
max-charlamb:cdac-only-testing

Conversation

@max-charlamb
Copy link
Member

Summary

Enable SOS to load and operate on dumps using only the cDAC (no legacy DAC dependency). This enables cross-platform dump analysis and provides CI coverage for cDAC-only mode.

Changes

Commit 1: Enable cDAC-only dump analysis mode

When ForceUseContractReader is set (via runtimes --forceusecdac):

  • RuntimeWrapper: tries cDAC even when caller doesn't pass UseCDac flag, and skips legacy DAC fallback
  • DumpTargetFactory: allows cross-platform dump analysis (the cDAC is a host-native NativeAOT binary)
  • Runtime.GetLibraryPath: skips platform filter for DebugLibraryKind.CDac
  • Runtime.GetLocalPath: falls back to RuntimeModuleDirectory for cDAC, enabling user-provided paths via setclrpath

Commit 2: Remove outdated CDACCompatible test scripts

The testsoscdac.cmd/sh scripts filtered by CDACCompatible category, but no tests were ever marked with this trait.

Commit 3: Add cDAC-only CI test legs

  • SOSRunner sends runtimes --forceusecdac to dotnet-dump when SOS_TEST_CDAC is set
  • build.yml gains a useCdac parameter that passes -useCdac to the build script
  • Add Windows_cDAC (build+test) and Ubuntu_22_04_cDAC (test-only) CI legs running Release x64

Testing

Verified locally with dotnet-dump analyze using cDAC-only mode against runtime cDAC dump test fixtures:

  • clrstack — full managed stack trace ✅
  • threads — lists all threads ✅
  • dumpheap -stat — graceful error (cDAC feature gap in ClrMD, tracked separately) ✅

Related

Max Charlamb and others added 2 commits March 11, 2026 13:53
When ForceUseContractReader is set:
- RuntimeWrapper.GetClrDataProcess() tries cDAC even when caller
  doesn't pass UseCDac flag, and skips legacy DAC fallback.
- DumpTargetFactory.OpenDump() allows cross-platform dump analysis
  since the cDAC is a host-native NativeAOT binary.
- Runtime.GetLibraryPath() skips platform filter for cDAC discovery.
- Runtime.GetLocalPath() falls back to RuntimeModuleDirectory for
  cDAC, enabling user-provided paths via setclrpath.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The testsoscdac.cmd/sh scripts filtered tests by CDACCompatible
category, but no tests were ever marked with this trait. Replace
with the new SOS_TEST_CDAC environment variable approach that
enables cDAC-only mode for all dotnet-dump tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- SOSRunner sends 'runtimes --forceusecdac' to dotnet-dump when
  SOS_TEST_CDAC is set, enabling cDAC-only mode for dump tests.
- build.yml gains a useCdac parameter that passes -useCdac to
  the build script, setting SOS_TEST_CDAC=true.
- Add Windows_cDAC (build+test) and Ubuntu_22_04_cDAC (test-only)
  CI legs running Release x64 with cDAC-only mode.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant