Experiment with loom#820
Conversation
|
🤖 SemverChecks 🤖 Click for details |
|
According to Intel's manual, atomic operations on memory should observe the latest value.
|
|
Two potential issues detected by loom are the following:
The initial thread state is RUNNING_IN_HOST, and the following execution is one of the expected paths. However, in loom's memory model, checking observer's done flag in thread 1 may still observe stale value (False) because (this is my guess) setting the
The fix to both is to change the ordering of setting the flag from |
I was playing around with loom in the past few days to help me debug some race issues that occurred in the CI tests but are extremely difficult to reproduce locally. I tried running the test with
stress, using qemu without kvm and rr with--chaos, but none of them succeeded to reproduce the bug.If loom's memory model and my modeling ofLooks like loom does not supportfutexare correct, it found a potential race issue in theFutexManager. I will submit a separate PR for the fix.SeqCstfor atomic operations and some other issue. to mitigate the former issue, we need to usefence(SeqCst).