Randomized Active Atomicity Violation Detection in Concurrent Programs

TitleRandomized Active Atomicity Violation Detection in Concurrent Programs
Publication TypeConference Paper
Year of Publication2008
AuthorsPark, C. - S., & Sen K.
Conference Name16th International Symposium on Foundations of Software Engineering (FSE'08)
Date Published11/2008
Conference LocationAtlanta, GA
ISBN Number978-1-59593-995-1

Atomicity is an important specification that enables programmers to understand atomic blocks of code in a multi-threaded program as if they are sequential. This significantly simplifies the programmer's job to reason about correctness. Several modern multithreaded programming languages provide no built-in support to ensure atomicity; instead they rely on the fact that programmers would use locks properly in order to guarantee that atomic code blocks are indeed atomic. However, improper use of locks can sometimes fail to ensure atomicity. Therefore, we need tools that can check atomicity properties of lock-based code automatically.

We propose a randomized dynamic analysis technique to detect a special, but important, class of atomicity violations that are often found in real-world programs. Specifically, our technique modifies the existing Java thread scheduler behavior to create atomicity violations with high probability. Our approach has several advantages over existing dynamic analysis tools. First, we can create a real atomicity violation and see if an exception can be thrown. Second, we can replay an atomicity violating execution by simply using the same seed for random number generation---we do not need to record the execution. Third, we give no false warnings unlike existing dynamic atomicity checking techniques. We have implemented the technique in a prototype tool for Java and have experimented on a number of large multi-threaded Java programs and libraries. We report a number of previously known and unknown bugs and atomicity violations in these Java programs.

Randomized Active Atomicity Violation Detection in Concurrent Programs.pdf322.19 KB