Skip to content

Use diagnostics IPC for non-Windows hang dump capture - #69007

Merged
tommcdon merged 2 commits into
dotnet:mainfrom
tommcdon:dev/tommcdon/use-diagnostics-ipc-for-hang-dumps
Sep 3, 2026
Merged

tommcdon merged 2 commits into
dotnet:mainfrom
tommcdon:dev/tommcdon/use-diagnostics-ipc-for-hang-dumps

Conversation

@tommcdon

@tommcdon tommcdon commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

Update CaptureHangDumps.sh to request minidumps through the runtime diagnostics IPC socket, avoiding dependencies on external tooling.

The script now:

  • Locates each process's dotnet-diagnostic-<pid>-*-socket.
  • Sends the legacy CreateCoreDump (0x0101) IPC command using nc -U.
  • Encodes the output path as UTF-16LE and requests a normal/minidump.
  • Validates the 24-byte Server/OK response and zero HRESULT before counting the dump as captured.
  • Reports missing tools, sockets, transport failures, and nonzero HRESULT responses as warnings.
  • Preserves the existing process selection, dump limits, filenames, and artifact upload behavior.

Validation

  • Produced an ELF minidump, loaded the dump with dotnet-dump analyze, SOS reported three managed threads and resolved Program.<Main> on the captured stack.

Request minidumps through the runtime diagnostics socket instead of invoking createdump directly. Validate the Server/OK response before counting each capture.

Co-authored-by: Copilot <[email protected]>
@tommcdon tommcdon self-assigned this Sep 2, 2026
Copilot AI lite review requested due to automatic review settings September 2, 2026 20:03
@tommcdon
tommcdon requested review from a team and wtgodbe as code owners September 2, 2026 20:03

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

The new IPC transport uses nc without any timeout, which can block the cancel-timeout window and prevent reliable dump capture/upload in hang scenarios.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates the non-Windows hang-dump capture script to request minidumps via the .NET runtime diagnostics IPC socket, removing the dependency on createdump and handling transport/response validation in-script.

Changes:

  • Adds IPC packet construction helpers and a capture_dump implementation that sends CreateCoreDump over dotnet-diagnostic-<pid>-*-socket.
  • Replaces createdump discovery/usage (and macOS sudo handling) with required-tool checks for iconv, nc, and od.
  • Validates the IPC response before counting a dump as captured and emits warnings on failures.
File summaries
File Description
eng/scripts/CaptureHangDumps.sh Switches hang dump capture from createdump to diagnostics IPC minidump requests and adds tool/response validation.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread eng/scripts/CaptureHangDumps.sh Resolved
@Youssef1313 Youssef1313 added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Sep 2, 2026
Use the timeout utility when available and a Bash watchdog fallback otherwise so stalled diagnostic sockets cannot consume the cancellation window.

Co-authored-by: Copilot <[email protected]>
@tommcdon
tommcdon merged commit 1541dd4 into dotnet:main Sep 3, 2026
29 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants