Remove createdump PID argument - #133330
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
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. |
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
🟡 Changes recommended
User-facing help/docs and CLI error messaging should be tightened to clearly describe “parent process only” behavior and avoid misleading output for unknown arguments.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR changes xplat dump generation so createdump no longer accepts a target PID argument on Unix, and instead always targets the parent process (matching the existing Windows security model). It updates both CoreCLR PAL and NativeAOT dump launching to stop passing the PID, and refreshes related user-facing help/docs.
Changes:
- Remove PID argument construction/passing from CoreCLR PAL
createdumpcommand-line building and invocation. - Remove PID argument passing from NativeAOT Unix dump invocation (
--nativeaotremains as the final argument). - Update
createdumpCLI parsing/help and the design doc to reflect the “parent process only” behavior.
File summaries
| File | Description |
|---|---|
| src/coreclr/pal/src/thread/process.cpp | Stops formatting/passing the target PID to createdump from CoreCLR PAL crash dump generation. |
| src/coreclr/nativeaot/Runtime/unix/PalCreateDump.cpp | Removes formatting/passing the app PID to createdump for NativeAOT Unix dump generation. |
| src/coreclr/debug/createdump/createdumpmain.cpp | Updates CLI contract: no positional PID; Unix defaults PID to getppid() to target the parent process. |
| docs/design/coreclr/botr/xplat-minidump-generation.md | Updates documentation to remove pid from usage and describe parent-only targeting. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 3
- Review effort level: Lite
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The behavioral change is implemented consistently across CoreCLR/NativeAOT/tooling and the remaining feedback is limited to minor wording fixes.
Review details
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
docs/design/coreclr/botr/xplat-minidump-generation.md:92
- The command-line usage block has the same grammatical error as the tool help: “Hostname return by gethostname()” should be “Hostname returned by gethostname()”.
createdump [options]
-f, --name - dump path and file name. The default is '/tmp/coredump.%p'. These specifiers are substituted with following values:
%p PID of dumped process.
%e The process executable filename.
%h Hostname return by gethostname().
src/coreclr/debug/createdump/createdumpmain.cpp:20
- The help text has a small grammatical error: “Hostname return by gethostname()” should be “Hostname returned by gethostname()”.
"createdump writes a dump of its parent process; a target PID cannot be specified.\n"
"-f, --name - dump path and file name. The default is '" DEFAULT_DUMP_PATH DEFAULT_DUMP_TEMPLATE "'. These specifiers are substituted with following values:\n"
" %p PID of dumped process.\n"
" %e The process executable filename.\n"
" %h Hostname return by gethostname().\n"
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Lite
Align Linux/macOS createdump behavior with Windows by removing the target PID command-line argument and always dumping the parent process that launched createdump.