Skip to content

Capture minidumps instead of full dumps for build/test hangs - #67441

Merged
wtgodbe merged 1 commit into
dotnet:mainfrom
wtgodbe:capture-minidump-hang-dumps
Jun 26, 2026
Merged

wtgodbe merged 1 commit into
dotnet:mainfrom
wtgodbe:capture-minidump-hang-dumps

Conversation

@wtgodbe

@wtgodbe wtgodbe commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

The non-Windows hang-dump capture step (eng/scripts/CaptureHangDumps.sh) captured full dumps (createdump --full). On a hang these are multi-GB (~5.6 GB each on the macOS quarantine leg), and capturing several of them plus uploading them as artifacts does not fit inside the 15-minute cancelTimeoutInMinutes grace window — so no hang dump is ever published.

This switches the capture to minidumps (createdump --normal), which are tens of MB, capture in seconds, and upload comfortably within the grace window.

Why this matters

The macOS quarantine test leg (Tests: macOS, def 86 / dnceng-public) has been intermittently hanging for ~2 hours and timing out. Investigating it requires the captured dump, but on every occurrence the dump never makes it off the agent. Concretely, on build 1482875's hung mac job:

  • Capture hang dumps: succeeded, but took ~6m45s producing 5×~5.6 GB cores.
  • Upload cores: failed after ~7m27s — killed at the 15-minute grace boundary; ~28 GB cannot upload in time. No log, no artifact.

So the dumps are captured on the agent every time; they just can't be uploaded. Shrinking them is the fix.

Why --normal is sufficient

createdump is .NET-aware: even a normal minidump includes the thread stacks and the runtime/module memory the DAC needs to walk managed stacks. SOS clrthreads / clrstack continue to work, which is exactly what a hang investigation needs (identify the hung process and its managed stack). Full heap inspection (dumpheap, object graphs) is not needed to root-cause a hang, and that is the only thing dropped.

Risk

Low. Only affects the diagnostic dump captured during the or(failed(), canceled()) grace window on build/test hangs; no product or test behavior changes.

The non-Windows hang-dump capture step (CaptureHangDumps.sh) used
`createdump --full`, producing multi-GB cores (~5.6GB each on the macOS
quarantine leg). Capturing several of these and uploading them as
artifacts does not fit inside the 15-minute cancelTimeout grace window:
capture alone burned ~7 minutes and the subsequent upload-cores.sh was
killed at the grace boundary, so no hang dump was ever published.

Switch to `createdump --normal` (minidump). createdump is .NET-aware and
still includes thread stacks plus the runtime/module memory the DAC
needs, so SOS `clrthreads`/`clrstack` continue to work to identify the
hung process and its managed stack -- which is what a hang investigation
needs. Dumps drop from gigabytes to tens of MB, capture in seconds, and
upload comfortably within the grace window.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings June 26, 2026 20:03
@wtgodbe
wtgodbe requested a review from a team as a code owner June 26, 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.

Pull request overview

This PR updates the non-Windows hang dump capture script to generate smaller diagnostic artifacts so hang dumps can be reliably uploaded within Azure Pipelines’ cancelTimeoutInMinutes grace window.

Changes:

  • Switch eng/scripts/CaptureHangDumps.sh from capturing full dumps (createdump --full) to minidumps (createdump --normal).
  • Add inline rationale documenting why minidumps are sufficient for hang investigations and why full dumps prevent successful artifact upload.

@wtgodbe
wtgodbe merged commit 742f6e2 into dotnet:main Jun 26, 2026
27 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants