Vstest: Reason: Test host process crashed inside docker sdk:3.1-alpine container

Created on 30 Jul 2020  路  5Comments  路  Source: microsoft/vstest

As depicted here running specific tests scenarios inside mcr.microsoft.com/dotnet/core/sdk:3.1-alpine crashes with following message:

The active test run was aborted. Reason: Test host process crashed

Test Run Aborted.
Total tests: Unknown
Passed: 32
Total time: 51.0251 Seconds
Done executing task "Microsoft.TestPlatform.Build.Tasks.VSTestTask" -- FAILED.
1:7>Done building target "VSTest" in project "InkBall.Tests.csproj" -- FAILED.
1:7>Done Building Project "/srv/InkBall/test/InkBall.Tests/InkBall.Tests.csproj" (VSTest target(s)) -- FAILED.

Build FAILED.
0 Warning(s)
0 Error(s)

It is only visible and reproducible under Alpine 3.12 3.1.302-alpine3.12, 3.1-alpine3.12, 3.1.302-alpine, 3.1-alpine docker image. Same batch test scenario run under Alpine 3.11 3.1.302-alpine3.11, 3.1-alpine3.11 works fine.

Steps to reproduce

I've prepared copy-n-paste repro ready to be run from command line that will spun up docker container, git clone repo and dotnet run tests.
Docker container is run with stack trace dump capabilities and is able to intercept and analyze crash dumps.

#run latest SDK alpine-3.12 image with dump capabilities
docker run -it --rm --cap-add=SYS_PTRACE mcr.microsoft.com/dotnet/core/sdk:3.1-alpine

#
#now inside container
#we'll be using git
apk add git
#
#some trivialities
alias ll='ls -lah --color'
cd /srv/
#clone my repo with tests
git clone https://github.com/ChaosEngine/InkBall.git
#go to test project
cd InkBall/test/InkBall.Tests/
dotnet restore -r alpine-x64
dotnet build
#allow to make core dumps
export COMPlus_DbgEnableMiniDump=1
#install needed tools :-)
dotnet tool install --global dotnet-gcdump
dotnet tool install --global dotnet-dump
export PATH="$PATH:/root/.dotnet/tools"
#finaly run the tests!!111one
dotnet test -v d
#
#it takes some time to generate dump
#
#now analyze it
dotnet-dump analyze /tmp/coredump.* -c clrstack

Expected behavior

All tests are run successfully

Actual behavior

The active test run was aborted. Reason: Test host process crashed

Diagnostic logs

When core dump trace is being analyzed following is visible after issuing clrstack:

OS Thread Id: 0x193 (0)
Child SP IP Call Site
00007FFE58E5CD20 00007f5061c45878 [GCFrame: 00007ffe58e5cd20]
00007FFE58E5CE00 00007f5061c45878 [HelperMethodFrame_1OBJ: 00007ffe58e5ce00] System.Threading.Monitor.ObjWait(Boolean, Int32, System.Object)
00007FFE58E5CF30 00007F4FE7530A14 System.Threading.ManualResetEventSlim.Wait(Int32, System.Threading.CancellationToken)
00007FFE58E5CFC0 00007F4FE75452C0 System.Threading.Tasks.Task.SpinThenBlockingWait(Int32, System.Threading.CancellationToken) [//src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs @ 2922]
00007FFE58E5D020 00007F4FE7545164 System.Threading.Tasks.Task.InternalWaitCore(Int32, System.Threading.CancellationToken) [//src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs @ 2861]
00007FFE58E5D070 00007F4FE7544ED7 System.Threading.Tasks.Task.Wait(Int32, System.Threading.CancellationToken) [//src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs @ 2772]
00007FFE58E5D0A0 00007F4FE7544DF2 System.Threading.Tasks.Task.Wait() [//src/System.Private.CoreLib/shared/System/Threading/Tasks/Task.cs @ 2655]
00007FFE58E5D0B0 00007F4FE7A1FD63 Microsoft.VisualStudio.TestPlatform.TestHost.DefaultEngineInvoker.Invoke(System.Collections.Generic.IDictionary`2<System.String,System.String>)
00007FFE58E5D130 00007F4FE7A171AC Microsoft.VisualStudio.TestPlatform.TestHost.Program.Run(System.String[])
00007FFE58E5D160 00007F4FE7A10495 Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main(System.String[])
00007FFE58E5D498 00007f5060e2ecff [GCFrame: 00007ffe58e5d498]
00007FFE58E5D980 00007f5060e2ecff [GCFrame: 00007ffe58e5d980]

Possibly root cause of error is hiding here

Environment

Please share additional details about the test environment.

docker alpine 3.12 sdk image.
My repro steps are visible also inside this gist

Most helpful comment

I am having the same issue with net core 3.1.202, any idea?

All 5 comments

looks like it is fixed with latest mcr.microsoft.com/dotnet/core/sdk-3.1-alpine image

I am having the same issue with net core 3.1.202, any idea?

I have the same issue with mcr.microsoft.com/dotnet/sdk:5.0-alpine

I have the same issue with mcr.microsoft.com/dotnet/sdk:5.0-alpine

With respect to mcr.microsoft.com/dotnet/sdk:5.0-alpine (which currently is based of off mcr.microsoft.com/dotnet/sdk:5.0-alpine3.13) this error could be caused by https://github.com/dotnet/efcore/issues/24189

Yea these issues all look the same to me... I changed the tag to alpine3.12 and it works now.

Was this page helpful?
0 / 5 - 0 ratings