BadImageFormatException crash after tests complete with --coverage on .NET 10 + NUnit
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- csharp
- Área
- devtools, testing-qa
Línea de trabajo
Comienza reproduciendo el fallo con el proyecto .NET 10 descrito en global.json ejecutando dotnet test --coverage --coverage-output-format cobertura; después, compáralo con dotnet test sin coverage. Traza la ruta de limpieza de Microsoft Testing Platform y CodeCoverage, incluido el punto de entrada dotnet-coverage collect. Se considera terminado cuando se genera coverage, la limpieza se completa sin BadImageFormatException y el proceso termina con el código 0.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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"
- Lenguaje dominante
- C#
- Estrellas
- 125
- Forks
- 17
- Merge medio
- 1 h 15 min
- PR fusionados (30 d)
- 2
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/codecoverage
-
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
microsoft/codecoverage#252 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
microsoft/codecoverage#251 ·
-
[BUG] Intermittent Windows 0xC0000005 crashes in MTP test hosts with CodeCoverage on .NET 10Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
microsoft/codecoverage#249 · 1 comentario ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
microsoft/codecoverage#220 · 2 comentarios ·
-
False positive branch coverageAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 66/100
microsoft/codecoverage#218 ·
Todos los issues de microsoft/codecoverage
Issues similares
-
[C#]:主页联网更新的提示投稿横幅指向错误Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
PCL-Community/PCL-CE#3652 ·
Los mantenedores suelen responder en 1 día
-
area:frontend bug FE P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
klasolsson81/jobbliggaren#2010 ·
Los mantenedores suelen responder en 1 día
-
[aw] Upgrade availableAbiertoagentic-workflows untriaged
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
area: homeblaze type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
RicoSuter/Namotion.Interceptor#630 ·
Los mantenedores suelen responder en 1 día
-
Akka.Hosting enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100