skip to main content
10.1145/1254766.1254768acmconferencesArticle/Chapter ViewAbstractPublication PagescpsweekConference Proceedingsconference-collections
Article

A type system for preventing data races and deadlocks in the java virtual machine language: 1

Published:13 June 2007Publication History

ABSTRACT

In previous work on SafeJava we presented a type system extension to the Java source language that statically prevents data races and deadlocks in multithreaded programs. SafeJava is expressive enough to support common programming patterns, its type checking is fast and scalable, and it requires little programming overhead. SafeJava thus offers a promising approach for making multithreaded programs more reliable. This paper presents a corresponding type system extension for the Java virtual machine language (JVML). We call the resulting language SafeJVML. Well-typed SafeJVML programs are guaranteed to be free of data races and deadlocks. Designing a corresponding type system for JVML is important because most Java code is shipped in the JVML format. Designing acorresponding type system for JVML is nontrivial because of important differences between Java and JVML. In particular, the absence of block structure in JVML programs and the fact that they do not use named local variables the way Java programs do make the type systems for Java and JVML significantly different. For example, verifying absence of races and deadlocks in JVML programs requires performing an alias analysis, something that was not necessary for verifying absence of races and deadlocks in Java programs. This paper presents static and dynamic semantics for Safe JVML. It also includes a proof that the SafeJVML type system is sound and that it prevents data races and deadlocks. To the best of our knowledge, this is the first type system for JVML that statically ensures absence of synchronization errors.

References

  1. Jonathan Aldrich, Valentin Kostadinov, and Craig Chambers. Alias annotations for program understanding. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), November 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. David F. Bacon, Robert E. Strom, and Ashis Tarafdar. Guava: A dialect of Java without data races. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), October 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Anindya Banerjee and David A. Naumann. Representation independence, confinement, and access control. In Principles of Programming Languages (POPL), January 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Peter Bertelsen. Dynamic semantics of Java bytecode. In Workshop on Principles of Abstract Machines, 1998.Google ScholarGoogle Scholar
  5. Chandrasekhar Boyapati. SafeJava: A unified type system for safe programming. Ph.D. thesis, Massachusetts Institute of Technology, February 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Chandrasekhar Boyapati, Robert Lee, and Martin Rinard. Ownership types for safe programming: Preventing data races and deadlocks. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), November 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Chandrasekhar Boyapati, Barbara Liskov, and Liuba Shrira. Ownership types for object encapsulation. In Principles of Programming Languages (POPL), January 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Chandrasekhar Boyapati, Barbara Liskov, Liuba Shrira, Chuang-Hue Moh, and Steven Richman. Lazy modular upgrades in persistent object stores. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), October 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Chandrasekhar Boyapati and Martin Rinard. A parameterized type system for race-free Java programs. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), October 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Chandrasekhar Boyapati, Alexandru Salcianu, William Beebee, Jr., and Martin Rinard. Ownership types for safe region-based memory management in Real-Time Java. In Programming Language Design and Implementation (PLDI), June 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Robert O'Callahan. A simple, comprehensive type system for Java bytecode subroutines. In Principles of Programming Languages (POPL), 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. David G. Clarke and Sophia Drossopoulou. Ownership, encapsulation and disjointness of type and effect. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), November 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. David G. Clarke, John M. Potter, and James Noble. Ownership types for flexible alias protection. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), October 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Cormac Flanagan and Martin Abadi. Object types against races. In Conference on Concurrent Theory (CONCUR), August 1999.Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Cormac Flanagan and Martin Abadi. Types for safe locking. In European Symposium on Programming (ESOP), March 1999.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Cormac Flanagan and Stephen N. Freund. Type-based race detection for Java. In Programming Language Design and Implementation (PLDI), June 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Matthew Flatt, Shriram Krishnamurthi, and Matthias Felleisen. Classes and mixins. In Principles of Programming Languages (POPL), January 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Stephen N. Freund. Type systems for object-oriented intermediate languages. Ph.D. thesis, Stanford University, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Stephen N. Freund and John C. Mitchell. A type system for object initialization in the Java bytecode language. In ACM Transactions on Programming Languages and Systems, November 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Stephen N. Freund and John C. Mitchell. A formal framework for Java bytecode language and verifier. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), October 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. James Gosling, Bill Joy, and Guy Steele. The Java Language Specification. Addison-Wesley, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Dan Grossman. Type-safe multithreading in Cyclone. In Workshop on Types in Language Design and Implementation (TLDI), January 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Futoshi Iwama and Naoki Kobayashi. A new type system for JVM lock primitives. In ASIAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation(ASIA-PEPM), May 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Gerwin Klein and Martin Wildmoser. Verified bytecode subroutines. Journal of Automated Reasoning, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Neel Krishnaswamy and Jonathan Aldrich. Permission based ownership: Encapsulating state in higher order typed languages. In Programming Language Design and Implementation (PLDI), June 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Cosimo Laneve and Gaetano Bigliardi. A type system for JVM threads. In The Third ACM SIGPLAN Workshop on Types in Compilation (TIC), September 2000.Google ScholarGoogle Scholar
  27. Tim Lindholm and Frank Yellin. The Java Virtual Machine Specification. Addison-Wesley, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. William Pugh. Fixing the Java memory model. In ACM Java Grande Conference, June 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Zhenyu Qian. A formal specification of Java virtual machine instructions for objects, methods and subrountines. In Formal Syntax and Semantics of Java, pages 271--312, 1999.Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Raymie Stata and Martin Abadi. A type system for Java bytecode subroutines. In Principles of Programming Languages (POPL), January 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A type system for preventing data races and deadlocks in the java virtual machine language: 1

        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
        • Published in

          cover image ACM Conferences
          LCTES '07: Proceedings of the 2007 ACM SIGPLAN/SIGBED conference on Languages, compilers, and tools for embedded systems
          June 2007
          258 pages
          ISBN:9781595936325
          DOI:10.1145/1254766
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 42, Issue 7
            Proceedings of the 2007 LCTES conference
            July 2007
            241 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/1273444
            Issue’s Table of Contents

          Copyright © 2007 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 13 June 2007

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • Article

          Acceptance Rates

          Overall Acceptance Rate116of438submissions,26%

        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!