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

skip to main content
10.1145/2103656.2103702acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
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
  • (2024)Accurate Data Race Prediction in the Linux Kernel through Sparse Fourier LearningProceedings of the ACM on Programming Languages10.1145/36498408:OOPSLA1(810-832)Online publication date: 29-Apr-2024
  • (2024)Predictive Monitoring against Pattern Regular LanguagesProceedings of the ACM on Programming Languages10.1145/36329158:POPL(2191-2225)Online publication date: 5-Jan-2024
  • (2024)Coarser Equivalences for Causal ConcurrencyProceedings of the ACM on Programming Languages10.1145/36328738:POPL(911-941)Online publication date: 5-Jan-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

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
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]

Sponsors

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 25 January 2012

Permissions

Request permissions for this article.

Check for updates

Author Tags

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

Qualifiers

  • Research-article

Conference

POPL '12
Sponsor:

Acceptance Rates

Overall Acceptance Rate 824 of 4,130 submissions, 20%

Upcoming Conference

POPL '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)42
  • Downloads (Last 6 weeks)21
Reflects downloads up to 28 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Accurate Data Race Prediction in the Linux Kernel through Sparse Fourier LearningProceedings of the ACM on Programming Languages10.1145/36498408:OOPSLA1(810-832)Online publication date: 29-Apr-2024
  • (2024)Predictive Monitoring against Pattern Regular LanguagesProceedings of the ACM on Programming Languages10.1145/36329158:POPL(2191-2225)Online publication date: 5-Jan-2024
  • (2024)Coarser Equivalences for Causal ConcurrencyProceedings of the ACM on Programming Languages10.1145/36328738:POPL(911-941)Online publication date: 5-Jan-2024
  • (2024)Greybox Fuzzing for Concurrency TestingProceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 210.1145/3620665.3640389(482-498)Online publication date: 27-Apr-2024
  • (2024)Optimistic Prediction of Synchronization-Reversal Data RacesProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639099(1-13)Online publication date: 20-May-2024
  • (2024)Reorder Pointer Flow in Sound Concurrency Bug PredictionProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3623300(1-13)Online publication date: 20-May-2024
  • (2024)Predictive Monitoring with Strong Trace PrefixesComputer Aided Verification10.1007/978-3-031-65630-9_9(182-204)Online publication date: 24-Jul-2024
  • (2023)Sound Dynamic Deadlock Prediction in Linear TimeProceedings of the ACM on Programming Languages10.1145/35912917:PLDI(1733-1758)Online publication date: 6-Jun-2023
  • (2023)RaceInjector: Injecting Races to Evaluate and Learn Dynamic Race Detection AlgorithmsProceedings of the 12th ACM SIGPLAN International Workshop on the State Of the Art in Program Analysis10.1145/3589250.3596142(63-70)Online publication date: 6-Jun-2023
  • (2023)Dynamic Race Detection with O(1) SamplesProceedings of the ACM on Programming Languages10.1145/35712387:POPL(1308-1337)Online publication date: 11-Jan-2023
  • Show More Cited By

View Options

Get Access

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