LOCKSMITH: context-sensitive correlation analysis for race detection
Title | LOCKSMITH: context-sensitive correlation analysis for race detection |
Publication Type | Journal Articles |
Year of Publication | 2006 |
Authors | Pratikakis P, Foster JS, Hicks MW |
Journal | SIGPLAN Not. |
Volume | 41 |
Issue | 6 |
Pagination | 320 - 331 |
Date Published | 2006/06// |
ISBN Number | 0362-1340 |
Keywords | context-sensitivity, correlation, locksmith, multi-threaded programming, race detection, Type inference |
Abstract | One common technique for preventing data races in multi-threaded programs is to ensure that all accesses to shared locations are consistently protected by a lock. We present a tool called LOCKSMITH for detecting data races in C programs by looking for violations of this pattern. We call the relationship between locks and the locations they protect consistent correlation, and the core of our technique is a novel constraint-based analysis that infers consistent correlation context-sensitively, using the results to check that locations are properly guarded by locks. We present the core of our algorithm for a simple formal language λ> which we have proven sound, and discuss how we scale it up to an algorithm that aims to be sound for all of C. We develop several techniques to improve the precision and performance of the analysis, including a sharing analysis for inferring thread locality; existential quantification for modeling locks in data structures; and heuristics for modeling unsafe features of C such as type casts. When applied to several benchmarks, including multi-threaded servers and Linux device drivers, LOCKSMITH found several races while producing a modest number of false alarm. |
URL | http://doi.acm.org/10.1145/1133255.1134019 |
DOI | 10.1145/1133255.1134019 |