BadImageFormatException crash after tests complete with --coverage on .NET 10 + NUnit
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- csharp
- 領域
- devtools, testing-qa
調査の方向性
まず、global.json に記載された .NET 10 プロジェクトで dotnet test --coverage --coverage-output-format cobertura を実行して失敗を再現し、その後、coverage なしの dotnet test と比較します。dotnet-coverage collect のエントリポイントを含め、Microsoft Testing Platform と CodeCoverage のクリーンアップ経路を追跡します。coverage が生成され、BadImageFormatException が発生せずにクリーンアップが完了し、プロセスがコード 0 で終了すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
When running tests with --coverage flag using Microsoft Testing Platform (MTP) on .NET 10 with NUnit, tests pass successfully and the coverage file is generated, but the process crashes during async cleanup with BadImageFormatException: Index not found.
Environment
- OS: Ubuntu Linux (GitHub Actions runner) and macOS ARM64
- .NET SDK: 10.0.101
- Test Framework: NUnit 4.4.0
- Test Adapter: NUnit3TestAdapter 6.1.0
- MTP Packages:
- Microsoft.Testing.Platform.MSBuild 2.0.2
- Microsoft.Testing.Extensions.Telemetry 2.0.2
- Microsoft.Testing.Extensions.CodeCoverage 18.3.1 and 18.3.2 (both crash)
Reproduction
- Create a .NET 10 test project with NUnit and MTP enabled
- Configure
global.jsonwith"test": { "runner": "Microsoft.Testing.Platform" } - Run:
dotnet test --coverage --coverage-output-format cobertura
Expected Behavior
Tests complete and process exits with code 0.
Actual Behavior
Tests pass (762 passed in our case), coverage file IS generated, but then:
NUnit Adapter 6.1.0.0: Test execution complete
Error output: Unhandled exception. System.BadImageFormatException: Index not found. (0x80131124)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__124_1(Object state)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
at System.Threading.Thread.StartCallback()
In process file artifacts produced:
- /path/to/TestResults/<guid>.cobertura.xml
Test run summary: Failed!
error: 1
total: 764
failed: 0
succeeded: 762
skipped: 2
Exit code: 134 (SIGABRT)
Workaround
Running without --coverage flag works fine:
dotnet test # Works, exit code 0
dotnet test --coverage # Crashes with exit code 134
Notes
- The crash occurs AFTER tests complete and coverage file is written
- The exception is in async cleanup/finalization phase
- Tested with both CodeCoverage 18.3.1 and 18.3.2 - same crash
dotnet-coverage collectCLI tool also shows "Profiler was not initialized"
- 主要言語
- C#
- スター
- 125
- フォーク
- 17
- 平均マージ
- 1時間 15分
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/codecoverage のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
microsoft/codecoverage#252 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
microsoft/codecoverage#251 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
microsoft/codecoverage#249 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
microsoft/codecoverage#220 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
microsoft/codecoverage#218 ·
microsoft/codecoverage の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
MicrosoftLearning/PL-400_Microsoft-Power-Platform-Developer#231 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
joinrpg/joinrpg-net#5313 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信