Asynchronous assertions
Authors:
Open Access
- 22 October 2011
- conference paper
- Published by Association for Computing Machinery (ACM)
- Vol. 46 (10) , 275-288
Abstract
Assertions are a familiar and widely used bug detection technique. Traditional assertion checking, however, is performed synchronously, imposing its full cost on the runtime of the program. As a result, many useful kinds of checks, such as data structure invariants and heap analyses, are impractical because they lead to extreme slowdowns. We present a solution that decouples assertion evaluation from program execution: assertions are checked asynchronously by separate checking threads while the program continues to execute. Our technique guarantees that asynchronous evaluation always produces the same result as synchronous evaluation, even if the program concurrently modifies the program state. The checking threads evaluate each assertion on a consistent snapshot of the program state as it existed at the moment the assertion started. We implemented our technique in a system called Strobe, which supports asynchronous assertion checking in both single-and multi-threaded Java applications. Strobe runs inside the Java virtual machine and uses copy-on-write to construct snapshots incrementally, on-the-fly. Our system includes all necessary synchronization to support multiple concurrent checking threads, and to prevent data races with the main program threads. We find that asynchronous checking significantly outperforms synchronous checking, incurring tolerable overheads -- in the range of 10% to 50% over no checking at all -- even for heavy-weight assertions that would otherwise result in crushing slowdowns.Keywords
This publication has 15 references indexed in Scilit:
- GC assertions2009
- Fast Track: A Software System for Speculative Program Optimization2009
- Speculation for Parallelizing Runtime Checks2009
- Parallelizing security checks on commodity hardware2008
- SuperPin: Parallelizing Dynamic Instrumentation for Real-Time Performance2007
- Correctness-preserving derivation of concurrent garbage collection algorithms2006
- Safe futures for Java2005
- An on-the-fly mark and sweep garbage collector based on sliding views2003
- A real-time garbage collector with low overhead and consistent utilization2003
- Real-time garbage collection on general-purpose machinesJournal of Systems and Software, 1990