Abstract
Writing reliable concurrent software remains a huge challenge for today's programmers. Programmers rarely reason about their code by explicitly considering different possible inter-leavings of its execution. We consider the problem of detecting data races from individual executions in a sound manner. The classical approach to solving this problem has been to use Lamport's happens-before (HB) relation. Until now HB remains the only approach that runs in linear time. Previous efforts in improving over HB such as causally-precedes (CP) and maximal causal models fall short due to the fact that they are not implementable efficiently and hence have to compromise on their race detecting ability by limiting their techniques to bounded sized fragments of the execution. We present a new relation weak-causally-precedes (WCP) that is provably better than CP in terms of being able to detect more races, while still remaining sound. Moreover, it admits a linear time algorithm which works on the entire execution without having to fragment it.
Supplemental Material
Available for Download
Our technique (WCP based race detection) is implemented in a Java tool RAPID. This artifact contains the tool and relevant scripts to generate trace files and analyze them using RAPID. The artifact can also be downloaded from https://publish.illinois.edu/race-prediction/
- https://publish.illinois.edu/race-prediction/.Google Scholar
- M. Abadi, C. Flanagan, and S. N. Freund. Types for Safe Locking: Static Race Detection for Java. ACM Trans. Program. Lang. Syst., 28(2):207–255, Mar. 2006. Google Scholar
Digital Library
- S. M. Blackburn, R. Garner, C. Hoffmann, A. M. Khang, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanovi´c, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. SIGPLAN Not., 41(10):169–190, Oct. 2006. Google Scholar
Digital Library
- M. D. Bond, K. E. Coons, and K. S. McKinley. PACER: Proportional Detection of Data Races. SIGPLAN Not., 45(6): 255–268, June 2010. Google Scholar
Digital Library
- C. Boyapati, R. Lee, and M. Rinard. Ownership Types for Safe Programming: Preventing Data Races and Deadlocks. SIGPLAN Not., 37(11):211–230, Nov. 2002. Google Scholar
Digital Library
- F. Chen, T. F. ¸Serbănu¸tă, and G. Ro¸su. jPredictor: a predictive runtime analysis tool for Java. In ICSE ’08: Proceedings of the 30th International Conference on Software Engineering, pages 221–230, New York, NY, USA, 2008. ACM. Google Scholar
Digital Library
- G.-I. Cheng, M. Feng, C. E. Leiserson, K. H. Randall, and A. F. Stark. Detecting Data Races in Cilk Programs That Use Locks. In Proceedings of the Tenth Annual ACM Symposium on Parallel Algorithms and Architectures, SPAA ’98, pages 298–309, New York, NY, USA, 1998. ACM. Google Scholar
Digital Library
- M. Christiaens and K. D. Bosschere. TRaDe: Data Race Detection for Java. In Proceedings of the International Conference on Computational Science-Part II, ICCS ’01, pages 761–770, London, UK, UK, 2001. Springer-Verlag. Google Scholar
Digital Library
- T. Elmas, S. Qadeer, and S. Tasiran. Goldilocks: A Race and Transaction-aware Java Runtime. SIGPLAN Not., 42(6):245– 255, June 2007. Google Scholar
Digital Library
- D. Engler and K. Ashcraft. RacerX: Effective, Static Detection of Race Conditions and Deadlocks. SIGOPS Oper. Syst. Rev., 37(5):237–252, Oct. 2003. Google Scholar
Digital Library
- E. Farchi, Y. Nir, and S. Ur. Concurrent Bug Patterns and How to Test Them. In Proceedings of the 17th International Symposium on Parallel and Distributed Processing, IPDPS ’03, pages 286.2–, Washington, DC, USA, 2003. IEEE Computer Society. Google Scholar
Digital Library
- M. Feng and C. E. Leiserson. Efficient Detection of Determinacy Races in Cilk Programs. In Proceedings of the Ninth Annual ACM Symposium on Parallel Algorithms and Architectures, SPAA ’97, pages 1–11, New York, NY, USA, 1997. ACM. Google Scholar
Digital Library
- C. Flanagan and S. N. Freund. Type-based Race Detection for Java. SIGPLAN Not., 35(5):219–232, May 2000. Google Scholar
Digital Library
- C. Flanagan and S. N. Freund. FastTrack: Efficient and Precise Dynamic Race Detection. SIGPLAN Not., 44(6):121–133, June 2009. Google Scholar
Digital Library
- C. Flanagan and S. N. Freund. The RoadRunner Dynamic Analysis Framework for Concurrent Programs. In Proceedings of the 9th ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, PASTE ’10, pages 1–8, New York, NY, USA, 2010. ACM. Google Scholar
Digital Library
- J. Huang and A. K. Rajagopalan. Precise and Maximal Race Detection from Incomplete Traces. SIGPLAN Not., 51(10): 462–476, Oct. 2016. Google Scholar
Digital Library
- J. Huang and L. Rauchwerger. Finding Schedule-sensitive Branches. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, ESEC/FSE 2015, pages 439–449, New York, NY, USA, 2015. ACM. Google Scholar
Digital Library
- J. Huang, P. O. Meredith, and G. Rosu. Maximal Sound Predictive Race Detection with Control Flow Abstraction. SIGPLAN Not., 49(6):337–348, June 2014. Google Scholar
Digital Library
- J. Huang, Q. Luo, and G. Rosu. GPredict: Generic Predictive Concurrency Analysis. In Proceedings of the 37th International Conference on Software Engineering - Volume 1, ICSE ’15, pages 847–857, Piscataway, NJ, USA, 2015. IEEE Press. Google Scholar
Digital Library
- B. Kasikci, C. Zamfir, and G. Candea. RaceMob: Crowdsourced Data Race Detection. In Proceedings of the Twenty-Fourth ACM Symposium on Operating Systems Principles, SOSP ’13, pages 406–422, New York, NY, USA, 2013. ACM. Google Scholar
Digital Library
- D. Kini, U. Mathur, and M. Viswanathan. Dynamic Race Prediction in Linear Time. CoRR, abs/1704.02432, 2017.Google Scholar
- A. Kinneer, M. B. Dwyer, and G. Rothermel. Sofya: Supporting Rapid Development of Dynamic Program Analyses for Java. In Companion to the Proceedings of the 29th International Conference on Software Engineering, ICSE COMPANION ’07, pages 51–52, Washington, DC, USA, 2007. IEEE Computer Society. Google Scholar
Digital Library
- L. Lamport. Time, Clocks, and the Ordering of Events in a Distributed System. Commun. ACM, 21(7):558–565, July 1978. Google Scholar
Digital Library
- P. Liu, O. Tripp, and X. Zhang. Ipa: Improving predictive analysis with pointer analysis. In Proceedings of the 25th International Symposium on Software Testing and Analysis, ISSTA 2016, pages 59–69, New York, NY, USA, 2016. ACM. Google Scholar
Digital Library
- D. Marino, M. Musuvathi, and S. Narayanasamy. LiteRace: Effective Sampling for Lightweight Data-race Detection. SIGPLAN Not., 44(6):134–143, June 2009. Google Scholar
Digital Library
- F. Mattern. Virtual Time and Global States of Distributed Systems. In Parallel and Distributed Algorithms, pages 215– 226. North-Holland, 1988.Google Scholar
- M. Musuvathi, S. Qadeer, T. Ball, G. Basler, P. A. Nainar, and I. Neamtiu. Finding and Reproducing Heisenbugs in Concurrent Programs. In Proceedings of the 8th USENIX Conference on Operating Systems Design and Implementation, OSDI’08, pages 267–280, Berkeley, CA, USA, 2008. USENIX Association. Google Scholar
Digital Library
- M. Naik, A. Aiken, and J. Whaley. Effective Static Race Detection for Java. SIGPLAN Not., 41(6):308–319, June 2006. Google Scholar
Digital Library
- R. O’Callahan and J.-D. Choi. Hybrid Dynamic Data Race Detection. SIGPLAN Not., 38(10):167–178, June 2003. Google Scholar
Digital Library
- E. Pozniansky and A. Schuster. Efficient On-the-fly Data Race Detection in Multithreaded C++ Programs. SIGPLAN Not., 38 (10):179–190, June 2003. Google Scholar
Digital Library
- P. Pratikakis, J. S. Foster, and M. Hicks. LOCKSMITH: Practical Static Race Detection for C. ACM Trans. Program. Lang. Syst., 33(1):3:1–3:55, Jan. 2011. Google Scholar
Digital Library
- C. RaGoogle Scholar
- R. Raman, J. Zhao, V. Sarkar, M. Vechev, and E. Yahav. Scalable and Precise Dynamic Datarace Detection for Structured Parallelism. SIGPLAN Not., 47(6):531–542, June 2012. Google Scholar
Digital Library
- J. Roemer and B. M. D. An Online Dynamic Analysis for Sound Predictive Data Race Detection. Technical Report OSU-CISRC-11/16-TR05, 2016.Google Scholar
- G. Rosu. RV-Predict, Runtime Verification. https:// runtimeverification.com/predict/. Accessed: 2016- 11-15.Google Scholar
- M. Said, C. Wang, Z. Yang, and K. Sakallah. Generating Data Race Witnesses by an SMT-based Analysis. In Proceedings of the Third International Conference on NASA Formal Methods, NFM’11, pages 313–327, Berlin, Heidelberg, 2011. Springer-Verlag. Google Scholar
Digital Library
- S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson. Eraser: A Dynamic Data Race Detector for Multi-threaded Programs. SIGOPS Oper. Syst. Rev., 31(5):27–37, Oct. 1997. Google Scholar
Digital Library
- K. Sen. Race Directed Random Testing of Concurrent Programs. SIGPLAN Not., 43(6):11–21, June 2008. Google Scholar
Digital Library
- K. Sen, G. Ro¸su, and G. Agha. Detecting Errors in Multithreaded Programs by Generalized Predictive Analysis of Executions. In Proceedings of the 7th IFIP WG 6.1 International Conference on Formal Methods for Open Object-Based Distributed Systems, FMOODS’05, pages 211–226, Berlin, Heidelberg, 2005. Springer-Verlag. Google Scholar
Digital Library
- T. F. ¸ Serbănu¸tă, F. Chen, and G. Ro¸su. Maximal causal models for sequentially consistent systems. In International Conference on Runtime Verification, pages 136–150. Springer, 2012.Google Scholar
- K. Serebryany and T. Iskhodzhanov. ThreadSanitizer: Data Race Detection in Practice. In Proceedings of the Workshop on Binary Instrumentation and Applications, WBIA ’09, pages 62–71, New York, NY, USA, 2009. ACM. Google Scholar
Digital Library
- Y. Smaragdakis, J. Evans, C. Sadowski, J. Yi, and C. Flanagan. Sound Predictive Race Detection in Polynomial Time. SIGPLAN Not., 47(1):387–400, Jan. 2012. Google Scholar
Digital Library
- L. A. Smith and J. M. Bull. A multithreaded java grande benchmark suite. In Proceedings of the third workshop on Java for high performance computing, 2001.Google Scholar
- R. Surendran and V. Sarkar. Dynamic determinacy race detection for task parallelism with futures. In International Conference on Runtime Verification, pages 368–385. Springer, 2016.Google Scholar
- C. von Praun and T. R. Gross. Object Race Detection. SIGPLAN Not., 36(11):70–82, Oct. 2001. Google Scholar
Digital Library
- J. W. Voung, R. Jhala, and S. Lerner. RELAY: Static Race Detection on Millions of Lines of Code. In Proceedings of the the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on The Foundations of Software Engineering, ESEC-FSE ’07, pages 205–214, New York, NY, USA, 2007. ACM. Google Scholar
Digital Library
- C. Wang, S. Kundu, M. Ganai, and A. Gupta. Symbolic predictive analysis for concurrent programs. In Proceedings of the 2Nd World Congress on Formal Methods, FM ’09, pages 256–272, Berlin, Heidelberg, 2009. Springer-Verlag. Google Scholar
Digital Library
- E. Yahav. Verifying Safety Properties of Concurrent Java Programs Using 3-valued Logic. SIGPLAN Not., 36(3):27–40, Jan. 2001. Google Scholar
Digital Library
- A. Yoga, S. Nagarakatte, and A. Gupta. Parallel Data Race Detection for Task Parallel Programs with Locks. In Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE 2016, pages 833–845, New York, NY, USA, 2016. ACM. Google Scholar
Digital Library
- Y. Yu, T. Rodeheffer, and W. Chen. RaceTrack: Efficient Detection of Data Race Conditions via Adaptive Tracking. SIGOPS Oper. Syst. Rev., 39(5):221–234, Oct. 2005. Google Scholar
Digital Library
- S. Zhan and J. Huang. ECHO: Instantaneous in Situ Race Detection in the IDE. In Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE 2016, pages 775–786, New York, NY, USA, 2016. ACM. Google Scholar
Digital Library
Index Terms
Dynamic race prediction in linear time
Recommendations
Fast, sound, and effectively complete dynamic race prediction
Writing concurrent programs is highly error-prone due to the nondeterminism in interprocess communication. The most reliable indicators of errors in concurrency are data races, which are accesses to a shared resource that can be executed concurrently. ...
What happens-after the first race? enhancing the predictive power of happens-before based dynamic race detection
Dynamic race detection is the problem of determining if an observed program execution reveals the presence of a data race in a program. The classical approach to solving this problem is to detect if there is a pair of conflicting memory accesses that ...
Dynamic race prediction in linear time
PLDI 2017: Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and ImplementationWriting reliable concurrent software remains a huge challenge for today's programmers. Programmers rarely reason about their code by explicitly considering different possible inter-leavings of its execution. We consider the problem of detecting data ...






Comments