Charles Explorer logo
🇬🇧

Incremental Verification of Multithreaded Programs by Checking Interleavings for Pairs of Threads

Publication

Abstract

Many techniques of automated verification target multithreaded programs, because subtle interactions between threads may trigger concurrency errors such as deadlocks and data races. While many techniques and tools involving systematic exploration of the whole space of possible thread interleavings have already been developed, a great majority of them does not scale to large real-world software systems, despite various clever algorithmic optimizations.

A viable approach is to use incremental verification techniques that, in each run, focus just on the recently modified code and the relatively small number of affected execution traces, and therefore can provide analysis results (including bug reports) very quickly. We present a new algorithm for incremental verification of multithreaded programs that is based on the pairwise approach.

The key idea of the pairwise approach is systematic exploration of possible thread interleavings just for specific pairs of threads, such that behavior of the subject program is analyzed separately for every relevant thread pair. We implemented the algorithm with Java Pathfinder as the backend verification tool, and evaluated it on several multithreaded Java programs.

Results show that our incremental algorithm (1) can find errors very fast, (2) greatly reduces time needed for complete safety verification, and (3) it can find the same errors as full verification of the whole state space. Performance of our prototype implementation of the algorithm is also comparable with state-of-the-art techniques based on static analysis.