You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hanging test in System.Reflection.Emit.Tests #32177
Yeah I was able to repro locally with the downloaded payload. It looks like it hangs randomly on different tests though so disabling will be a bit tricky.
I think there's a deadlock between thread 12 and thread 16 and the gc initiator (thread 9) because mono_domain_assemblies_lock uses an OS mutex, not a coop mutex. It's near here:
Thread 16 is on line 1382 it is holding the domain lock (an os mutex) and it cooperatively suspended trying to take the ALC lock (a coop mutex).
Thread 12 is on line 1378 it wants to take the domain lock (an os mutex) and we're in GC Unsafe mode here so we're trying to cooperatively suspend it. But it's stuck because 16 is already suspended and won't let go of the mutex.
We maaaaay have to delay its initialization if so... I need to look through the startup code and see how to handle that. At least if it's initialized too early it should very obviously fail, so it could be worse. Surprised I didn't notice this earlier.
Activity
akoeplinger commentedon Feb 12, 2020
Hard to say whether it's Mono related without more context.
safern commentedon Feb 12, 2020
By downloading the test payload, does it repro locally?
akoeplinger commentedon Feb 12, 2020
Yeah I was able to repro locally with the downloaded payload. It looks like it hangs randomly on different tests though so disabling will be a bit tricky.
Repro:
cd System.Reflection.Emit.Tests && chmod +x RunTests.shwhile [ $? -eq 0 ]; do ./RunTests.sh --runtime-path ../test-runtime-netcoreapp5.0-OSX-Release-x64.zip/ --rsp-file mono.issues.rsp ; doneHere's a lldb backtrace: https://gist.github.com/akoeplinger/263781cf9b924ef6dcb9b6f9778e9780
@lambdageek does anthing in that trace look suspicious?
safern commentedon Feb 12, 2020
Can we disable the whole assembly on Mono for the time being? While investigation goes on?
akoeplinger commentedon Feb 12, 2020
Sure, I can send a PR tomorrow or feel free to do it :)
safern commentedon Feb 12, 2020
I put up: #32201
lambdageek commentedon Feb 13, 2020
@CoffeeFlux Look at @akoeplinger's gist https://gist.github.com/akoeplinger/263781cf9b924ef6dcb9b6f9778e9780
I think there's a deadlock between thread 12 and thread 16 and the gc initiator (thread 9) because
mono_domain_assemblies_lockuses an OS mutex, not a coop mutex. It's near here:runtime/src/mono/mono/metadata/sre.c
Lines 1378 to 1392 in 0e0e852
Thread 16 is on line 1382 it is holding the domain lock (an os mutex) and it cooperatively suspended trying to take the ALC lock (a coop mutex).
Thread 12 is on line 1378 it wants to take the domain lock (an os mutex) and we're in GC Unsafe mode here so we're trying to cooperatively suspend it. But it's stuck because 16 is already suspended and won't let go of the mutex.
The domain lock should be a coop mutex.
Also, semi-related in dynamic-image.c
runtime/src/mono/mono/metadata/dynamic-image.c
Lines 34 to 46 in 0e0e852
The dynamic images lock should also be a coop mutex.
CoffeeFlux commentedon Feb 14, 2020
We maaaaay have to delay its initialization if so... I need to look through the startup code and see how to handle that. At least if it's initialized too early it should very obviously fail, so it could be worse. Surprised I didn't notice this earlier.
karelz commentedon Feb 22, 2020
@lambdageek please only 1 area label per issue - see why. Thanks!
[threading] Switch domain assemblies lock from OS to Coop (#18918)