-
Notifications
You must be signed in to change notification settings - Fork 83
Deadlock if Interleave point inside a static constructor #488
Description
Hello,
I've noticed one very nasty situation. When there is an interleaving point in static constructor (for example lock or SchedulingPoint.Interleave() placed manually) it's possible that the program will be deadlocked.
It seems to happen because there is a native lock from CoreCLR around static constructor so if operation inside static constructor is put to sleep by Coyote runtime it stays there infinitely as Coyote can't recognize this lock.
Do you have any ideas how this can be avoided as in our code base we have quite a lot of potential points of interleaving in static constructors?
Reproduction: https://github.com/kripergvg/CoyoteReproduction/blob/master/Test.cs run using coyote test CoyoteTesting.dll --seed 2441523192
Output:
Static ctor start
Inner Thread start
Regards, Vladimir