Skip to content

[release/10.0] Enhance crash dump collection options in RemoteExecutor - #17060

Merged
hoyosjs merged 11 commits into
release/10.0from
juhoyosa/port-crash-dumps-10-0
Jul 8, 2026
Merged

[release/10.0] Enhance crash dump collection options in RemoteExecutor#17060
hoyosjs merged 11 commits into
release/10.0from
juhoyosa/port-crash-dumps-10-0

Conversation

@hoyosjs

@hoyosjs hoyosjs commented Jun 28, 2026

Copy link
Copy Markdown
Member

Summary

This is the release/10.0 servicing port of #16716 ("Enhance crash dump collection options in RemoteExecutor"). It brings the crash-dump-collection feature to Microsoft.DotNet.RemoteExecutor:

  • New CrashDumpCollectionType enum and EnableTimeoutDumpCollection / CrashDumpCollectionType / CrashDumpPath options on RemoteInvokeOptions.
  • Env-var–based crash dump control passed through to remote processes.
  • Refactored CollectTimeoutDiagnostics that uses Microsoft.Diagnostics.NETCore.Client DiagnosticsClient.WriteDump on .NET Core plus CLRMD v4 thread enumeration; the .NET Framework #else path still uses MiniDump.cs.
  • New tests in RemoteExecutorTests.cs.

The feature source/test files (RemoteExecutor.cs, RemoteInvokeOptions.cs, RemoteInvokeHandle.cs, RemoteExecutorTests.cs) are taken from #16716.

Dependency handling (the release/10.0 adaptation)

