ASYNCCLOCK: Scalable Inference of Asynchronous Event Causality

作者:Hsiao Chun Hung*; Narayanasamy Satish; Khan Essam Muhammad Idris; Pereira Cristiano L; Pokam Gilles A
来源:ACM Sigplan Notices, 2017, 52(4): 193-205.
DOI:10.1145/3037697.3037712

摘要

Asynchronous programming model is commonly used in mobile systems and Web 2.0 environments. Asynchronous race detectors use algorithms that are an order of magnitude performance and space inefficient compared to conventional data race detectors. We solve this problem by identifying and addressing two important problems in reasoning about causality between asynchronous events. Unlike conventional signal-wait operations, establishing causal order between two asynchronous events is fundamentally more challenging as there is no common handle they operate on. We propose a new primitive named ASYNCCLOCK that addresses this problem by explicitly tracking causally preceding events, and show that ASYNCCLOCK can handle a wide variety of asynchronous causality models. We also address the important scalability problem of efficiently identifying heirless events whose metadata can be reclaimed. We built the first single-pass, non-graph-based Android race detector using our algorithm and applied it to find errors in 20 popular applications. Our tool incurs about 6x performance overhead, which is several times more efficient than the state-of-the-art solution. It also scales well with the execution length. We used our tool to find 147 previously unknown harmful races.

  • 出版日期2017-4