[论文解读] Bounded Model Checking of Multi-threaded Software using SMT solvers
本文提出了一种基于SMT的有界模型检查(BMC)框架,用于验证具有共享变量和Pthread同步原语的多线程C软件。该框架引入了三种新颖方法——懒惰法、调度记录法和下近似-扩展法——并结合部分序约简(POR),以高效探索执行交错,显著减少验证时间,并成功检测到真实世界嵌入式系统中的复杂错误(如死锁)。
The transition from single-core to multi-core processors has made multi-threaded software an important subject in computer aided verification. Here, we describe and evaluate an extension of the ESBMC model checker to support the verification of multi-threaded software with shared variables and locks using bounded model checking (BMC) based on Satisfiability Modulo Theories (SMT). We describe three approaches to model check multi-threaded software and our modelling of the synchronization primitives of the Pthread library. In the lazy approach, we generate all possible interleavings and call the BMC procedure on each of them individually, until we either find a bug, or have systematically explored all interleavings. In the schedule recording approach, we encode all possible interleavings into one single formula and then exploit the high speed of the SMT solvers. In the underapproximation-widening approach, we reduce the state space by abstracting the number of state variables and interleavings from the proofs of unsatisfiability generated by the SMT solvers. In all three approaches, we use partial-order reduction (POR) techniques to reduce the number of interleavings explored. Experiments show that our approaches can analyze larger problems and substantially reduce the verification time compared to state-of-the-art techniques that combine classic POR methods with symbolic algorithms and others that implement the Counter-Example Guided Abstraction Refinement technique.
研究动机与目标
- 为解决具有共享变量和锁的多线程软件验证中的状态空间爆炸问题。
- 将ESBMC模型检查器扩展以支持使用SMT求解器的Pthread同步原语(互斥量、条件变量)。
- 将部分序约简(POR)与基于SMT的BMC结合,以减少冗余的执行交错探索。
- 实现对真实世界嵌入式C程序中复杂并发错误(如死锁)的检测。
- 评估基于SMT求解器的下近似-扩展(UW)技术在多线程验证中的有效性。
提出的方法
- 懒惰法生成所有可能的线程交错,并对每个交错单独应用BMC,使用SMT求解器检查是否存在违规。
- 调度记录法将每个线程的所有可能执行路径编码为单个SMT公式,通过SMT求解实现高速分析。
- 下近似-扩展(UW)法利用SMT求解器生成的不可满足核心,对状态变量和交错数量进行抽象,以减少状态空间。
- 将部分序约简(POR)集成到所有三种方法中,通过利用线程操作之间的独立性,消除冗余的交错探索。
- 该框架使用SMT兼容约束建模Pthread原语(互斥量、条件变量),并支持有限位宽、数组、结构体和指针。
- 扩展了ESBMC工具,以支持基于SMT的BMC,并引入ANSI-C语义的背景理论,包括位向量和数组操作。
实验结果
研究问题
- RQ1基于SMT的有界模型检查能否有效验证具有共享变量和Pthread同步的多线程C程序?
- RQ2不同基于SMT的BMC策略(懒惰法、调度记录法、UW)在可扩展性和验证性能方面如何比较?
- RQ3在基于SMT的多线程验证中,部分序约简能在多大程度上减少探索的交错数量?
- RQ4结合SMT求解器的下近似-扩展技术能否检测到其他方法遗漏的复杂并发错误(如死锁)?
- RQ5所提出的基于SMT的BMC框架在真实世界基准测试中,相较于现有技术(如CEGAR和POR-符号组合)有何优势?
主要发现
- UW ESBMC方法在真实世界基准测试中,验证时间和可扩展性方面优于基于CEGAR的SATABS模型检查器。
- 懒惰ESBMC方法通过逐步添加并发约束,能够快速检测非平凡多线程C程序中的错误。
- 将部分序约简与基于SMT的BMC结合,显著减少了探索的交错数量,且不损失正确性。
- 该框架成功检测到由互斥量和条件变量操作引起的死锁,这是先前仅支持两线程或上下文有界方法所不具备的能力。
- 调度记录法通过将所有交错编码为单个公式,充分利用SMT求解器的高速求解能力,提升了大规模问题的性能。
- 利用SMT求解器生成的不可满足核心,有效实现了抽象和状态空间缩减,显著增强了UW方法的可扩展性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。