Abstract
Locksmith is a static analysis tool for automatically detecting data races in C programs. In this article, we describe each of Locksmith's component analyses precisely, and present systematic measurements that isolate interesting trade-offs between precision and efficiency in each analysis. Using a benchmark suite comprising stand-alone applications and Linux device drivers totaling more than 200,000 lines of code, we found that a simple no-worklist strategy yielded the most efficient interprocedural dataflow analysis; that our sharing analysis was able to determine that most locations are thread-local, and therefore need not be protected by locks; that modeling C structs and void pointers precisely is key to both precision and efficiency; and that context sensitivity yields a much more precise analysis, though with decreased scalability. Put together, our results illuminate some of the key engineering challenges in building Locksmith and data race detection analyses in particular, and constraint-based program analyses in general.
- Agarwal, R., Sasturkar, A., Wang, L., and Stoller, S. D. 2005. Optimized run-time race detection and atomicity checking using partial discovered types. In Proceedings of the 20th IEEE/ACM International Conference on Automated Software Engineering ASE'05. ACM Press, New York, NY, 233--242. Google Scholar
Digital Library
- Agarwal, R. and Stoller, S. D. 2004. Type inference for parameterized race-free java. In Proceedings of the 5th International Conference on Verification, Model Checking and Abstract Interpretation. Lecture Notes in Computer Science, vol. 2937. Springer-Verlag, 149--160.Google Scholar
- Aho, A. V. and Ullman, J. D. 1977. Principles of Compiler Design (Addison-Wesley Series in Computer Science and Information Processing). Addison-Wesley Longman Publishing Co., Inc., Boston, MA. Google Scholar
Digital Library
- Aiken, A., Foster, J. S., Kodumal, J., and Terauchi, T. 2003. Checking and inferring local non-aliasing. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'03). ACM Press, New York, NY, 129--140. Google Scholar
Digital Library
- Alexandrescu, A., Boehm, H., Henney, K., Hutchings, B., Lea, D., and Pugh, B. 2005. Memory model for multithreaded c++: Issues. http://en.scientificcommons.org/42366732.Google Scholar
- Boyapati, C. and Rinard, M. 2001. A parameterized type system for race-free java programs. In Proceedings of the 16th ACM SIGPLAN Conference on Object Oriented Programming, Systems, Languages, and Applications. (OOPSLA'01). ACM Press, New York, NY, 56--69. Google Scholar
Digital Library
- Choi, J.-D., Lee, K., Loginov, A., O'Callahan, R., Sarkar, V., and Sridharan, M. 2002. Efficient and precise datarace detection for multithreaded object-oriented programs. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'02). ACM Press, New York, NY, 258--269. Google Scholar
Digital Library
- Cooper, K. D., Harvey, T. J., and Kennedy, K. 2004. Iterative data-flow analysis, revisited. Tech. rep. TR04-100, Department of Computer Science, Rice University.Google Scholar
- Crary, K., Walker, D., and Morrisett, G. 1999. Typed memory management in a calculus of capabilities. In Proceedings of the 26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. (POPL'99). ACM Press, New York, NY, 262--275. Google Scholar
Digital Library
- Engler, D. and Ashcraft, K. 2003. Racerx: effective, static detection of race conditions and deadlocks. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP'03). ACM Press, New York, NY, 237--252. Google Scholar
Digital Library
- Fahndrich, M. and DeLine, R. 2002. Adoption and focus: practical linear types for imperative programming. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'02). ACM Press, New York, NY, 13--24. Google Scholar
Digital Library
- Fähndrich, M., Rehof, J., and Das, M. 2000. Scalable context-sensitive flow analysis using instantiation constraints. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'00). ACM, New York, NY, 253--263. Google Scholar
Digital Library
- Flanagan, C. and Abadi, M. 1999. Types for safe locking. In Proceedings of the 8th European Symposium on Programming Languages and Systems (ESOP'99). Springer-Verlag, 91--108. Google Scholar
Digital Library
- Flanagan, C. and Freund, S. N. 2000. Type-based race detection for java. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'00). ACM Press, New York, NY, 219--232. Google Scholar
Digital Library
- Flanagan, C. and Freund, S. N. 2001. Detecting race conditions in large programs. In Proceedings of the ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering (PASTE'01). ACM Press, New York, NY, 90--96. Google Scholar
Digital Library
- Flanagan, C. and Freund, S. N. 2004. Atomizer: a dynamic atomicity checker for multithreaded programs. In Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'04). ACM Press, New York, NY, 256--267. Google Scholar
Digital Library
- Flanagan, C. and Freund, S. N. 2007. Type inference against races. Sci. Comput. Program. 64, 1, 140--165. Google Scholar
Digital Library
- Flanagan, C., Freund, S. N., and Lifshin, M. 2005. Type inference for atomicity. In Proceedings of the ACM SIGPLAN International Workshop on Types in Languages Design and Implementation (TLDI'05). ACM Press, New York, NY, 47--58. Google Scholar
Digital Library
- Flanagan, C., Leino, K. R. M., Lillibridge, M., Nelson, G., Saxe, J. B., and Stata, R. 2002. Extended static checking for java. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'02). ACM Press, New York, NY, 234--245. Google Scholar
Digital Library
- Flanagan, C. and Qadeer, S. 2003. A type and effect system for atomicity. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'03). ACM Press, New York, NY, 338--349. Google Scholar
Digital Library
- Foster, J. S., Johnson, R., Kodumal, J., and Aiken, A. 2006. Flow-insensitive type qualifiers. ACM Trans. Program. Lang. Syst. 28, 6, 1035--1087. Google Scholar
Digital Library
- Foster, J. S., Terauchi, T., and Aiken, A. 2002. Flow-sensitive type qualifiers. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'02). ACM Press, New York, NY, 1--12. Google Scholar
Digital Library
- Grossman, D. 2003. Type-safe multithreading in cyclone. In Proceedings of the ACM SIGPLAN International Workshop on Types in Languages Design and Implementation (TLDI'03). ACM Press, New York, NY, 13--25. Google Scholar
Digital Library
- Heintze, N. and Tardieu, O. 2001. Ultra-fast aliasing analysis using cla: a million lines of c code in a second. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'01). ACM, New York, NY, 254--263. Google Scholar
Digital Library
- Henglein, F. 1993. Type inference with polymorphic recursion. ACM Trans. Program. Lang. Syst. 15, 2, 253--289. Google Scholar
Digital Library
- Henglein, F., Makholm, H., and Niss, H. 2001. A direct approach to control-flow sensitive region-based memory management. In Proceedings of the 3rd ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP'01). ACM Press, New York, NY, 175--186. Google Scholar
Digital Library
- Henzinger, T. A., Jhala, R., and Majumdar, R. 2004. Race checking by context inference. SIGPLAN No. 39, 6, 1--13. Google Scholar
Digital Library
- Hote, C. 2004. Runtime error detection through semantic analysis. http//nesl.ee.ucla.edu/courses/ee202a/2005f/papers/Semantic_Analysis.pdf.Google Scholar
- Intel. 2007. Teraflops research chip. http//techresearch.intel.com/ProjectDetails.aspx?Id=151.Google Scholar
- Johnson, R. and Wagner, D. 2004. Finding user/kernel pointer bugs with type inference. In Proceedings of the 13th Conference on USENIX Security Symposium (SSYM'04). USENIX Association, Berkeley, CA, 9--9. Google Scholar
Digital Library
- Kodumal, J. and Aiken, A. 2004. The set constraint/cfl reachability connection in practice. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'04). ACM, New York, NY, 207--218. Google Scholar
Digital Library
- Kodumal, J. and Aiken, A. 2005. Banshee: A scalable constraint-based analysis toolkit. In Proceedings of the 12th International Static Analaysis Symposium. C. Hankin and I. Siveroni, Eds. Lecture Notes in Computer Science, vol. 3672. Springer, 218--234. Google Scholar
Digital Library
- Lamport, L. 1978. Time, clocks, and the ordering of events in a distributed system. Comm. ACM 21, 7, 558--565. Google Scholar
Digital Library
- Leveson, N. G. and Turner, C. S. 1993. An investigation of the therac-25 accidents. Computer 26, 7, 18--41. Google Scholar
Digital Library
- Manson, J., Pugh, W., and Adve, S. V. 2005. The java memory model. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'05). ACM Press, New York, NY, 378--391. Google Scholar
Digital Library
- Mossin, C. 1996. Flow Analysis of Typed Higher-Order Programs. Ph.D. thesis, DIKU, Department of Computer Science, University of Copenhagen.Google Scholar
- Naik, M. and Aiken, A. 2007. Conditional must not aliasing for static race detection. SIGPLAN No. 42, 1, 327--338. Google Scholar
Digital Library
- Naik, M., Aiken, A., and Whaley, J. 2006. Effective static race detection for java. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'06). ACM Press, New York, NY, 308--319. Google Scholar
Digital Library
- Neamtiu, I., Hicks, M., Foster, J. S., and Pratikakis, P. 2008. Contextual effects for version-consistent dynamic software updating and safe concurrent programming. In Proceedings of the ACM Conference on Principles of Programming Languages (POPL). ACM, New York, NY, 37--50. Google Scholar
Digital Library
- Necula, G. C., McPeak, S., Rahul, S. P., and Weimer, W. 2002. Cil: Intermediate language and tools for analysis and transformation of c programs. In Proceedings of the 11th International Conference on Compiler Construction (CC'02). Springer-Verlag, 213--228. Google Scholar
Digital Library
- News.com. 2007. Designer puts 96 cores on single chip. http//news.com.com/Designer+puts+96+cores+on+single+chip/2100-1006_3-5399128.html.Google Scholar
- O'Callahan, R. and Choi, J.-D. 2003. Hybrid dynamic data race detection. In Proceedings of the 9th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP'03). ACM Press, New York, NY, 167--178. Google Scholar
Digital Library
- Pierce, B. C. 2002. Types and Programming Languages. MIT Press, Cambridge, MA. Google Scholar
Digital Library
- Poulsen, K. 2004. Tracking the blackout bug. http://www.securityfocus.com/news/8412.Google Scholar
- Pratikakis, P., Foster, J. S., and Hicks, M. 2006a. Existential label flow inference via CFL reachability. In Proceedings of the Static Analysis Symposium (SAS). Springer, 88--106. Google Scholar
Digital Library
- Pratikakis, P., Foster, J. S., and Hicks, M. 2006b. Locksmith: context-sensitive correlation analysis for race detection. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'06). ACM Press, New York, NY, 320--331. Google Scholar
Digital Library
- Qadeer, S. and Wu, D. 2004. Kiss: keep it simple and sequential. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'04). ACM Press, New York, NY, 14--24. Google Scholar
Digital Library
- Rehof, J. and Fähndrich, M. 2001. Type-base flow analysis: from polymorphic subtyping to cfl-reachability. In Proceedings of the 28th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'01). ACM Press, New York, NY, 54--66. Google Scholar
Digital Library
- Reps, T., Horwitz, S., and Sagiv, M. 1995. Precise interprocedural dataflow analysis via graph reachability. In Proceedings of the 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'95). ACM Press, New York, NY, 49--61. Google Scholar
Digital Library
- Reynolds, J. C. 2004. Toward a grainless semantics for shared-variable concurrency. In Proceedings of the Conference on Foundations of Software Technology and Theoretical Computer Science, K. Lodaya and M. Mahajan, Eds. Lecture Notes in Computer Science, vol. 3328. Springer, 35--48. Google Scholar
Digital Library
- Rose, J., Swamy, N., and Hicks, M. 2005. Dynamic inference of polymorphic lock types. Sci. Comput. Program. 58, 3, 366--383. Google Scholar
Digital Library
- Savage, S., Burrows, M., Nelson, G., Sobalvarro, P., and Anderson, T. 1997. Eraser: A dynamic data race detector for multithreaded programs. ACM Trans. Comput. Syst. 15, 4, 391--411. Google Scholar
Digital Library
- Seidl, H., Vene, V., and Müller-Olm, M. 2003. Global invariants for analyzing multi-threaded applications. Proc. Estonian Acad. Sci. Phys. Math, 413-436.Google Scholar
- Siff, M., Chandra, S., Ball, T., Kunchithapadam, K., and Reps, T. 1999. Coping with type casts in c. In Proceedings of the 7th European Software Engineering Conference Held Jointly with the 7th ACM SIGSOFT International Symposium on Foundations of Software Engineering. Springer-Verlag, 180--198. Google Scholar
Digital Library
- Smith, F., Walker, D., and Morrisett, J. G. 2000. Alias types. In Proceedings of the 9th European Symposium on Programming Languages and Systems (ESOP'00). Springer-Verlag, 366--381. Google Scholar
Digital Library
- Talpin, J.-P. and Jouvelot, P. 1994. The type and effect discipline. Inform. Comput. 111, 2, 245--296. Google Scholar
Digital Library
- Terauchi, T. 2008. Checking race freedom via linear programming. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'08). ACM, New York, NY, 1--10. Google Scholar
Digital Library
- Tofte, M. and Birkedal, L. 1998. A region inference algorithm. ACM Trans. Program. Lang. Syst. 20, 4, 724--767. Google Scholar
Digital Library
- von Praun, C. and Gross, T. R. 2003. Static conflict analysis for multi-threaded object-oriented programs. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'03). ACM, New York, NY, 115--128. Google Scholar
Digital Library
- Voung, J. W., Jhala, R., and Lerner, S. 2007. Relay: static race detection on millions of lines of code. In Proceedings of the 6th joint meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering (ESEC-FSE'07). ACM, New York, NY, 205--214. Google Scholar
Digital Library
Index Terms
LOCKSMITH: Practical static race detection for C
Recommendations
LOCKSMITH: context-sensitive correlation analysis for race detection
Proceedings of the 2006 PLDI ConferenceOne 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 ...
LOCKSMITH: context-sensitive correlation analysis for race detection
PLDI '06: Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and ImplementationOne 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 ...
Parameterized object sensitivity for points-to analysis for Java
The goal of points-to analysis for Java is to determine the set of objects pointed to by a reference variable or a reference object field. We present object sensitivity, a new form of context sensitivity for flow-insensitive points-to analysis for Java. ...








Comments