skip to main content
10.1145/2103656.2103702acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Sound predictive race detection in polynomial time

Authors Info & Claims
Published:25 January 2012Publication History

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.

Skip Supplemental Material Section

Supplemental Material

popl_6a_2.mp4

mp4

283.9 MB

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. Aiken and D. Gay. Barrier inference. In Symposium on Principles of Programming Languages (POPL), 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. E. Bodden and K. Havelund. Racer: effective race detection using AspectJ. In International Symposium on Software Testing and Analysis (ISSTA), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle Scholar
  10. F. Chen and G. Roşu. Parametric and Sliced Causality. In Computer Aided Verification (CAV), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle Scholar
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Christiaens and K. D. Bosschere. TRaDe: Data Race Detection for Java. In International Conference on Computational Science, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. A. Dinning and E. Schonberg. Detecting access anomalies in programs with critical sections. SIGPLAN Notices, 26(12):85--96, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. Emmi, S. Qadeer, and Z. Rakamarić. Delay-bounded scheduling. In Symposium on Principles of Programming Languages (POPL), 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. A. Farzan, P. Madhusudan, and F. Sorrentino. Meta-analysis for atomicity violations under nested locking. In Computer Aided Verification (CAV), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. C. Flanagan and S. N. Freund. FastTrack: efficient and precise dynamic race detection. In Conference on Programming Language Design and Implementation (PLDI), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. C. Flanagan and S. N. Freund. The roadrunner dynamic analysis framework for concurrent programs. In PASTE, pages 1--8, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. D. Grossman. Type-safe multithreading in Cyclone. In Workshop on Types in Language Design and Implementation (TLDI), 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. J. J. Harrow. Runtime checking of multithreaded applications with visual threads. In International SPIN Workshop on Model Checking of Software, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle Scholar
  27. V. Kahlon, F. Ivancić, and A. Gupta. Reasoning about threads communicating via locks. In Computer Aided Verification (CAV), 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. L. Lamport. Time, clocks, and the ordering of events in a distributed system. Communications of the ACM, 21:558--565, July 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. J. Manson, W. Pugh, and S. V. Adve. The Java memory model. In Conference on Programming Language Design and Implementation (PLDI), 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. J. M. Mellor-Crummey. On-the-fly detection of data races for programs with nested fork-join parallelism. In Supercomputing, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. M. Naik, A. Aiken, and J. Whaley. Effective static race detection for Java. In Conference on Programming Language Design and Implementation (PLDI), 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. H. Nishiyama. Detecting data races using dynamic escape analysis based on read barrier. In Virtual Machine Research and Technology Symposium (VM), 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. R. O'Callahan and J.-D. Choi. Hybrid dynamic data race detection. In Symposium on Principles and Practice of Parallel Programming (PPoPP), 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  38. 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 ScholarGoogle ScholarCross RefCross Ref
  39. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  40. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  41. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  42. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  43. E. Schonberg. On-the-fly detection of access anomalies. In Conference on Programming Language Design and Implementation (PLDI), 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. K. Sen. Race directed random testing of concurrent programs. In Conference on Programming Language Design and Implementation (PLDI), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  46. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  47. 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 ScholarGoogle Scholar
  48. N. Sinha and C. Wang. On interference abstractions. In Symposium on Principles of Programming Languages (POPL), 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  50. N. Sterling. Warlock: A static data race analysis tool. In USENIX Winter Technical Conference, 1993.Google ScholarGoogle Scholar
  51. The Apache Software Foundation. Apache FtpServer. Available at http://mina.apache.org/ftpserver/, 2009.Google ScholarGoogle Scholar
  52. The Apache Software Foundation. Apache JMeter. Available at http://jakarta.apache.org/jmeter/, 2009.Google ScholarGoogle Scholar
  53. The World Wide Web Consortium. Jigsaw Web Server. Available from http://www.w3.org/Jigsaw/, 2009.Google ScholarGoogle Scholar
  54. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  55. C. von Praun and T. R. Gross. Object race detection. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  57. C. Wang, S. Kundu, M. Ganai, and A. Gupta. Symbolic predictive analysis for concurrent programs. In World Congress on Formal Methods (FM), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  59. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  60. J. Whaley. Context-Sensitive Pointer Analysis using Binary Decision Diagrams. PhD thesis, Stanford University, Mar. 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. Y. Yu. RaceTrack: Efficient detection of data race conditions via adaptive tracking. In ACM Symposium on Operating Systems Principles (SOSP), 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Sound predictive race detection in polynomial time

                Recommendations

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in
                • Published in

                  cover image ACM Conferences
                  POPL '12: Proceedings of the 39th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
                  January 2012
                  602 pages
                  ISBN:9781450310833
                  DOI:10.1145/2103656
                  • cover image ACM SIGPLAN Notices
                    ACM SIGPLAN Notices  Volume 47, Issue 1
                    POPL '12
                    January 2012
                    569 pages
                    ISSN:0362-1340
                    EISSN:1558-1160
                    DOI:10.1145/2103621
                    Issue’s Table of Contents

                  Copyright © 2012 ACM

                  Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 25 January 2012

                  Permissions

                  Request permissions about this article.

                  Request Permissions

                  Check for updates

                  Qualifiers

                  • research-article

                  Acceptance Rates

                  Overall Acceptance Rate824of4,130submissions,20%

                  Upcoming Conference

                  POPL '25

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader