Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[BUG] Intermittent Windows 0xC0000005 crashes in MTP test hosts with CodeCoverage on .NET 10

未关闭
#249 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
csharp
领域
testing-qa

调研方向

Start by reproducing the failure with the provided dotnet test command on Windows using .NET 10, Microsoft Testing Platform, xUnit v3, and Microsoft.Testing.Extensions.CodeCoverage. Compare coverage-enabled and disabled runs, then review related issues #232, #203, and #205 plus the MTP CrashDump and CLR minidump diagnostics. Done means the native crash cause is isolated or a reliable diagnostic path and reproduction are established.

由索引模型根据 Issue 内容生成。

描述

Description

When running multiple .NET 10 test modules through Microsoft Testing Platform with Microsoft.Testing.Extensions.CodeCoverage enabled, one or more test-host processes intermittently terminate on Windows with exit code 0xC0000005 (-1073741819, access violation).

The affected test module varies between runs. Disabling coverage made the native host crashes disappear in a controlled Azure DevOps comparison.

This may be related to #232, but this report involves Windows, .NET 10, Microsoft Testing Platform, and multiple modules launched by one dotnet test invocation.

Steps to reproduce

Our pipeline runs 5 xUnit v3 test modules targeting net10.0.

With coverage enabled:

dotnet test --configuration debug --coverage --coverage-output-format cobertura --ignore-exit-code 8 --report-trx

The failure is intermittent. Across runs, different test-host processes terminate during the same overall test execution.

Example log:

==============================================================================
[Host] Selected Node version: Node24 (Strategy: Node24Strategy)
C:\Windows\system32\chcp.com 65001
Active code page: 65001
Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version.
D:\_tool\dotnet\dotnet.exe test --configuration debug --coverage --coverage-output-format cobertura --ignore-exit-code 8 --report-trx
Running tests from D:\vsts-agents\MXHOJ-VSOBLD05-agent1\_work\4\s\MiCourt.Rest.Webhooks.Gateway.Tests\bin\Debug\net10.0\MiCourt.Rest.Webhooks.Gateway.Tests.dll (net10.0|x64)
Running tests from D:\vsts-agents\MXHOJ-VSOBLD05-agent1\_work\4\s\MiCourt.Rest.Data.Common.Test\bin\Debug\net10.0\MiCourt.Rest.Data.Common.Test.dll (net10.0|x64)
Running tests from D:\vsts-agents\MXHOJ-VSOBLD05-agent1\_work\4\s\MiCourt.Rest.Data.Test\bin\Debug\net10.0\MiCourt.Rest.Data.Test.dll (net10.0|x64)
Running tests from D:\vsts-agents\MXHOJ-VSOBLD05-agent1\_work\4\s\MiCourt.Rest.Api.Test\bin\Debug\net10.0\MiCourt.Rest.Api.Test.dll (net10.0|x64)
Running tests from D:\vsts-agents\MXHOJ-VSOBLD05-agent1\_work\4\s\MiCourt.Rest.Webhooks.Configuration.Test\bin\Debug\net10.0\MiCourt.Rest.Webhooks.Configuration.Test.dll (net10.0|x64)
D:\vsts-agents\MXHOJ-VSOBLD05-agent1\_work\4\s\MiCourt.Rest.Webhooks.Gateway.Tests\bin\Debug\net10.0\MiCourt.Rest.Webhooks.Gateway.Tests.dll (net10.0|x64) failed (3s 536ms)
Exit code: -1073741819
Error disposing 'NamedPipeServer' corresponding to handshake:
0: 10600
1: X64
2: .NET 10.0.12
3: Microsoft Windows 10.0.20348
4: 1.0.0;1.1.0;1.2.0;1.3.0;1.4.0
5: TestHost
6: D:\vsts-agents\MXHOJ-VSOBLD05-agent1\_work\4\s\MiCourt.Rest.Webhooks.Gateway.Tests\bin\Debug\net10.0\MiCourt.Rest.Webhooks.Gateway.Tests.dll
7: 85322975f7a04b2b9b3a8341ef89ad9d
8: 5ac5acd49b2b4c068324e688e6bcbd99
10: run
13: 1
14: microsoft.codecoverage;microsoft.testing.trx
15: .coverage;.trx
RunCommand: D:\vsts-agents\MXHOJ-VSOBLD05-agent1\_work\4\s\MiCourt.Rest.Webhooks.Gateway.Tests\bin\Debug\net10.0\MiCourt.Rest.Webhooks.Gateway.Tests.exe
RunArguments: 
System.AggregateException: One or more errors occurred. (Pipe is broken.)
 ---> System.IO.IOException: Pipe is broken.
   at System.IO.Pipes.PipeStream.PipeValueTaskSource.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at Microsoft.DotNet.Cli.Commands.Test.IPC.NamedPipeServer.InternalLoopAsync(CancellationToken cancellationToken)
   at Microsoft.DotNet.Cli.Commands.Test.IPC.NamedPipeServer.<WaitConnectionAsync>b__17_0()
   --- End of inner exception stack trace ---

D:\vsts-agents\MXHOJ-VSOBLD05-agent1\_work\4\s\MiCourt.Rest.Data.Test\bin\Debug\net10.0\MiCourt.Rest.Data.Test.dll (net10.0|x64) Zero tests ran (6s 792ms)
Exit code: -1073741819
D:\vsts-agents\MXHOJ-VSOBLD05-agent1\_work\4\s\MiCourt.Rest.Webhooks.Configuration.Test\bin\Debug\net10.0\MiCourt.Rest.Webhooks.Configuration.Test.dll (net10.0|x64) passed (19s 569ms)
D:\vsts-agents\MXHOJ-VSOBLD05-agent1\_work\4\s\MiCourt.Rest.Data.Common.Test\bin\Debug\net10.0\MiCourt.Rest.Data.Common.Test.dll (net10.0|x64) passed (41s 011ms)
D:\vsts-agents\MXHOJ-VSOBLD05-agent1\_work\4\s\MiCourt.Rest.Api.Test\bin\Debug\net10.0\MiCourt.Rest.Api.Test.dll (net10.0|x64) passed (2m 14s 692ms)

The affected hosts do not produce their expected  .trx  or  .cobertura.xml  files. Other test modules continue and complete successfully.

The crash sequence logs show that the hosts were executing managed tests when they disappeared. The last active tests varied and used unrelated code paths, so they appear to be crash victims rather than deterministic causes.

Comparison without coverage

The same branch was run with coverage disabled. This run completed all test modules without native host crashes.

The previously affected test modules passed, and there were no  0xC0000005 , broken-pipe, or zero-test host failures.

Environment

• OS: Windows Server self-hosted Azure DevOps build agents
• Runtime/SDK: .NET SDK  10.0.0 
• Target framework:  net10.0 
• Architecture: x64
• Test platform: Microsoft Testing Platform selected by  global.json 
• Test framework: xUnit v3  4.0.1 
• Coverage extension:  Microsoft.Testing.Extensions.CodeCoverage   18.11.2 
• Coverage output format: Cobertura
• CI system: Azure DevOps Pipelines

Workaround

Disable CodeCoverage collection.

This prevents the native crashes but removes coverage data. Coverage with reduced test-module parallelism has not yet been tested as a separate comparison.

Diagnostics

The in-process MTP CrashDump extension and CLR minidump environment variables did not capture a usable dump for this native failure.

We can provide full Azure DevOps logs, project files, package assets, additional crash sequence logs, and a run with reduced module parallelism or verbose CodeCoverage diagnostics.

Related issues

• #232 — native instrumentation/access-violation process termination; closest related report
• #203 — CodeCoverage-related hard crash on .NET 10, with a different exception
• #205 — CodeCoverage test-isolation limitation

主要语言
C#
星标
125
派生
17
平均合并
1 小时 15 分钟
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/codecoverage 的其他 Issue

查看 microsoft/codecoverage 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。