SATCheck: SAT-Directed Stateless Model Checking for SC and TSO
Writing low-level concurrent code is well known to be challenging and error prone. The widespread deployment of multi-core hardware and the shift towards using low-level concurrent data structures has moved the problem into the mainstream. Finding bugs in such code may require finding a specific bug-revealing thread interleaving out of a huge space of parallel executions.
Model-checking is a powerful technique for exhaustively testing code. However, scaling model checking presents a significant challenge.
In this paper we present a new and more scalable technique for model checking concurrent code, based on concrete execution. Our technique observes concrete behaviors, builds a model of these behaviors, encodes the model in SAT, and leverages SAT solver technology to find executions that reveal new behaviors. It then runs the new execution, incorporates the newly observed behavior, and repeats the process until it has explored all reachable behaviors.
We have implemented a prototype of our approach in the SATCheck tool with support for both the Total Store Order (TSO) and Sequentially Consistent (SC) memory models and use SATCheck to test several concurrent data structure implementations. We compare SATCheck to the original DPOR stateless model checking algorithm implemented in CDSChecker, the source DPOR algorithm implemented in Nidhugg, and CheckFence. Our experiments show that SATCheck scales better than previous approaches while at the same time operating on concrete executions.