Repository navigation
Closed
Labels
JitStressCLR JIT issues involving JIT internal stress modesarch-arm64area-Extensions-Hostingblocking-clean-ci-optionalBlocking optional rolling runsin-prThere is an active PR which will close this issue when it is mergedos-windows
Milestone
Description
Failed in: runtime-coreclr libraries-jitstress 20240910.1
Failed tests:
net9.0-windows-Release-arm64-jitstress1_tiered-Windows.11.Arm64.Open
- Microsoft.Extensions.Hosting.WindowsServiceLifetimeTests.ExceptionOnStartIsPropagated
net9.0-windows-Release-arm64-jitminopts-Windows.11.Arm64.Open
- Microsoft.Extensions.Hosting.WindowsServiceLifetimeTests.ExceptionOnStartIsPropagated
Error message:
Microsoft.DotNet.RemoteExecutor.RemoteExecutionException : Half-way through waiting for remote process.
Memory load: 38
Image Name PID Services
========================= ======== ============================================
svchost.exe 928 BrokerInfrastructure, DcomLaunch, Power,
SystemEventsBroker
svchost.exe 476 RpcEptMapper, RpcSs
svchost.exe 528 LSM
svchost.exe 1060 TermService
svchost.exe 1068 CryptSvc
svchost.exe 1120 lmhosts
svchost.exe 1240 NcbService
svchost.exe 1248 TimeBrokerSvc
svchost.exe 1308 AppIDSvc
svchost.exe 1444 nsi
svchost.exe 1500 Schedule
svchost.exe 1520 netprofm
svchost.exe 1548 CoreMessagingRegistrar
svchost.exe 1568 ProfSvc
svchost.exe 1612 UmRdpService
svchost.exe 1684 UserManager
svchost.exe 1752 vmicheartbeat
svchost.exe 1852 vmickvpexchange
svchost.exe 1900 vmicshutdown
svchost.exe 1916 LanmanWorkstation
svchost.exe 1968 vmictimesync
svchost.exe 2000 DispBrokerDesktopSvc
svchost.exe 2088 Dnscache
svchost.exe 2172 EventLog
svchost.exe 2204 SessionEnv
svchost.exe 2272 CertPropSvc
svchost.exe 2324 EventSystem
svchost.exe 2336 SysMain
svchost.exe 2364 Themes
svchost.exe 2464 Dhcp
svchost.exe 2548 SENS
svchost.exe 2632 AudioEndpointBuilder
svchost.exe 2664 FontCache
svchost.exe 2720 Audiosrv
svchost.exe 2768 WinHttpAutoProxySvc
svchost.exe 2844 TextInputManagementService
svchost.exe 2972 DusmSvc
svchost.exe 3008 Wcmsvc
svchost.exe 3048 ShellHWDetection
svchost.exe 3088 BFE, mpssvc
svchost.exe 3184 DiagTrack
svchost.exe 3196 DPS
svchost.exe 3204 iphlpsvc
svchost.exe 3288 StateRepository
svchost.exe 3312 LanmanServer
Stack trace:
at Microsoft.DotNet.RemoteExecutor.RemoteInvokeHandle.Dispose(Boolean disposing) in /_/src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs:line 225
at Microsoft.DotNet.RemoteExecutor.RemoteInvokeHandle.Dispose() in /_/src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs:line 55
at Microsoft.Extensions.Hosting.WindowsServiceTester.Dispose(Boolean disposing) in /_/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/tests/WindowsServiceTester.cs:line 147
at System.ComponentModel.Component.Dispose() in /_/src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/Component.cs:line 73
at Microsoft.Extensions.Hosting.WindowsServiceLifetimeTests.ExceptionOnStartIsPropagated() in /_/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/tests/WindowsServiceLifetimeTests.cs:line 85
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 57
Metadata
Metadata
Assignees
Labels
JitStressCLR JIT issues involving JIT internal stress modesarch-arm64area-Extensions-Hostingblocking-clean-ci-optionalBlocking optional rolling runsin-prThere is an active PR which will close this issue when it is mergedos-windows
Activity
dotnet-policy-service commentedon Sep 11, 2024
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
amanasifkhalid commentedon Sep 11, 2024
Looks like the same issue as #107589
kunalspathak commentedon Sep 11, 2024
It seems this was recently in the past #105377, but was closed for some reason. @buyaa-n do you remember?
kunalspathak commentedon Sep 11, 2024
#88027 also seems to be related which was getting reported since last year and the specific test case was disabled, but the underlying issue is not fixed.
15 remaining items
ericstj commentedon Sep 12, 2024
Here it is: https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-heads-main-212737db1d264eb29f/Microsoft.Extensions.Hosting.WindowsServices.Tests/1/7152.chovy3c2.jli.dmp?helixlogtype=result
ericstj commentedon Sep 12, 2024
So the next action would be to look at that dump and answer the question "Why is this process hung?"
You can use runfo to get all the files from the test:
I had a look and none of the tests seem to be running any user code. I can't see any of the managed stack info (how can I load SOS when debugging ARM64 on amd64?)
Here's all the native stacks
kunalspathak commentedon Sep 12, 2024
Yes, I was at similar conclusion when looking at the trace of this one and #107589. Additionally, I couldn't get SOS to load in my windbg to confirm what is going on.
v-wenyuxu commentedon Sep 13, 2024
Failed in: runtime-coreclr libraries-jitstress 20240912.1
Failed tests:
Error message:
Stack trace:
kunalspathak commentedon Sep 13, 2024
Something odd going since last month, given that we had to point fix the tests to make them pass on jit stress pipelines
ericstj commentedon Sep 13, 2024
Ok, so I got @hoyosjs's help to get the managed stacks. I had to build an amd64_arm64 cross dac and then tell the debugger to use it. Here's the managed state:
So this looks to me like the service is still running. It should have thrown an exception on start and exited. The dump shows that it's the correct service running. It's almost as if the exception was swallowed. I'll look more closely at how this is supposed to work and see if I can build a theory.
ericstj commentedon Sep 14, 2024
This looks wrong:
This callstack has the entrypoint running this service:
runtime/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/tests/UseWindowsServiceTests.cs
Lines 36 to 44 in d58b1ca
And if I check the commandline args:
However if I check the service name:
So it looks to me like the service was registered with the wrong command line arguments!
I think I found the problem. We create a single
RemoteInvokeOptionsthat we share across all calls to register the service.runtime/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/tests/WindowsServiceTester.cs
Line 72 in d58b1ca
Seems OK right? An options class should just immutable state to pass parameters around.
Not so fast! This options type has a
ProcessStartInfohttps://github.com/dotnet/arcade/blob/bd749a18dd72b8fcb5257ae01a4faf6dd487cc5f/src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeOptions.cs#L21
And that instance is actually mutated before it's copied out into the final returned handle:
https://github.com/dotnet/arcade/blob/bd749a18dd72b8fcb5257ae01a4faf6dd487cc5f/src/Microsoft.DotNet.RemoteExecutor/src/RemoteExecutor.cs#L434-L467
So we've had this latent threading bug here forever. If we have multiple tests running they'll race at mutating that
psiand the one that actually gets returned and used to register the service could be wrong.Fix here is simple - don't reuse the
RemoteInvokeOptionsinstance.dotnet-policy-service commentedon Sep 14, 2024
Tagging subscribers to this area: @dotnet/area-extensions-hosting
See info in area-owners.md if you want to be subscribed.