Skip to content

Why does coyote find no bugs in this code? #388

Answered by akashlal
MaximTkachenko asked this question in Q&A

You must be logged in to vote

Coyote is not designed to explore low-level data races. For the bug to manifest in your code, there needs to be a context switch after Number has been read but before the incremented value is stored back to it. Coyote will not explore such context switches on its own. You can force it as follows:

var t = Number + 1;
SchedulingPoint.Interleave();
Number = t;

I would expect that coyote will find the bug then.

By default, coyote only explores context switches at synchronization points (acquire/release a lock) or at Task APIs.

Replies: 1 comment

You must be logged in to vote
0 replies
Answer selected by pdeligia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #355 on October 17, 2022 16:52.