Simulating Operational Memory Models Using Off-the-Shelf Program Analysis Tools

被引:2
作者
Iorga, Dan [1 ]
Wickerson, John [2 ]
Donaldson, Alastair F. [1 ]
机构
[1] Imperial Coll London, Dept Comp, London SW7 2AZ, England
[2] Imperial Coll London, Dept Elect & Elect Engn, London SW7 2AZ, England
基金
英国工程与自然科学研究理事会;
关键词
Operational semantics; model checking; fuzzing; symbolic execution; WEAK MEMORY; CONSISTENCY; CHECKING;
D O I
10.1109/TSE.2023.3326056
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Memory models allow reasoning about the correctness of multithreaded programs. Constructing and using such models is facilitated by simulators that reveal which behaviours of a given program are allowed. While extensive work has been done on simulating axiomatic memory models, there has been less work on simulation of operational models. 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.
引用
收藏
页码:5084 / 5102
页数:19
相关论文
共 63 条
[1]  
AFL++ Project, 2023, AFL++ Overview
[2]  
AFL++Team, 2023, American Fuzzy Lop Plus Plus (AFL++)
[3]  
Alglave J, 2012, Arxiv, DOI arXiv:1207.7264
[4]   Herding Cats: Modelling, Simulation, Testing, and Data Mining for Weak Memory [J].
Alglave, Jade ;
Maranget, Luc ;
Tautschnig, Michael .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2014, 36 (02)
[5]  
Alglave J, 2011, LECT NOTES COMPUT SC, V6605, P41, DOI 10.1007/978-3-642-19835-9_5
[6]  
Armstrong A., 2022, RMEM: A tool for exploring relaxed -memory concurrency
[7]   ISA Semantics for ARMv8-A, RISC-V, and CHERI-MIPS [J].
Armstrong, Alasdair ;
Bauereiss, Thomas ;
Campbell, Brian ;
Reid, Alastair ;
Gray, Kathryn E. ;
Norton, Robert M. ;
Mundkur, Prashanth ;
Wassell, Mark ;
French, Jon ;
Pulte, Christopher ;
Flur, Shaked ;
Stark, Ian ;
Krishnaswami, Neel ;
Sewell, Peter .
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2019, 3 (POPL)
[8]  
Arya Abhishek, 2019, OPEN SOURCING CLUSTE
[9]  
Batty M, 2012, POPL 12: PROCEEDINGS OF THE 39TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, P509
[10]   ARMv8-A system semantics: instruction fetch in relaxed architectures [J].
Ben Simner ;
Flur, Shaked ;
Pulte, Christopher ;
Armstrong, Alasdair ;
Pichon-Pharabod, Jean ;
Maranget, Luc ;
Sewell, Peter .
PROGRAMMING LANGUAGES AND SYSTEMS ( ESOP 2020): 29TH EUROPEAN SYMPOSIUM ON PROGRAMMING, 2020, 12075 :626-655