skip to main content
article
Public Access

Dynamic race prediction in linear time

Published:14 June 2017Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

References

  1. https://publish.illinois.edu/race-prediction/.Google ScholarGoogle Scholar
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. T. Elmas, S. Qadeer, and S. Tasiran. Goldilocks: A Race and Transaction-aware Java Runtime. SIGPLAN Not., 42(6):245– 255, June 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. C. Flanagan and S. N. Freund. Type-based Race Detection for Java. SIGPLAN Not., 35(5):219–232, May 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. C. Flanagan and S. N. Freund. FastTrack: Efficient and Precise Dynamic Race Detection. SIGPLAN Not., 44(6):121–133, June 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. J. Huang and A. K. Rajagopalan. Precise and Maximal Race Detection from Incomplete Traces. SIGPLAN Not., 51(10): 462–476, Oct. 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. D. Kini, U. Mathur, and M. Viswanathan. Dynamic Race Prediction in Linear Time. CoRR, abs/1704.02432, 2017.Google ScholarGoogle Scholar
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. L. Lamport. Time, Clocks, and the Ordering of Events in a Distributed System. Commun. ACM, 21(7):558–565, July 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. D. Marino, M. Musuvathi, and S. Narayanasamy. LiteRace: Effective Sampling for Lightweight Data-race Detection. SIGPLAN Not., 44(6):134–143, June 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. F. Mattern. Virtual Time and Global States of Distributed Systems. In Parallel and Distributed Algorithms, pages 215– 226. North-Holland, 1988.Google ScholarGoogle Scholar
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. Naik, A. Aiken, and J. Whaley. Effective Static Race Detection for Java. SIGPLAN Not., 41(6):308–319, June 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. R. O’Callahan and J.-D. Choi. Hybrid Dynamic Data Race Detection. SIGPLAN Not., 38(10):167–178, June 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  31. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  32. C. RaGoogle ScholarGoogle Scholar
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. 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 ScholarGoogle Scholar
  35. G. Rosu. RV-Predict, Runtime Verification. https:// runtimeverification.com/predict/. Accessed: 2016- 11-15.Google ScholarGoogle Scholar
  36. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  37. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  38. K. Sen. Race Directed Random Testing of Concurrent Programs. SIGPLAN Not., 43(6):11–21, June 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  40. 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 ScholarGoogle Scholar
  41. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  42. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  43. 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 ScholarGoogle Scholar
  44. 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 ScholarGoogle Scholar
  45. C. von Praun and T. R. Gross. Object Race Detection. SIGPLAN Not., 36(11):70–82, Oct. 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  47. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  48. E. Yahav. Verifying Safety Properties of Concurrent Java Programs Using 3-valued Logic. SIGPLAN Not., 36(3):27–40, Jan. 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  50. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  51. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Dynamic race prediction in linear 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

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 52, Issue 6
        PLDI '17
        June 2017
        708 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/3140587
        Issue’s Table of Contents
        • cover image ACM Conferences
          PLDI 2017: Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation
          June 2017
          708 pages
          ISBN:9781450349888
          DOI:10.1145/3062341

        Copyright © 2017 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 14 June 2017

        Check for updates

        Qualifiers

        • article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!