Skip to content

Stop forcing verbose createdump diagnostics in CrashDump extension - #8350

Merged
Amaury Levé (Evangelink) merged 1 commit into
mainfrom
dev/amauryleve/crashdump-quiet-diagnostics
May 19, 2026
Merged

Stop forcing verbose createdump diagnostics in CrashDump extension#8350
Amaury Levé (Evangelink) merged 1 commit into
mainfrom
dev/amauryleve/crashdump-quiet-diagnostics

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Fixes#7045

Problem

When the Microsoft.Testing.Extensions.CrashDump extension is enabled in MTP, the runtime's createdump emits megabytes of [createdump] diagnostics (thread RIPs, AUXV, module mappings, ...) to stdout on Linux/macOS whenever a testhost crashes. In the reporter's case (#7045) this produced a 160 MB log for a single crashed test, large enough to make the GitHub Actions UI unresponsive.

The cause is that CrashDumpEnvironmentVariableProvider unconditionally set DOTNET_CreateDumpDiagnostics and DOTNET_CreateDumpVerboseDiagnostics (and the COMPlus_ twins) to ""1"", which turns on the runtime's verbose createdump logging. VSTest does not enable these. HangDump already does the right thing by calling WriteDump(..., logDumpGeneration: false). So this extension was the odd one out.

Fix

  • Stop setting CreateDumpDiagnostics / CreateDumpVerboseDiagnostics (both DOTNET_ and COMPlus_) in CrashDumpEnvironmentVariableProvider. Drop the corresponding ValidateBothPrefixes calls and the now-unused private const fields.
  • Add the missing COMPlus_ twins of the createdump / crash-report environment variables to the test infrastructure WellKnownEnvironmentVariables.ToSkipEnvironmentVariables list (the DOTNET_ ones were already there - flagged by Jakub Jareš (@nohwnd) in the issue).

Opt back in

Anyone who actually wanted the verbose createdump output (e.g. when filing a runtime issue) can opt in by setting DOTNET_CreateDumpDiagnostics=1 (and/or DOTNET_CreateDumpVerboseDiagnostics=1) in the parent process environment - the platform no longer overrides or locks those variables.

Out of scope (tracked separately / referred to other repos)

The CrashDump extension was unconditionally setting DOTNET_CreateDumpDiagnostics and DOTNET_CreateDumpVerboseDiagnostics (and their COMPlus_ twins) to `1`. This caused the runtime's createdump to emit megabytes of [createdump] noise (thread RIPs, AUXV, module mappings, etc.) on Linux/macOS, breaking the GitHub Actions UI for large logs (see #7045 - reporter saw 160 MB log files for a single crash).
HangDump already does the right thing by passing logDumpGeneration: false; VSTest does not enable these diagnostics either. This change brings CrashDump in line with both.
Users who actually want createdump's verbose output for diagnostics can still opt in by setting DOTNET_CreateDumpDiagnostics=1 (and/or DOTNET_CreateDumpVerboseDiagnostics=1) in the parent process environment; the platform no longer overrides or locks those variables.
Also adds the COMPlus_ variants of the createdump and crash-report variables to the test infrastructure skip list (WellKnownEnvironmentVariables) - the DOTNET_ ones were already there, but the COMPlus_ side was missing.
Fixes#7045
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings May 19, 2026 08:43

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Stops the CrashDump extension from forcing verbose createdump diagnostics that produced massive (160 MB) GitHub Actions logs on testhost crashes, aligning behavior with VSTest and HangDump.

Changes:

  • Remove unconditional setting of CreateDumpDiagnostics / CreateDumpVerboseDiagnostics (both DOTNET_ and COMPlus_ prefixes) in CrashDumpEnvironmentVariableProvider, including the related validation calls and unused constants.
  • Add the COMPlus_ twins of the createdump/crash-report environment variables to the test infrastructure skip list.
Show a summary per file
FileDescription
src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpEnvironmentVariableProvider.csDrops setting + validation of verbose createdump diagnostics env vars and the now-unused constants.
test/Utilities/Microsoft.Testing.TestInfrastructure/WellKnownEnvironmentVariables.csAdds missing COMPlus_ createdump/crash-report variables to the skip list.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review — PR #8350: Stop forcing verbose createdump diagnostics in CrashDump extension

Reviewed 2 files across all 21 dimensions. The change is well-scoped and clearly justified by the 160 MB log catastrophe described in #7045.

#DimensionResultSeverity
1Algorithmic Correctness✅ LGTMMAJOR
2Threading & ConcurrencyN/ABLOCKING
3Security & IPC Contract Safety✅ LGTMBLOCKING
4Public API & Binary CompatibilityN/A — all internal sealedBLOCKING
5Performance & Allocations✅ Positive — eliminates megabyte log floodsMAJOR
6Cross-TFM Compatibility✅ LGTM — existing #if !NETCOREAPP guard unaffectedMAJOR
7Resource & IDisposable ManagementN/AMAJOR
8Defensive Coding at BoundariesN/AMAJOR
9Localization & ResourcesN/A — no user-facing strings changedMAJOR
10Test Isolation✅ Positive — WellKnownEnvironmentVariables gap filled for COMPlus_ prefixesMAJOR
11Assertion QualityN/AMAJOR
12Flakiness PatternsN/ABLOCKING
13Test Completeness & Coverage✅ LGTM — removal of unconditional noise; existing tests remain validMAJOR
14Data-Driven Test CoverageN/AMODERATE
15Code Structure & Simplification✅ LGTM — clean removal, no dead code left behindMODERATE
16Naming & Conventions✅ LGTMNIT
17Documentation Accuracy✅ LGTM — PR body is thoroughNIT
18Analyzer & Code Fix QualityN/AMAJOR
19IPC Wire CompatibilityN/AMAJOR
20Build Infrastructure & DependenciesN/AMODERATE
21Scope & PR Discipline✅ LGTM — minimal, focused diffMODERATE

Notes

  • Consistency between UpdateAsync and ValidateTestHostEnvironmentVariablesAsync: The two ValidateBothPrefixes calls are correctly removed to match the now-absent SetVariable calls. ✅
  • WellKnownEnvironmentVariables: The DOTNET_ twins (CreateDumpDiagnostics, CreateDumpVerboseDiagnostics, CreateDumpLogToFile, EnableCrashReport, EnableCrashReportOnly) were already present; the PR symmetrically adds the missing COMPlus_ counterparts. ✅
  • Opt-in path preserved: Users can still set DOTNET_CreateDumpDiagnostics=1 / DOTNET_CreateDumpVerboseDiagnostics=1 in the parent process — the extension no longer overrides them. ✅
  • Pre-existing minor gap (out of scope): DOTNET_DbgMiniDumpType and DOTNET_DbgEnableElfDumpOnMacOS are still absent from the ToSkipEnvironmentVariables list while their COMPlus_ twins are present. Not introduced by this PR; worth a follow-up.

No blocking or major issues found. This is a clean, well-reasoned fix.

Generated by Expert Code Review (on open) for issue #8350 · ● 6.5M

@Evangelink
Amaury Levé (Evangelink) merged commit 076de0c into mainMay 19, 2026
33 of 35 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/crashdump-quiet-diagnostics branch May 19, 2026 09:28
Sign up for freeto 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.

Excessive output when crashdump kicks in

2 participants

@Evangelink