main already had CLRMD (Microsoft.Diagnostics.Runtime) on v4 with high enough Azure/runtime central versions. release/10.0 is on older dependencies, so the feature's required upgrades needed adapting:

  • Central (Directory.Packages.props): Microsoft.Diagnostics.Runtime 1.0.54.1.735601 and add Microsoft.Diagnostics.NETCore.Client 0.2.721401. SystemMemoryVersion 4.5.54.6.3 (required by CLRMD's net462 leg; low-risk facade bump, whole-solution restore is clean).
  • Project-scoped VersionOverride on the RemoteExecutor src + tests projects only for the transitive Azure/runtime packages CLRMD pulls in: Azure.Core 1.53.0, Azure.Identity 1.21.0, Microsoft.Identity.Client 4.83.1, System.Collections.Immutable 10.0.7, Microsoft.Bcl.AsyncInterfaces 10.0.7, Microsoft.Extensions.DependencyInjection.Abstractions 10.0.7, Microsoft.Extensions.FileProviders.Abstractions 10.0.7, System.Text.Encodings.Web 10.0.7, System.Text.Json 10.0.7.

Why VersionOverride instead of a central bump: applying those Azure/runtime bumps centrally would break the repo's net472 MSBuild build-task projects, which are capped at 8.0.x by the toolset MSBuild.exe binding redirects (see eng/BuildTask.Packages.props). Scoping the bumps to RemoteExecutor keeps the build tasks unaffected while still satisfying CLRMD. NU1510 is suppressed on those two projects because some overridden packages are provided by the shared framework on .NETCoreApp targets. Central runtime versions in Version.Details.props/.xml are left at baseline.

Intentionally excluded

The Managed Identity / DefaultIdentityTokenCredential change from #16716 is not ported — it requires Azure.Identity 1.21 repo-wide and is unrelated to crash dumps.

Port of #16716.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 28, 2026 05:39

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 ports the “enhance crash dump collection options in RemoteExecutor” feature to release/10.0, adding configurable crash-dump behavior for RemoteExecutor subprocesses and modernizing timeout diagnostics (including updated diagnostic dependencies required on this branch).

Changes:

  • Adds CrashDumpCollectionType, CrashDumpPath, and EnableTimeoutDumpCollection options to control crash-dump environment variables and timeout dump behavior.
  • Refactors timeout diagnostics to use DiagnosticsClient.WriteDump on .NET (Core) and CLRMD v4 thread enumeration, while keeping the legacy MiniDump path for .NET Framework.
  • Updates package versions (CLRMD upgrade + new NETCore.Client) and adds tests validating crash-dump env-var behavior and dump creation.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Directory.Packages.props Updates central package versions; adds Microsoft.Diagnostics.NETCore.Client and upgrades CLRMD to v4.
eng/Versions.props Bumps SystemMemoryVersion to satisfy upgraded dependency requirements.
src/Microsoft.DotNet.RemoteExecutor/src/RemoteExecutor.cs Sets/removes DOTNET_Dbg* env vars based on new RemoteInvokeOptions crash-dump settings.
src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs Adds EnableTimeoutDumpCollection gate and refactors timeout dump + thread diagnostics using DiagnosticsClient/CLRMD v4.
src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeOptions.cs Introduces crash-dump configuration API surface (CrashDumpCollectionType, CrashDumpPath, EnableTimeoutDumpCollection).
src/Microsoft.DotNet.RemoteExecutor/src/Microsoft.DotNet.RemoteExecutor.csproj Adds NETCore.Client dependency (netcore only), removes MiniDump.cs from netcore compilation, and applies scoped VersionOverrides.
src/Microsoft.DotNet.RemoteExecutor/tests/RemoteExecutorTests.cs Adds tests for crash-dump env-var behavior and dump creation on crash.
src/Microsoft.DotNet.RemoteExecutor/tests/Microsoft.DotNet.RemoteExecutor.Tests.csproj Mirrors scoped VersionOverrides to keep test restore graph consistent with src project.

Comment thread src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs Outdated
Comment thread src/Microsoft.DotNet.RemoteExecutor/tests/RemoteExecutorTests.cs Outdated
hoyosjs and others added 2 commits June 28, 2026 22:37
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 29, 2026 21:06

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Comment thread src/Microsoft.DotNet.RemoteExecutor/tests/RemoteExecutorTests.cs
Comment thread Directory.Packages.props
Comment thread Directory.Packages.props
Comment thread src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs
Comment thread src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs
Comment thread src/Microsoft.DotNet.RemoteExecutor/tests/RemoteExecutorTests.cs Outdated
- Use Invoke(...).Dispose() instead of unused 'using' locals in three
  crash-dump env-var tests for consistency with the rest of the file
- Inline dumpFiles into SpinWait.SpinUntil in CrashDumpCollection_CreatesDumpOnCrash
- Reword inaccurate #if NETCOREAPP comment in RemoteInvokeHandle.cs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hoyosjs
hoyosjs marked this pull request as ready for review June 30, 2026 17:55
Copilot AI review requested due to automatic review settings June 30, 2026 17:55

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs
Comment thread src/Microsoft.DotNet.RemoteExecutor/tests/RemoteExecutorTests.cs
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 30, 2026 18:04

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread Directory.Packages.props Outdated
Comment thread Directory.Packages.props Outdated
Comment thread src/Microsoft.DotNet.RemoteExecutor/tests/RemoteExecutorTests.cs Outdated
@hoyosjs hoyosjs changed the title Enhance crash dump collection options in RemoteExecutor (release/10.0) [release/10.0] Enhance crash dump collection options in RemoteExecutor Jun 30, 2026
@hoyosjs

hoyosjs commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

@mmitche - mind taking a look at this? Had to pin some versions as backporting the full thing means things start to change a lot of things.

@mmitche mmitche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

.NET package pinning looks incorrect. Otherwise fine.

…vert global bumps, refine crash-dump test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Microsoft.Diagnostics.Runtime 4.0.732101 hard-required Azure.Identity 1.21.0 ->
Azure.Core 1.53.0, which dragged in the full .NET 10 (10.0.x) runtime cascade and
forced nine local VersionOverrides plus Azure package pins in RemoteExecutor.

Lowering to the stable CLRMD 4.0.725402 (and matching NETCore.Client 0.2.652701)
is satisfied by the repo's existing Azure.Core 1.47.0 / Azure.Identity 1.14.2, so
no Azure or 10.0.x overrides are needed. The only remaining conflict is a small set
of stable 9.0.x transitive packages (System.Collections.Immutable 9.0.10,
Microsoft.Bcl.AsyncInterfaces 9.0.8, Microsoft.Extensions.DependencyInjection.Abstractions
9.0.8) that exceed release/10.0's flowed 9.0.0-rc.2 central versions; those three are
bumped up via project-local VersionOverride instead of touching the central
(Maestro-flowed) versions repo-wide.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 01:02

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread Directory.Packages.props Outdated
Comment thread src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs
…ride

Per review feedback, move the three stable 9.0.x runtime-package bumps required
by Microsoft.Diagnostics.Runtime 4.0.725402 / NETCore.Client 0.2.652701 from
project-local VersionOverrides into the central version definitions:

- Microsoft.Bcl.AsyncInterfaces 9.0.0-rc.2 -> 9.0.8
- Microsoft.Extensions.DependencyInjection.Abstractions 9.0.0-rc.2 -> 9.0.8
- System.Collections.Immutable 9.0.0-rc.2 -> 9.0.10

Values are updated in eng/Version.Details.props (the PackageVersion properties)
with the matching Dependency versions in eng/Version.Details.xml kept in sync so
darc stays consistent. The VersionOverride ItemGroups and NU1510 suppressions are
removed from both RemoteExecutor csproj files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 01: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.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Comment thread eng/Version.Details.xml Outdated
Comment thread eng/Version.Details.xml Outdated
Comment thread eng/Version.Details.xml
Comment thread src/Microsoft.DotNet.RemoteExecutor/tests/RemoteExecutorTests.cs
…a VersionOverride

Microsoft.Diagnostics.Runtime 4.0.732101 + Microsoft.Diagnostics.NETCore.Client 0.2.721401
pull in newer Azure.Identity/Azure.Core and 10.0.x runtime packages than this servicing
branch's central versions. Applying those bumps centrally would break the repo's net472
MSBuild build tasks, which are capped at 8.0.x by the toolset MSBuild.exe binding redirects
(eng/BuildTask.Packages.props). Scope the required bumps to the RemoteExecutor src + tests
projects via VersionOverride instead, leaving central versions at baseline.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 01:44
…ion allocation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.

Comment thread Directory.Packages.props Outdated
Comment on lines +93 to +94
<PackageVersion Include="Microsoft.Diagnostics.NETCore.Client" Version="0.2.721401" />
<PackageVersion Include="Microsoft.Diagnostics.Runtime" Version="4.0.732101" />
Comment on lines +29 to +31
<PropertyGroup>
<NoWarn>$(NoWarn);NU1510</NoWarn>
</PropertyGroup>
Comment on lines +289 to +290
catch { }
}
Comment on lines +33 to +35
<PackageReference Include="Azure.Core" VersionOverride="1.53.0" />
<PackageReference Include="Azure.Identity" VersionOverride="1.21.0" />
<PackageReference Include="Microsoft.Identity.Client" VersionOverride="4.83.1" />
Comment on lines +36 to +40
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" VersionOverride="10.0.7" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" VersionOverride="10.0.7" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Abstractions" VersionOverride="10.0.7" />
<PackageReference Include="System.Collections.Immutable" VersionOverride="10.0.7" />
<PackageReference Include="System.Text.Encodings.Web" VersionOverride="10.0.7" />
Comment on lines +22 to +24
<PackageReference Include="Azure.Core" VersionOverride="1.53.0" />
<PackageReference Include="Azure.Identity" VersionOverride="1.21.0" />
<PackageReference Include="Microsoft.Identity.Client" VersionOverride="4.83.1" />
Comment on lines +25 to +29
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" VersionOverride="10.0.7" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" VersionOverride="10.0.7" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Abstractions" VersionOverride="10.0.7" />
<PackageReference Include="System.Collections.Immutable" VersionOverride="10.0.7" />
<PackageReference Include="System.Text.Encodings.Web" VersionOverride="10.0.7" />
Copilot AI review requested due to automatic review settings July 8, 2026 01:48

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment on lines +206 to +208
/// <summary>
/// Collects diagnostic information (dump + thread stacks) from the timed-out remote process.
/// </summary>
Copilot AI review requested due to automatic review settings July 8, 2026 19:18
@hoyosjs
hoyosjs enabled auto-merge (squash) July 8, 2026 19:20

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread Directory.Packages.props
@ViktorHofer

Copy link
Copy Markdown
Member

This broke building with VS msbuild repos that use 10.0 Arcade: #17103. The unconditional SystemMemoryVersion bump, more precisely.

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.

4 participants