Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article

Sound predictive race detection in polynomial time

Published: 25 January 2012 Publication 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.

Supplementary Material

JPG File (popl_6a_2.jpg)
MP4 File (popl_6a_2.mp4)

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

Cited By

View all
  • (2021)Business Recommender System through Matchmaking with Supervised Machine Learning in Distributed Digital Platforms: Energy Complexity Analysis2021 8th International Conference on Future Internet of Things and Cloud (FiCloud)10.1109/FiCloud49777.2021.00060(372-376)Online publication date: Aug-2021
  • (2021)GoBench: A Benchmark Suite of Real-World Go Concurrency Bugs2021 IEEE/ACM International Symposium on Code Generation and Optimization (CGO)10.1109/CGO51591.2021.9370317(187-199)Online publication date: 27-Feb-2021
  • (2021)On interleaving space exploration of multi-threaded programsFrontiers of Computer Science: Selected Publications from Chinese Universities10.1007/s11704-020-9501-615:4Online publication date: 1-Aug-2021
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

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
  • 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
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
Published in SIGPLAN Volume 47, Issue 1

Check for updates

Author Tags

  1. dynamic analysis
  2. happens-before
  3. race detection

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)51
  • Downloads (Last 6 weeks)9
Reflects downloads up to 17 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2021)Business Recommender System through Matchmaking with Supervised Machine Learning in Distributed Digital Platforms: Energy Complexity Analysis2021 8th International Conference on Future Internet of Things and Cloud (FiCloud)10.1109/FiCloud49777.2021.00060(372-376)Online publication date: Aug-2021
  • (2021)GoBench: A Benchmark Suite of Real-World Go Concurrency Bugs2021 IEEE/ACM International Symposium on Code Generation and Optimization (CGO)10.1109/CGO51591.2021.9370317(187-199)Online publication date: 27-Feb-2021
  • (2021)On interleaving space exploration of multi-threaded programsFrontiers of Computer Science: Selected Publications from Chinese Universities10.1007/s11704-020-9501-615:4Online publication date: 1-Aug-2021
  • (2020)Efficient reordering and replay of execution traces of distributed reactive systems in the context of model-driven developmentProceedings of the 23rd ACM/IEEE International Conference on Model Driven Engineering Languages and Systems10.1145/3365438.3410939(285-296)Online publication date: 16-Oct-2020
  • (2019)Dependence-aware, unbounded sound predictive race detectionProceedings of the ACM on Programming Languages10.1145/33606053:OOPSLA(1-30)Online publication date: 10-Oct-2019
  • (2019)Predicting all data race pairs for a specific scheduleProceedings of the 16th ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes10.1145/3357390.3361022(72-84)Online publication date: 21-Oct-2019
  • (2019)Performance Evaluation of Data Race Detection Based on Thread Sharing Analysis With Different Granularities: An Empirical StudyIEEE Access10.1109/ACCESS.2019.29209477(73819-73829)Online publication date: 2019
  • (2019)Empirical research on concurrent software testing: A systematic mapping studyInformation and Software Technology10.1016/j.infsof.2018.08.017105(226-251)Online publication date: Jan-2019
  • (2018)Sound deadlock predictionProceedings of the ACM on Programming Languages10.1145/32765162:OOPSLA(1-29)Online publication date: 24-Oct-2018
  • (2018)Two-Phase Dynamic Analysis of Message-Passing Go Programs Based on Vector ClocksProceedings of the 20th International Symposium on Principles and Practice of Declarative Programming10.1145/3236950.3236959(1-13)Online publication date: 3-Sep-2018
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media