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
When a hang or crash occurs when running tests in the C/I environment on macOS, we are unable to analyze the dump file because none of our team members owns a Mac. It would be handy to be able to collect a dump in GCDump format, which can be loaded cross-platform.
I asked internally and there is no pre-made package for this, just the dotnet gc-dump tool, and that is 5MB package that we probably don't want to restore for all projects.
I'm not sure if gcdump will be able to help rooting down a crash/hang actually. So it's hard to see if this is something of value that we want to do or not.
When a hang or crash occurs when running tests in the C/I environment on macOS, we are unable to analyze the dump file because none of our team members owns a Mac. It would be handy to be able to collect a dump in GCDump format, which can be loaded cross-platform.
At least for crashes, I think #7168 might be a better option here. I'm not sure if it's possible to have something similar for hangs or not.
Thanks for the suggestion, Bart Koelman (@bart-vmware)! After looking into this, I'd like to suggest a different approach that should address your core pain point.
Since MTP 2.3 we will ship a --crash-report option on the CrashDump extension (added via #7168 / #8191). It uses .NET's DOTNET_EnableCrashReportOnly to produce a small *.crashreport.json file alongside (or instead of) the binary dump, containing the managed thread stacks of the crashing process. It's plain JSON, fully cross‑platform, and tiny — so a macOS CI crash can be triaged from Windows or Linux without anyone owning a Mac.
A few notes on the gcdump‑as‑dump‑type idea:
For crashes specifically, gcdump isn't really feasible. Unlike minidump/heap/full, the runtime has no DOTNET_* switch to emit a gcdump when a process crashes. Gcdump is collected via EventPipe against a live process, so by the time the test host has crashed it's too late to capture anything meaningful. We'd have to continuously snapshot the heap on a side thread/process during the run, which is a structural change with a perf cost.
For hangs it's technically possible, but the value is narrow: a gcdump contains the managed object graph only — no thread stacks, no lock state, no native frames — so it can't diagnose the common hang causes (deadlocks, infinite loops, blocking P/Invoke, async deadlocks). It only really helps for hangs caused by heap bloat / GC thrashing.
It would also pull in Microsoft.Diagnostics.Tracing.TraceEvent (~5 MB+), which is the same concern Jakub Jareš (@nohwnd) raised above.
Given that, for your CI scenario I'd recommend trying --crash-report (optionally with --crashdump-type Mini for a small binary dump too), and reserving dotnet-gcdump as an out‑of‑band tool for the rarer "I suspect a managed memory leak" case. If you try the crash report and it doesn't cover what you need, let us know what's missing — we'd rather invest in a richer cross‑platform hang/crash text report than in gcdump support.
Closing this as "won't fix" for now, but happy to reopen if the crash report turns out to be insufficient for your workflow.
On Windows, --crash-report is rejected at command-line validation time because the .NET runtime ignores DOTNET_EnableCrashReport / DOTNET_EnableCrashReportOnly on Windows (see dotnet/runtime#80191). The error message points users to --crashdump as the alternative.
This means we'll need different test commands per OS in GitHub Actions workflows. It would be more practical to only log an info-level message on Windows that the switch is ignored. rather than failing on it. We build/run with warnaserror, so chnging to a warning wouldn't help either.
This means we'll need different test commands per OS in GitHub Actions workflows. It would be more practical to only log an info-level message on Windows that the switch is ignored. rather than failing on it. We build/run with warnaserror, so chnging to a warning wouldn't help either.
I'll try to think about what I can do. For MTP, we are trying to be "strict" because we have had too many issues and support on VSTest that's coming from having soft messages (sadly not everyone is observing their CI).
Activity
nohwnd commentedon Dec 15, 2025
I am looking for package that could do this without hacks, like we have Microsoft.Diagnostics.NETCore.Client for the normal dump.
nohwnd commentedon Dec 16, 2025
I asked internally and there is no pre-made package for this, just the dotnet gc-dump tool, and that is 5MB package that we probably don't want to restore for all projects.
Youssef1313 commentedon Jan 8, 2026
I'm not sure if gcdump will be able to help rooting down a crash/hang actually. So it's hard to see if this is something of value that we want to do or not.
At least for crashes, I think #7168 might be a better option here. I'm not sure if it's possible to have something similar for hangs or not.
Evangelink commentedon May 28, 2026
Thanks for the suggestion, Bart Koelman (@bart-vmware)! After looking into this, I'd like to suggest a different approach that should address your core pain point.
Since MTP 2.3 we will ship a --crash-report option on the CrashDump extension (added via #7168 / #8191). It uses .NET's DOTNET_EnableCrashReportOnly to produce a small *.crashreport.json file alongside (or instead of) the binary dump, containing the managed thread stacks of the crashing process. It's plain JSON, fully cross‑platform, and tiny — so a macOS CI crash can be triaged from Windows or Linux without anyone owning a Mac.
A few notes on the gcdump‑as‑dump‑type idea:
Given that, for your CI scenario I'd recommend trying --crash-report (optionally with --crashdump-type Mini for a small binary dump too), and reserving dotnet-gcdump as an out‑of‑band tool for the rarer "I suspect a managed memory leak" case. If you try the crash report and it doesn't cover what you need, let us know what's missing — we'd rather invest in a richer cross‑platform hang/crash text report than in gcdump support.
Closing this as "won't fix" for now, but happy to reopen if the crash report turns out to be insufficient for your workflow.
bart-vmware commentedon May 28, 2026
Thanks for the explanation, it sounds reasonable.
What concerns me is the following from #8191:
This means we'll need different test commands per OS in GitHub Actions workflows. It would be more practical to only log an info-level message on Windows that the switch is ignored. rather than failing on it. We build/run with warnaserror, so chnging to a warning wouldn't help either.
Evangelink commentedon May 28, 2026
I'll try to think about what I can do. For MTP, we are trying to be "strict" because we have had too many issues and support on VSTest that's coming from having soft messages (sadly not everyone is observing their CI).
bart-vmware commentedon May 28, 2026
How about emitting the error, but with a message that explains to set an environment variable to suppress it?