ABSTRACT
Data races are among the most reliable indicators of programming errors in concurrent software. For at least two decades, Lamport's happens-before (HB) relation has served as the standard test for detecting races--other techniques, such as lockset-based approaches, fail to be sound, as they may falsely warn of races. This work introduces a new relation, causally-precedes (CP), which generalizes happens-before to observe more races without sacrificing soundness. Intuitively, CP tries to capture the concept of happens-before ordered events that must occur in the observed order for the program to observe the same values. What distinguishes CP from past predictive race detection approaches (which also generalize an observed execution to detect races in other plausible executions) is that CP-based race detection is both sound and of polynomial complexity. We demonstrate that the unique aspects of CP result in practical benefit. Applying CP to real-world programs, we successfully analyze server-level applications (e.g., Apache FtpServer) and show that traces longer than in past predictive race analyses can be analyzed in mere seconds to a few minutes. For these programs, CP race detection uncovers races that are hard to detect by repeated execution and HB race detection: a single run of CP race detection produces several races not discovered by 10 separate rounds of happens-before race detection.
Supplemental Material
References
- M. Abadi, C. Flanagan, and S. N. Freund. Types for safe locking: Static race detection for Java. Transactions on Programming Languages and Systems (TOPLAS), 28(2):207--255, 2006. Google Scholar
- R. Agarwal, A. Sasturkar, L. Wang, and S. D. Stoller. Optimized runtime race detection and atomicity checking using partial discovered types. In International Conference on Automated Software Engineering (ASE), 2005. Google Scholar
Digital Library
- A. Aiken and D. Gay. Barrier inference. In Symposium on Principles of Programming Languages (POPL), 1998. Google Scholar
- D. F. Bacon, R. E. Strom, and A. Tarafdar. Guava: a dialect of Java without data races. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2000. Google Scholar
- U. Banerjee, B. Bliss, Z. Ma, and P. Petersen. A theory of data race detection. In Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging (PADTAD), 2006. Google Scholar
- E. Bodden and K. Havelund. Racer: effective race detection using AspectJ. In International Symposium on Software Testing and Analysis (ISSTA), 2008. Google Scholar
- M. D. Bond, K. E. Coons, and K. S. McKinley. PACER: proportional detection of data races. In Conference on Programming Language Design and Implementation (PLDI), 2010. Google Scholar
- C. Boyapati, R. Lee, and M. Rinard. A type system for preventing data races and deadlocks in Java programs. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2002. Google Scholar
- F. Chen and G. Roşu. Predicting concurrency errors at runtime using sliced causality. Technical Report UIUCDCS-R-2006--2965, Department of Computer Science, University of Illinois at Urbana-Champaign, 2006.Google Scholar
- F. Chen and G. Roşu. Parametric and Sliced Causality. In Computer Aided Verification (CAV), 2007. Google Scholar
- F. Chen, T. F. Serbanuta, and G. Rosu. Effective predictive runtime analysis using sliced causality and atomicity. Technical Report UIUCDCS-R-2007--2905, University of Illinois at Urbana-Champaign, Department of Computer Science, October 2007.Google Scholar
- F. Chen, T. F. Serbanuta, and G. Rosu. jPredictor: a predictive runtime analysis tool for Java. In International Conference on Software Engineering (ICSE), 2008. Google Scholar
- J.-D. Choi, K. Lee, A. Loginov, R. O'Callahan, V. Sarkar, and M. Sridhara. Efficient and precise datarace detection for multithreaded object-oriented programs. In Conference on Programming Language Design and Implementation (PLDI), 2002. Google Scholar
- M. Christiaens and K. D. Bosschere. TRaDe: Data Race Detection for Java. In International Conference on Computational Science, 2001. Google Scholar
- A. Dinning and E. Schonberg. Detecting access anomalies in programs with critical sections. SIGPLAN Notices, 26(12):85--96, 1991. Google Scholar
- M. B. Dwyer and L. A. Clarke. Data flow analysis for verifying properties of concurrent programs. In International Symposium on Foundations of Software Engineering (FSE), 1994. Google Scholar
- T. Elmas, S. Qadeer, and S. Tasiran. Goldilocks: a race and transaction-aware Java runtime. In Conference on Programming Language Design and Implementation (PLDI), 2007. Google Scholar
- M. Emmi, S. Qadeer, and Z. Rakamarić. Delay-bounded scheduling. In Symposium on Principles of Programming Languages (POPL), 2011. Google Scholar
- D. R. Engler and K. Ashcraft. RacerX: Effective, static detection of race conditions and deadlocks. In ACM Symposium on Operating Systems Principles (SOSP), 2003. Google Scholar
- A. Farzan, P. Madhusudan, and F. Sorrentino. Meta-analysis for atomicity violations under nested locking. In Computer Aided Verification (CAV), 2009. Google Scholar
- C. Flanagan and S. N. Freund. FastTrack: efficient and precise dynamic race detection. In Conference on Programming Language Design and Implementation (PLDI), 2009. Google Scholar
- C. Flanagan and S. N. Freund. The roadrunner dynamic analysis framework for concurrent programs. In PASTE, pages 1--8, 2010. Google Scholar
- C. Flanagan, S. N. Freund, and J. Yi. Velodrome: A sound and complete dynamic atomicity checker for multithreaded programs. In Conference on Programming Language Design and Implementation (PLDI), 2008. Google Scholar
- D. Grossman. Type-safe multithreading in Cyclone. In Workshop on Types in Language Design and Implementation (TLDI), 2003. Google Scholar
- J. J. Harrow. Runtime checking of multithreaded applications with visual threads. In International SPIN Workshop on Model Checking of Software, 2000. Google Scholar
- D. P. Helmbold, C. E. McDowell, and J. zhong Wang. Detecting data races by analyzing sequential traces. In HICCS-24, Hawaii Intl. Conference on System Sciences (HICCS-24), 1990.Google Scholar
- V. Kahlon, F. Ivancić, and A. Gupta. Reasoning about threads communicating via locks. In Computer Aided Verification (CAV), 2005. Google Scholar
- V. Kahlon and C. Wang. Universal causality graphs: A precise happens-before model for detecting bugs in concurrent programs. In Computer Aided Verification (CAV), 2010. Google Scholar
- S. K. Lahiri, S. Qadeer, and Z. Rakamarić. Static and precise detection of concurrency errors in systems code using smt solvers. In Computer Aided Verification (CAV), 2009. Google Scholar
- L. Lamport. Time, clocks, and the ordering of events in a distributed system. Communications of the ACM, 21:558--565, July 1978. Google Scholar
- J. Manson, W. Pugh, and S. V. Adve. The Java memory model. In Conference on Programming Language Design and Implementation (PLDI), 2005. Google Scholar
- J. M. Mellor-Crummey. On-the-fly detection of data races for programs with nested fork-join parallelism. In Supercomputing, 1991. Google Scholar
- M. Musuvathi, S. Qadeer, T. Ball, G. Basler, P. A. Nainar, and I. Neamtiu. Finding and reproducing heisenbugs in concurrent programs. In Operating Systems Design and Implementation (OSDI), 2008. Google Scholar
- M. Naik, A. Aiken, and J. Whaley. Effective static race detection for Java. In Conference on Programming Language Design and Implementation (PLDI), 2006. Google Scholar
- H. Nishiyama. Detecting data races using dynamic escape analysis based on read barrier. In Virtual Machine Research and Technology Symposium (VM), 2004. Google Scholar
- R. O'Callahan and J.-D. Choi. Hybrid dynamic data race detection. In Symposium on Principles and Practice of Parallel Programming (PPoPP), 2003. Google Scholar
- E. Pozniansky and A. Schuster. Efficient on-the-fly data race detection in multihreaded C+ programs. In Symposium on Principles and Practice of Parallel Programming (PPoPP), 2003. Google Scholar
- E. Pozniansky and A. Schuster. Multirace: efficient on-the-fly data race detection in multithreaded C+ programs. Concurrency and Computation: Practice and Experience, 19(3):327--340, 2007. Google Scholar
- P. Pratikakis, J. S. Foster, and M. Hicks. Context-sensitive correlation analysis for detecting races. In Conference on Programming Language Design and Implementation (PLDI), 2006. Google Scholar
- M. Said, C. Wang, Z. Yang, and K. Sakallah. Generating data race witnesses by an smt-based analysis. In NASA Formal Methods Symposium, pages 313--327. Springer, 2011. Google Scholar
- A. Sasturkar, R. Agarwal, L. Wang, and S. D. Stoller. Automated type-based analysis of data races and atomicity. In Symposium on Principles and Practice of Parallel Programming (PPoPP), 2005. Google Scholar
- S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson. Eraser: a dynamic data race detector for multi-threaded programs. In ACM Symposium on Operating Systems Principles (SOSP), 1997. Google Scholar
Digital Library
- E. Schonberg. On-the-fly detection of access anomalies. In Conference on Programming Language Design and Implementation (PLDI), 1989. Google Scholar
- K. Sen. Race directed random testing of concurrent programs. In Conference on Programming Language Design and Implementation (PLDI), 2008. Google Scholar
- K. Sen and G. Agha. Detecting errors in multithreaded programs by generalized predictive analysis of executions. In IIFIP International Conference on Formal Methods for Open Object-Based Distributed Systems (FMOODS), 2005. Google Scholar
- K. Sen, G. Rosu, and G. Agha. Online efficient predictive safety analysis of multithreaded programs. International Journal on Software Technology and Tools Transfer (STTT), 8(3):248--260, 2006. Google Scholar
- T. F. Serbanuta, F. Chen, and G. Roşu. Maximal causal models for multithreaded systems. Technical Report UIUCDCS-R-2008--3017, University of Illinois at Urbana-Champaign, Department of Computer Science, December 2008.Google Scholar
- N. Sinha and C. Wang. On interference abstractions. In Symposium on Principles of Programming Languages (POPL), 2011. Google Scholar
- F. Sorrentino, A. Farzan, and P. Madhusudan. PENELOPE: weaving threads to expose atomicity violations. In International Symposium on Foundations of Software Engineering (FSE), 2010. Google Scholar
- N. Sterling. Warlock: A static data race analysis tool. In USENIX Winter Technical Conference, 1993.Google Scholar
- The Apache Software Foundation. Apache FtpServer. Available at http://mina.apache.org/ftpserver/, 2009.Google Scholar
- The Apache Software Foundation. Apache JMeter. Available at http://jakarta.apache.org/jmeter/, 2009.Google Scholar
- The World Wide Web Consortium. Jigsaw Web Server. Available from http://www.w3.org/Jigsaw/, 2009.Google Scholar
- C. von Praun and T. Gross. Static conflict analysis for multi-threaded object-oriented programs. In Conference on Programming Language Design and Implementation (PLDI), 2003. Google Scholar
- C. von Praun and T. R. Gross. Object race detection. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2001. Google Scholar
- J. W. Voung, R. Jhala, and S. Lerner. Relay: static race detection on millions of lines of code. In International Symposium on Foundations of Software Engineering (FSE), 2007. Google Scholar
- C. Wang, S. Kundu, M. Ganai, and A. Gupta. Symbolic predictive analysis for concurrent programs. In World Congress on Formal Methods (FM), 2009. Google Scholar
- C. Wang, R. Limaye, M. Ganai, and A. Gupta. Trace-based symbolic analysis for atomicity violations. In Tools and Algorithms for the Construction and Analysis of Systems (TACAS), 2010. Google Scholar
- L. Wang and S. D. Stoller. Accurate and efficient runtime detection of atomicity errors in concurrent programs. In Symposium on Principles and Practice of Parallel Programming (PPoPP), 2006. Google Scholar
- J. Whaley. Context-Sensitive Pointer Analysis using Binary Decision Diagrams. PhD thesis, Stanford University, Mar. 2007. Google Scholar
- Y. Yu. RaceTrack: Efficient detection of data race conditions via adaptive tracking. In ACM Symposium on Operating Systems Principles (SOSP), 2005. Google Scholar
Index Terms
Sound predictive race detection in polynomial time






Comments