skip to main content
article
Free Access

Effective static race detection for Java

Published:11 June 2006Publication History
Skip Abstract Section

Abstract

We present a novel technique for static race detection in Java programs, comprised of a series of stages that employ a combination of static analyses to successively reduce the pairs of memory accesses potentially involved in a race. We have implemented our technique and applied it to a suite of multi-threaded Java programs. Our experiments show that it is precise, scalable, and useful, reporting tens to hundreds of serious and previously unknown concurrency bugs in large, widely-used programs with few false alarms.

References

  1. S. Adve, M. Hill, B. Miller, and R. Netzer. Detecting data races on weak memory systems. In Proceedings of the 18th Annual International Symposium on Computer Architecture (ISCA'91), pages 234--243, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. Agarwal, A. Sasturkar, Wang L, and S. Stoller. Optimized run-time race detection and atomicity checking using partial discovered types. In Proceedings of the 20th IEEE/ACM International Conference on Automated Software Engineering (ASE'05), pages 233--242, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. Agarwal and S. Stoller. Type inference for parameterized race-free Java. In Proceedings of the 5th International Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI'04), pages 149--160, 2004.]]Google ScholarGoogle ScholarCross RefCross Ref
  4. A. Aiken and D. Gay. Barrier inference. In Proceedings of the 25th ACMSIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'98), pages 342--354, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. Bacon, R. Strom, and A. Tarafdar. Guava: A dialect of Java without data races. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'00), pages 382--400, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Berndl, O. Lhoták, F. Qian, L. Hendren, and N. Umanee. Points-to analysis using BDDs. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'03), pages 103--114, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. C. Boyapati, R. Lee, and M. Rinard. Ownership types for safe programming: Preventing data races and deadlocks. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'02), pages 211--230, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. C. Boyapati and M. Rinard. A parameterized type system for race-free Java programs. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'01), pages 56--69, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. R. Bryant. Graph-based algorithms for boolean function manipulation. IEEE Transactions on Computers, 35(8):677--691, 1986.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. G. Cheng, M. Feng, C. Leiserson, K. Randall, and A. Stark. Detecting data races in Cilk programs that use locks. In Proceedings of the 10th Annual ACM Symposium on Parallel Algorithms and Architectures (SPAA'98), pages 298--309, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. J. Choi, K. Lee, A. Loginov, R. O'Callahan, V. Sarkar, and M. Sridharan. Efficient and precise datarace detection for multithreaded object-oriented programs. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'02), pages 258--269, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J. Choi, A. Loginov, and V. Sarkar. Static datarace analysis for multithreaded object-oriented programs. Technical Report RC22146, IBM Research, 2001.]]Google ScholarGoogle Scholar
  13. J. Choi, B. Miller, and R. Netzer. Techniques for debugging parallel programs with flowback analysis. ACM Transactions on Programming Languages and Systems, 13(4):491--530, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Christiaens and K. Brosschere. TRaDe: A topological approach to on-the-fly race detection in Java programs. In Proceedings of the 1st Java Virtual Machine Research and Technology Symposium (JVM'01), pages 105--116, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. A. Dinning and E. Schonberg. An empirical comparison of monitoring algorithms for access anomaly detection. In Proceedings of the ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP'90), pages 1--10, 1990.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. A. Dinning and E. Schonberg. Detecting access anomalies in programs with critical sections. In Proceedings of the 1991 ACM/ONR Workshop on Parallel and Distributed Debugging (PADD'91), pages 85--96, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. Engler and K. Ashcraft. RacerX: Effective, static detection of race conditions and deadlocks. In Proceedings of the 19th ACM Symposium on Operating Systems Principles (SOSP'03), pages 237--252, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. C. Flanagan. Verifying commit-atomicity using modelchecking. In Proceedings of the 11th International SPIN Workshop on Model Checking Software (SPIN'04), pages 252--266, 2004.]]Google ScholarGoogle Scholar
  19. C. Flanagan and M. Abadi. Types for safe locking. In Proceedings of the 8th European Symposium on Programming (ESOP'99), pages 91--108, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. C. Flanagan and S. Freund. Type-based race detection for Java. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'00), pages 219--232, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. C. Flanagan and S. Freund. Detecting race conditions in large programs. In Proceedings of the ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering (PASTE'01), pages 90--96, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. C. Flanagan and S. Freund. Atomizer: a dynamic atomicity checker for multithreaded programs. In Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'04), pages 256--267, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. C. Flanagan and S. Freund. Type inference against races. In Proceedings of the 11th International Static Analysis Symposium (SAS'04), pages 116--132, 2004.]]Google ScholarGoogle ScholarCross RefCross Ref
  24. C. Flanagan, S. Freund, and M. Lifshin. Type inference for atomicity. In Proceedings of the ACM SIGPLAN Workshop on Types in Language Design and Implementation (TLDI'05), pages 47--58, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. C. Flanagan and S. Qadeer. A type and effect system for atomicity. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'03), pages 338--349, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. C. Flanagan and S. Qadeer. Types for atomicity. In Proceedings of the ACM SIGPLAN Workshop on Types in Language Design and Implementation (TLDI'03), pages 1--12, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. D. Gay, P. Levis, R. von Behren, M. Welsh, E. Brewer, and D. Culler. The nesC language: A holistic approach to networked embedded systems. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'03), pages 1--11, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Harrow. Runtime checking of multithreaded applications with visual threads. In Proceedings of the 7th International SPIN Workshop on Model Checking Software (SPIN'00), pages 331--342, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. T. Henzinger, R. Jhala, and R. Majumdar. Race checking by context inference. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'04), pages 1--13, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. M. Lam, J. Whaley, B. Livshits, M. Martin, D. Avots, M. Carbin, and C. Unkel. Context-sensitive program analysis as database queries. In Proceedings of the 24th ACMSIGACTSIGMOD-SIGART Symposium on Principles of Database Systems (PODS'05), pages 1--12, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. L. Lamport. Time, clocks, and the ordering of events in a distributed system. Communications of the ACM, 21(7):558--565, 1978.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. O. Lhoták and L. Hendren. Jedd: a BDD-based relational extension of Java. In Proceedings of the ACMSIGPLAN Conference on Programming Language Design and Implementation (PLDI'04), pages 158--169, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. R. Lipton. Reduction: A method of proving properties of parallel programs. Communications of the ACM, 18(12):717--721, 1975.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. J. Manson, W. Pugh, and S. Adve. The Java memory model. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'05), pages 378--391, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. J. Mellor-Crummey. On-the-fly detection of data races for programs with nested fork-join parallelism. In Proceedings of the 4th Annual Conference on Supercomputing (SC'91), pages 24--35, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. A. Milanova, A. Rountev, and B. Ryder. Parameterized object sensitivity for points-to and side-effect analyses for Java. In Proceedings of the International Symposium on Software Testing and Analysis (ISSTA'02), pages 1--11, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. A. Milanova, A. Rountev, and B. Ryder. Parameterized object sensitivity for points-to analysis for Java. ACM Transactions on Software Engineering Methodology, 14(1):1--41, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. H. Nishiyama. Detecting data races using dynamic escape analysis based on read barrier. In Proceedings of the 3rd Virtual Machine Research and Technology Symposium (VM'04), pages 127--138, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. R. O'Callahan and J. Choi. Hybrid dynamic data race detection. In Proceedings of the ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP'03), pages 167--178, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. E. Pozniansky and A. Schuster. Efficient on-the-fly data race detection in multithreaded C++ programs. In Proceedings of the ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP'03), pages 179--190, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. P. Pratikakis, J. Foster, and M. Hicks. LOCKSMITH: Contextsensitive correlation analysis for race detection. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'06), 2006.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. S. Qadeer and D.Wu. KISS: Keep it simple and sequential. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'04), pages 14--24, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. M. Ronsse and K. Bosschere. RecPlay: A fully integrated practical record/replay system. ACM Transactions on Computer Systems, 17(2):133--152, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. A. Sasturkar, R. Agarwal, L. Wang, and S. Stoller. Automated type-based analysis of data races and atomicity. In Proceedings of the ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP'05), pages 83--94, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson. Eraser: A dynamic data race detector for multithreaded programs. In Proceedings of the 16th ACM Symposium on Operating System Principles (SOSP'97), pages 27--37, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. E. Schonberg. On-the-fly detection of access anomalies. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'89), pages 285--297, 1989.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. N. Sterling. WARLOCK - a static data race analysis tool. In Proceedings of the Usenix Winter 1993 Technical Conference, pages 97--106, 1993.]]Google ScholarGoogle Scholar
  48. R. Vallée-Rai, P. Co, E. Gagnon, L. Hendren, P. Lam, and V. Sundaresan. Soot - a Java optimization framework. In Proceedings of the 1999 Conference of the Centre for Advanced Studies on Collaborative Research (CASCON'99), pages 125--135, 1999.]]Google ScholarGoogle Scholar
  49. C. von Praun and T. Gross. Object race detection. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'01), pages 70--82, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. C. von Praun and T. Gross. Static conflict analysis for multithreaded object-oriented programs. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'03), pages 115--128, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. L. Wang and S. Stoller. Static analysis of atomicity for programs with non-blocking synchronization. In Proceedings of the ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP'05), pages 61--71, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. L. Wang and S. Stoller. Runtime analysis of atomicity for multi-threaded programs. IEEE Transactions on Software Engineering, 32(2):93--110, 2006.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. J. Whaley and M. Lam. Cloning-based context-sensitive pointer alias analysis using binary decision diagrams. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'04), pages 131--144, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Y. Yu, T. Rodeheffer, and W. Chen. RaceTrack: Efficient detection of data race conditions via adaptive tracking. In Proceedings of the 20th ACM Symposium on Operating Systems Principles (SOSP'05), pages 221--234, 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. J. Zhu and S. Calman. Symbolic pointer analysis revisited. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'04), pages 145--157, 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Effective static race detection for Java

        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 41, Issue 6
          Proceedings of the 2006 PLDI Conference
          June 2006
          426 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/1133255
          Issue’s Table of Contents
          • cover image ACM Conferences
            PLDI '06: Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation
            June 2006
            438 pages
            ISBN:1595933204
            DOI:10.1145/1133981

          Copyright © 2006 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: 11 June 2006

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader