Skip to content

[release/10.0] Defer DOTNET_DbgEnableMiniDump error message until dump creation#126055

Merged
JulieLeeMSFT merged 8 commits intorelease/10.0from
backport/pr-122986-to-release/10.0
Mar 25, 2026
Merged

[release/10.0] Defer DOTNET_DbgEnableMiniDump error message until dump creation#126055
JulieLeeMSFT merged 8 commits intorelease/10.0from
backport/pr-122986-to-release/10.0

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Mar 24, 2026

Backport of #122986 to release/10.0

/cc @hoyosjs @copilot

Customer Impact

  • Customer reported
  • Found internally

If customers specify the crash dump collecting variables on nativeAOT, the default was to print error on startup to warn the user. It's also an issue since we've moved tools like crossgen to nativeAOT, and setting variables like this during build means child procs also prints the error message - even if no crash is going to happen. This defers the message - and while we are not proactive at letting the user know, it's a better user experience for many cases where native AOT is used.

Regression

  • Yes
  • No

Testing

Main has had this change for a while and is stable.

Risk

Low. Changes eliminate unnecessary file system checks during initialization and defer error detection to the point where the binary is actually needed (execv call). The actual dump creation logic and all success paths remain unchanged. Error messages now appear only when dumps are actually attempted, preventing spurious warnings during initialization.

Copilot AI and others added 8 commits March 24, 2026 20:03
…Line

Move the error message from PalCreateDumpInitialize to BuildCreateDumpCommandLine.
This prevents the error from appearing during initialization when createdump binary
doesn't exist, and instead only shows it when a dump is actually being created.
This allows DOTNET_DbgEnableMiniDump to be set even when crossgen is involved.

Co-authored-by: steveisok <471438+steveisok@users.noreply.github.com>
Co-authored-by: steveisok <471438+steveisok@users.noreply.github.com>
…mandLine

Keep the original logic where the path is not stored if the file doesn't exist.
Only move the fprintf from PalCreateDumpInitialize to BuildCreateDumpCommandLine.

Co-authored-by: steveisok <471438+steveisok@users.noreply.github.com>
Co-authored-by: steveisok <471438+steveisok@users.noreply.github.com>
Add a new global flag g_warnCreateDumpMissing to distinguish between:
- DOTNET_DbgEnableMiniDump not set (no warning needed)
- DOTNET_DbgEnableMiniDump set but createdump missing (warning on dump creation)

Set the flag in PalCreateDumpInitialize when createdump is not found.
Check the flag in both dump creation code paths:
- BuildCreateDumpCommandLine (called by PalGenerateCoreDump)
- PalCreateCrashDumpIfEnabled (called on crash)

This ensures the warning only appears when actually trying to create a dump,
not during initialization.

Co-authored-by: noahfalk <6243776+noahfalk@users.noreply.github.com>
Extract the error message into g_createDumpMissingMessage constant to avoid
duplication and make future updates easier.

Co-authored-by: noahfalk <6243776+noahfalk@users.noreply.github.com>
Remove g_warnCreateDumpMissing flag and stat() check during initialization.
Instead, detect the missing createdump binary when execv() returns ENOENT
error and print the error message at that point. This defers the check
until dump creation time, avoiding unnecessary file system checks during
initialization.

Co-authored-by: noahfalk <6243776+noahfalk@users.noreply.github.com>
@hoyosjs hoyosjs added the Servicing-consider Issue for next servicing release review label Mar 24, 2026
@JulieLeeMSFT JulieLeeMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Mar 25, 2026
@JulieLeeMSFT JulieLeeMSFT added this to the 10.0.x milestone Mar 25, 2026
@JulieLeeMSFT JulieLeeMSFT merged commit fcef7f9 into release/10.0 Mar 25, 2026
102 of 104 checks passed
@JulieLeeMSFT JulieLeeMSFT deleted the backport/pr-122986-to-release/10.0 branch March 25, 2026 16:05
@rbhanda rbhanda modified the milestones: 10.0.x, 10.0.7 Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-NativeAOT-coreclr Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hard to use DOTNET_DbgEnableMiniDump when crossgen is involved somewhere in the build

5 participants