- Joe Lane (Minnesota)
- Francis Avila (Louisiana)
- Ghadi Shayban (South Carolina)
In the 1.12 LazySeq ReentrantLocks reimpl, there is a significant data race that results in an incorrect nil result from concurrent calls to seq().
Clone then clj -X:repro to provoke the race (~10s on my M1), or clj -X:repro:accelerate (<100ms)
The data race is that seq() checks for the lock's absence as a signal that s is published. But, neither s nor the lock are volatile, so there is no ordering between their publishing, and an observer can see these two statements reordered: nil lock but no s yet. The only happens-before edge seq() is locking and unlocking, and seq() can ignore the lock entirely.