Simulating Operational Memory Models Using Off-the-Shelf Program Analysis Tools
Dan Iorga, John Wickerson, Alastair F. Donaldson · IEEE Transactions on Software Engineering · 2023
Memory models allow reasoning about the correctness of multithreaded programs. Constructing and using such models is facilitated bysimulatorsthat reveal which behaviours of a given program are allowed. While extensive work has been done on simulatingaxiomaticmemory models, there has been less work on simulation ofoperationalmodels. Operational models are often considered more intuitive than axiomatic models, but are challenging to simulate due to the vast number of paths through the model’s transition system.Observing that a similar path-explosion problem is tackled by program analysis tools, we investigate the idea of reducing the decision problem of “whether a given memory model allows a given behaviour” to the decision problem of “whether a given C program is safe”, which can be handled by a variety of off-the-shelf tools. We report on our experience using multiple program analysis tools for C for this purpose—a model checker (CBMC), a symbolic execution tool (KLEE), and three coverage-guided fuzzers (libFuzzer, Centipede and AFL++)—presenting two case-studies. First, we evaluate the performance and scalability of these tools in the context of the x86 memory model, showing that fuzzers offer performance competitive with that of RMEM, a state-of-the-art bespoke memory model simulator. Second, we study a more complex, recently developed memory model for hybrid CPU/FPGA devices for which no bespoke simulator is available. We highlight how different encoding strategies can aid the various tools and show how our approach allows us to simulate the CPU/FPGA model twice as deeply as in prior work, leading to us finding and fixing several infidelities in the model. We also experimented with applying three analysis tools that won the “falsification” category in the 2023 Annual Software Verification Competition (SV-COMP). We found that these tools do not scale to our use cases, motivating us to submit example C programs arising from our work for inclusion in the set of SV-COMP benchmarks, so that they can serve as challenge examples.
Cited by 3 works. doi:10.1109/tse.2023.3326056 Open-access PDF
Authors
References
- How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs
- An Extensible SAT-solver
- A Tool for Checking ANSI-C Programs
- Software model checking: extracting verification models from source code†
- CPAchecker: A Tool for Configurable Software Verification
- A Better x86 Memory Model: x86-TSO
- T-Fuzz: Fuzzing by Program Transformation
- Evolutionary algorithms: A critical review and its future prospects
- The semantics of x86-CC multiprocessor machine code
- Herding Cats