PERIOD is a novel controlled concurrency testing (CCT) technique, based on periodical scheduling.
Concurrency bugs are notoriously hard to detect, reproduce and debug. Unlike sequential programs whose only non-determinism comes from their input, the behavior of concurrent programs is also subject to how their threads interleave and thus leaving more openings for concurrency bugs.
Concurrency bugs often escape rigorous software testing, posing a constant threat to system correctness, reliability, and safety. Take the following figure as an example, the observed interleaving during testing could miss the bug. However, Untested interleavings can cause failures.
PERIOD aims to offer a solution for concurrency bugs detection, where it
performs multiple repeatability tests, for a given test case.
actively controlled thread interleaving by periodical scheduling method
try to test one untested thread interleaving at a time
Unlike previous CCT techniques, PERIOD
model the execution of concurrent programs as periodical execution
use a novel systematic method to explore the space of possible interleavings with the period-bounding technique.
make use of information of previously tested interleavings to guide the exploration
don't destroy parallelism of concurrent programs and support multi-core speedup
would not introduce liveness issues (e.g., livelock, deadlock) that were not originally exhibited in the target programs
provides replay capability for reproducing buggy interleavings
PERIOD is able to expose and report runtime bugs, with the help of dynamic detectors (e.g., AddressSanitizer and ThreadSanitizer). The bugs include:
Assertion failure
Use-after-free
Null-pointer-deference
Buffer-overflow
Data race
Unexpected hangs
…
Requires source code of which program can be compiled and executed
Support for C/C++ and LLVM IR using POSIX threads library in Linux platform
Support clang/clang++ compiler and LLVM ≤12.0.0 (not support gcc/g++)
Our tool automatically performs active testing, thus it could work with runtime error detector (e.g., AddressSanitizer, ThreadSanitizer, MemorySanitizer).