Add DOTNET_DbgCreateDumpToolPath to override createdump directory (NativeAOT only)#122989
Merged
Add DOTNET_DbgCreateDumpToolPath to override createdump directory (NativeAOT only)#122989
Conversation
Co-authored-by: steveisok <471438+steveisok@users.noreply.github.com>
Co-authored-by: steveisok <471438+steveisok@users.noreply.github.com>
Co-authored-by: steveisok <471438+steveisok@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add ability to override createdump tool path
Add DOTNET_DbgCreateDumpToolPath to override createdump location
Jan 7, 2026
This was referenced Jan 8, 2026
Open
jkotas
reviewed
Jan 9, 2026
Contributor
|
Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag |
…dbgcreatdumptoolpath
… validation - Changed DbgCreateDumpToolPath to accept a directory path instead of full executable path - The runtime now concatenates the directory with "createdump" like the default behavior - Removed stat() validation as it was removed in commit c507305 - Updated documentation to clarify this is NativeAOT only and the variable accepts a directory path - Updated usage example to reflect the directory path usage Co-authored-by: steveisok <471438+steveisok@users.noreply.github.com>
- Initialize buffer with '\0' before using strncat - Use proper buffer size calculations in strncat calls to prevent buffer overruns - Ensures safe string concatenation following C string best practices Co-authored-by: steveisok <471438+steveisok@users.noreply.github.com>
- Calculate exact buffer size based on whether slash is needed - Follow same pattern as default code path using strncpy and strncat - More readable and maintainable code structure Co-authored-by: steveisok <471438+steveisok@users.noreply.github.com>
Copilot
AI
changed the title
Add DOTNET_DbgCreateDumpToolPath to override createdump location
Add DOTNET_DbgCreateDumpToolPath to override createdump directory (NativeAOT only)
Jan 10, 2026
jkotas
reviewed
Jan 11, 2026
Changed "ignored in CoreCLR" to "ignored otherwise" since NativeAOT uses a stripped-down version of CoreCLR, making the original wording ambiguous. Co-authored-by: steveisok <471438+steveisok@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds a new environment variable DOTNET_DbgCreateDumpToolPath to allow NativeAOT applications to specify a custom directory where the createdump tool is located. This addresses scenarios where createdump is not shipped with the NativeAOT runtime, enabling users to provide their own dump generation tool.
Changes:
- Modified
PalCreateDumpInitialize()to check forDOTNET_DbgCreateDumpToolPathenvironment variable and use it to locate createdump - Added if/else logic to support both custom path and default library-based path discovery
- Updated documentation to describe the new environment variable and its NativeAOT-only support
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/coreclr/nativeaot/Runtime/unix/PalCreateDump.cpp | Adds environment variable check and custom path handling for createdump tool location with proper memory management and path concatenation logic |
| docs/design/coreclr/botr/xplat-minidump-generation.md | Documents the new DOTNET_DbgCreateDumpToolPath environment variable with usage examples and NativeAOT-only clarification |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
jkotas
reviewed
Jan 13, 2026
jkotas
approved these changes
Jan 13, 2026
jkotas
added a commit
that referenced
this pull request
Jan 14, 2026
… conditions (#123074) Fixes potential crashes or hangs during process shutdown due to race conditions in vector destructor execution. Noticed while reviewing #122989 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Jan Kotas <jkotas@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
steveisok
added a commit
to steveisok/docs
that referenced
this pull request
Jan 14, 2026
Documents new environment variable added in dotnet/runtime#122989 where you can point to an alternate directory where the createdump tool lives. Works only with NativeAOT .NET 11 and above.
steveisok
added a commit
to dotnet/docs
that referenced
this pull request
Jan 14, 2026
* Add DOTNET_DbgCreateDumpToolPath env variable and description Documents new environment variable added in dotnet/runtime#122989 where you can point to an alternate directory where the createdump tool lives. Works only with NativeAOT .NET 11 and above. * Update docs/core/diagnostics/collect-dumps-crash.md Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --------- Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Adds
DOTNET_DbgCreateDumpToolPathenvironment variable to allow specifying a directory path where the createdump tool is located. In scenarios where createdump is not shipped with the NativeAOT runtime, users can now provide their own dump generation tool.Note: This environment variable is only supported in NativeAOT applications and is ignored otherwise (not in other runtime configurations).
Implementation
PalCreateDumpInitialize()to checkDOTNET_DbgCreateDumpToolPathfor a directory pathRhConfig::Environment::TryGetStringValue()Usage
The runtime will look for
/path/to/directory/createdumpCustomer Impact
Customers deploying NativeAOT in environments without createdump (custom distributions, minimal containers, embedded systems) currently cannot generate crash dumps. This prevents critical debugging in production scenarios.
Regression
No. This is a new opt-in feature with no impact on existing behavior. Only affects NativeAOT applications.
Testing
Risk
Low. New environment variable only used when explicitly set. Code path follows existing directory concatenation pattern used for default createdump lookup. No changes to existing dump generation logic. NativeAOT only, so no impact on other runtime configurations.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.