aComment: Mining Annotations from Comments and Code to Detect Interrupt Related Concurrency Bugs

Lin Tan, Yuanyuan Zhou, and Yoann Padioleau
University of Waterloo, Canada; UC San Diego, USA; Facebook Inc., USA

Concurrency bugs in an operating system (OS) are detrimental as they can cause the OS to fail and affect all applications running on top of the OS. Detecting OS concurrency bugs is challenging due to the complexity of the OS synchronization, particularly with the presence of the OS specific interrupt context. Existing dynamic concurrency bug detection techniques are designed for user-level applications and cannot be applied to operating systems.

To detect OS concurrency bugs, we proposed a new type of annotations – interrupt related annotations – and generated 96,821 such annotations for the Linux kernel with little manual effort. These annotations have been used to automatically detect 9 real OS concurrency bugs (7 of which were previously unknown). Two of the key techniques that make the above contributions possible are: (1) using a hybrid approach to extract annotations from both code and comments written in natural language to achieve better coverage and accuracy in annotation extraction and bug detection; and (2) automatically propagating annotations to caller functions to improve annotating and bug detection. These two techniques are general and can be applied to non-OS code, code written in other programming languages such as Java, and for extracting other types of specifications.