Skip to content

Remove createdump PID argument - #133330

Open
tommcdon wants to merge 2 commits into
dotnet:mainfrom
tommcdon:dev/tommcdon/createdump_pid
Open

Remove createdump PID argument#133330
tommcdon wants to merge 2 commits into
dotnet:mainfrom
tommcdon:dev/tommcdon/createdump_pid

Conversation

@tommcdon

@tommcdon tommcdon commented Sep 7, 2026

Copy link
Copy Markdown
Member

Align Linux/macOS createdump behavior with Windows by removing the target PID command-line argument and always dumping the parent process that launched createdump.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tommcdon tommcdon self-assigned this Sep 7, 2026
Copilot AI lite review requested due to automatic review settings September 7, 2026 02:08
@azure-pipelines

Copy link
Copy Markdown
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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 createdump command-line building and invocation.
  • Remove PID argument passing from NativeAOT Unix dump invocation (--nativeaot remains as the final argument).
  • Update createdump CLI 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

Comment thread docs/design/coreclr/botr/xplat-minidump-generation.md Outdated
Comment thread src/coreclr/debug/createdump/createdumpmain.cpp
Comment thread src/coreclr/debug/createdump/createdumpmain.cpp
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 7, 2026 04:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants