-
Notifications
You must be signed in to change notification settings - Fork 0
ESBMC
ESBMC (the Efficient SMT-based Context-Bounded Model Checker) is a mature, permissively licensed open-source context-bounded model checker for verifying single and multithreaded C/C++, CUDA, CHERI, Kotlin, Python, and Solidity programs. It can automatically verify predefined safety properties (e.g., bounds check, pointer safety, overflow) and user-defined program assertions.
ESBMC supports source code files from various programming languages.
- C/C++
- CUDA
- CHERI
- Java/Kotlin
- Python
- Solidity programs
ESBMC can automatically analyze source code and verify the following properties:
- Out-of-bounds array access
- Illegal pointer dereferences, such as:
- Dereferencing null
- Performing an out-of-bounds dereference
- Double-free of malloc'd memory
- Misaligned memory access
- Integer overflows
- Undefined behavior on shift operations
- Floating-point for NaN
- Divide by zero
- Memory leaks
Concurrent software (using the pthread API) is verified by explicitly exploring interleavings, producing one symbolic execution per interleaving. By default, pointer-safety, array-out-of-bounds, division-by-zero, and user-specified assertions will be checked for; one can also specify options to check concurrent programs for:
- Deadlock (only on pthread mutexes and convars)
- Data races (i.e., competing writes)
- Atomicity violations at visible assignments
- Lock acquisition ordering
ESBMC implements state-of-the-art incremental BMC and k-induction proof-rule algorithms based on Satisfiability Modulo Theories (SMT) and Constraint Programming (CP) solvers for all of its supported languages.
Many SMT solvers are currently supported:
- Z3 4.8+
- Bitwuzla
- Boolector 3.0+
- MathSAT
- CVC4
- CVC5
- Yices 2.2+
- Arbitrary solvers (through SMTLIB's interactive text format and pipes)
Additional Libraries:
- The Clang compiler as its C/C++/CHERI/CUDA frontend;
- The Soot framework via Jimple as its Java/Kotlin frontend;
- The ast2json package as its Python frontend;
- Implements the Solidity grammar production rules as its Solidity frontend;
- Website: https://esbmc.org
- GitHub: https://github.com/esbmc/esbmc
- Tutorial: https://www.youtube.com/watch?v=uJ5Jn0sxm08&t=2182s
- Documentation: https://ssvlab.github.io/esbmc/documentation.html
To verify the following program:
#include <math.h>
int main() {
unsigned int N = nondet_uint();
double x = nondet_double();
if(x <= 0 || isnan(x))
return 0;
unsigned int i = 0;
while(i < N) {
x = (2*x);
assert(x>0);
++i;
}
assert(x>0);
return 0;
}Invoke ESBMC with the following command:
esbmc file.c --k-inductionWhere file.c is the source code program to be verified and --k-induction is a flag to use K-Induction proof for the verification.
ESBMC is a joint project of the Federal University of Amazonas (Brazil), the University of Manchester (UK), the University of Southampton (UK), and the University of Stellenbosch (South Africa).
The ESBMC development was supported by various research funding agencies, including CNPq (Brazil), CAPES (Brazil), FAPEAM (Brazil), EPSRC (UK), Royal Society (UK), British Council (UK), European Commission (Horizon 2020), and companies including ARM, Intel, Motorola Mobility, Nokia Institute of Technology and Samsung. The ESBMC development is currently funded by ARM, EPSRC grants EP/T026995/1 and EP/V000497/1, Ethereum Foundation, EU H2020 ELEGANT 957286, Intel, Motorola Mobility (through Agreement N° 4/2021), and Soteria project awarded by the UK Research and Innovation for the Digital Security by Design (DSbD) Programme.
- L. Cordeiro, B. Fischer, and J. Marques-Silva, “SMT-Based Bounded Model Checking for Embedded ANSI-C Software,” Jul. 13, 2009, arXiv: arXiv:0907.2072. doi: 10.48550/arXiv.0907.2072.
- “Model checking C++ programs - Monteiro - 2022 - Software Testing, Verification and Reliability - Wiley Online Library.” Accessed: Sep. 19, 2024. [Online]. Available: https://onlinelibrary.wiley.com/doi/full/10.1002/stvr.1793
- For a full list of publications please see: https://ssvlab.github.io/esbmc/publications.html