[release/10.0] Defer DOTNET_DbgEnableMiniDump error message until dump creation#126055
Merged
JulieLeeMSFT merged 8 commits intorelease/10.0from Mar 25, 2026
Merged
Conversation
…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
approved these changes
Mar 24, 2026
jkotas
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #122986 to release/10.0
/cc @hoyosjs @copilot
Customer Impact
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
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.