Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deadlock if Interleave point inside a static constructor #488

Open
kripergvg opened this issue Aug 17, 2023 · 0 comments
Open

Deadlock if Interleave point inside a static constructor #488

kripergvg opened this issue Aug 17, 2023 · 0 comments

Comments

@kripergvg
Copy link

kripergvg commented Aug 17, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant