[cDAC] Add single-file application dump tests#128781
Conversation
Add a new PublishModes dimension (Normal/SingleFile) to the cDAC dump test framework, orthogonal to the existing R2RModes (R2R/Jit). Key changes: - ClrMdDumpHost: Add fallback scan of all modules for the contract descriptor export, handling single-file bundles where coreclr is embedded in the apphost. - DumpTests.targets: Add PublishModes cross-product with R2RModes, compound directory names (singlefile-r2r, singlefile-jit), and a new _GenerateSingleFileDump target for self-contained single-file publish. - TestConfiguration: Add PublishMode property and CompoundDirName for dump path construction. - DumpTestBase: Cross-product RuntimeVersion x R2RMode x PublishMode in TestConfigurations. - Helix: Update metadata generation, command routing (run exe directly for single-file), and payload copying for single-file variants. - Opt in BasicThreads, StackWalk, TypeHierarchy as initial debuggees. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR extends the cDAC dump test framework to cover single-file published debuggees by introducing a new publish-mode dimension (normal vs single-file), updating dump layout handling, and making contract-descriptor discovery resilient to single-file bundling module names.
Changes:
- Added
PublishMode/compound directory naming toTestConfiguration+ updated dump-path resolution inDumpTestBase. - Updated MSBuild/Helix plumbing to build/copy/run single-file debuggees and to generate metadata/dumps in
singlefile-{r2r|jit}directories. - Made
ClrMdDumpHost.FindContractDescriptorAddress()fall back to scanning all modules forDotNetRuntimeContractDescriptor.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/tests/DumpTests/TestConfiguration.cs | Adds PublishMode and CompoundDirName for dump directory naming. |
| src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs | Enumerates publish modes and uses compound dir names when locating dumps. |
| src/native/managed/cdac/tests/DumpTests/Microsoft.Diagnostics.DataContractReader.DumpTests.csproj | Extends debuggee metadata generation and Helix payload copying for single-file variants. |
| src/native/managed/cdac/tests/DumpTests/DumpTests.targets | Adds publish-mode cross-product and single-file publish/dump generation targets. |
| src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs | Adds a second-pass module scan for the contract descriptor export. |
| src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj | Runs single-file debuggees directly when IsSingleFile=true. |
| src/native/managed/cdac/tests/DumpTests/Debuggees/Directory.Build.props | Introduces default PublishModes property for debuggees. |
| src/native/managed/cdac/tests/DumpTests/Debuggees/Directory.Build.targets | Plumbs PublishModes through GetDumpTypes metadata. |
| src/native/managed/cdac/tests/DumpTests/Debuggees/BasicThreads/BasicThreads.csproj | Opts debuggee into Normal;SingleFile. |
| src/native/managed/cdac/tests/DumpTests/Debuggees/StackWalk/StackWalk.csproj | Opts debuggee into Normal;SingleFile. |
| src/native/managed/cdac/tests/DumpTests/Debuggees/TypeHierarchy/TypeHierarchy.csproj | Opts debuggee into Normal;SingleFile. |
This comment has been minimized.
This comment has been minimized.
Align _GenerateSingleFileDump with the existing pattern: always publish with PublishReadyToRun=true and control jit behavior at runtime via DOTNET_ReadyToRun=0. This matches _GenerateLocalDump, _PublishSingle- FileDebuggee, and the Helix command generation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Use CompoundDirName in skip message so singlefile-r2r shows correctly instead of just r2r. - Add chmod +x before running single-file exe on Unix Helix, since archive extraction may not preserve executable bits. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Code Review: [cDAC] Add single-file application dump testsVerdict: ✅ Approve SummaryThis PR adds single-file application dump test support to the cDAC dump test framework. It introduces a AssessmentThe change is well-structured, follows existing patterns in the test infrastructure, and all previous review comments have been addressed (resolved). No new public API surface is introduced. Findings💡 suggestion — Minor inefficiency in two-pass module scanFile: The second pass scans all modules, including those already checked in the first pass (known runtime modules). You could skip modules that passed 💡 suggestion —
|
Note
This PR was created with assistance from GitHub Copilot.
Summary
Adds single-file application dump tests to the cDAC dump test framework. Single-file apps bundle the runtime into one executable, which changes how modules appear in crash dumps -- this was previously untested.
Changes
New
PublishModesdimensionPublishModesis a new per-debuggee property (default:Normal), orthogonal to the existingR2RModes(R2R/Jit). Debuggees opt in with:This produces compound dump directory names:
singlefile-r2r,singlefile-jit.Module discovery fix
ClrMdDumpHost.FindContractDescriptorAddress()now has a two-pass scan: first checks known runtime module names (fast path), then falls back to scanning all modules for theDotNetRuntimeContractDescriptorexport. This handles single-file bundles where coreclr is embedded in the apphost.Initial debuggees
Three debuggees opt in as initial coverage:
CI integration
No pipeline YAML changes needed -- the existing
BuildDebuggeesOnlyandPrepareHelixPayloadMSBuild targets automatically pick up single-file variants for opted-in debuggees. The build stage already includeshost+packswhich buildssinglefilehost.Validation
ThreadCounts_AreNonNegative(config: local/singlefile-r2r)passedsinglefilehostviatargetingpacks.targets(same mechanism as R2R tests)