You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor createdump so the process-inspection and dump-writing code that can be shared with a linked NativeAOT createdump lives under src/coreclr/debug/createdump/shared.
This PR is preparatory refactoring only. It does not enable linked createdump for NativeAOT.
Changes
Split process initialization, thread snapshots, memory-map enumeration, dump-region selection, option parsing, and dump naming into shared implementations.
Keep external createdump's DAC integration and std::set-based region storage in CrashInfo while exposing only the operations required by the shared algorithms.
Add lightweight shared DynamicArray and owned-string utilities that do not require standard-library containers.
Make the ELF writer generic over the module-mapping and dump-region containers, allowing external createdump to use std::set and a future linked implementation to use DynamicArray without copying regions.
Separate opening a dump from writing it and retain the existing ELF and Mach-O writer paths.
Preserve existing external createdump behavior, including dump naming, diagnostics, crash metadata, thread contexts, and partial-file cleanup.
The runtime-diagnostics pipeline was run for this commit and the dump tests pass.
Note
This PR description was generated with GitHub Copilot.
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.
AddOrReplaceModuleMapping now returns false when allocating the owned filename fails, but this caller only traces the failure and continues. That allows dump generation to succeed with a missing or stale module mapping. Propagate the failure so the existing GatherCrashInfo error path aborts the dump.
SetFileName can fail on OOM, but returning from this void visitor merely skips the segment and lets dump creation report success with an incomplete module map. Propagate the failure through segment enumeration or fail fast instead of silently continuing.
This issue also appears on line 368 of the same file.
Validate that each value-taking option has a following argument before incrementing argv. For example, invoking createdump --signal currently calls atoi(nullptr) and can crash instead of reporting invalid usage. The same check is needed for -f/--name, --crashthread, --code, --errno, --address, --exception-record, and -l/--logtofile.
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
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.
Summary
Refactor createdump so the process-inspection and dump-writing code that can be shared with a linked NativeAOT createdump lives under
src/coreclr/debug/createdump/shared.This PR is preparatory refactoring only. It does not enable linked createdump for NativeAOT.
Changes
std::set-based region storage inCrashInfowhile exposing only the operations required by the shared algorithms.DynamicArrayand owned-string utilities that do not require standard-library containers.std::setand a future linked implementation to useDynamicArraywithout copying regions.The runtime-diagnostics pipeline was run for this commit and the dump tests pass.
Note
This PR description was generated with GitHub Copilot.