Skip to content

Deadlock if Interleave point inside a static constructor #488

@kripergvg

Description

@kripergvg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions