skip to main content
10.1145/1449764.1449783acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Verifying correct usage of atomic blocks and typestate

Published:19 October 2008Publication History

ABSTRACT

The atomic block, a synchronization primitive provided to programmers in transactional memory systems, has the potential to greatly ease the development of concurrent software. However, atomic blocks can still be used incorrectly, and race conditions can still occur at the level of application logic. In this paper, we present a intraprocedural static analysis, formalized as a type system and proven sound, that helps programmers use atomic blocks correctly. Using access permissions, which describe how objects are aliased and modified, our system statically prevents race conditions and enforces typestate properties in concurrent programs. We have implemented a prototype static analysis for the Java language based on our system and have used it to verify several realistic examples.

References

  1. Ali-Reza Adl-Tabatabai, Brian T. Lewis, Vijay Menon, Brian R. Murphy, Bratin Saha, and Tatiana Shpeisman. Compiler and runtime support for efficient software transactional memory. In PLDI '06: Proceedings of the 2006 ACM SIGPLAN conference on Programming language design and implementation, pages 26--37. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Cyrille Artho, Klaus Havelund, and Armin Biere. High level data races. In VVEIS '03: Proceedings of the Workshop on Verification and Validation of Enterprise Information Systems, pages 82--93, April 2003.Google ScholarGoogle ScholarCross RefCross Ref
  3. Mike Barnett, Robert DeLine, Manuel Fähndrich, K. Rustan M. Leino, and Wolfram Schulte. Verification of object-oriented programs with invariants. Journal of Object Technology Special Issue: ECOOP 2003 workshop on Formal Techniques for Javalike Programs, 3(6):27--56, June 2004.Google ScholarGoogle ScholarCross RefCross Ref
  4. Nels E. Beckman and Jonathan Aldrich. Verifying correct usage of atomic blocks and typestate: Technical companion. Technical Report CMU-ISR-08-126, Carnegie Mellon University, 2008. http://reports-archive.adm.cs.cmu.edu/anon/isr2008/CMU-ISR-08-126.pdf.Google ScholarGoogle Scholar
  5. Kevin Bierhoff and Jonathan Aldrich. Modular typestate checking of aliased objects. In OOPSLA '07: Proceedings of the 22nd annual ACM SIGPLAN conference on Object oriented programming systems and applications, pages 301--320. ACM Press, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Kevin Bierhoff and Jonathan Aldrich. Plural: Checking protocol compliance under aliasing. In Companion Proceedings of ICSE-30, pages 971--972. ACM Press, May 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Chandrasekhar Boyapati, Robert Lee, and Martin Rinard. Ownership types for safe programming: preventing data races and deadlocks. In OOPSLA '02: Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 211--230. ACM Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. John Boyland. Checking interference with fractional permissions. In R. Cousot, editor, Static Analysis: 10th International Symposium, volume 2694 of Lecture Notes in Computer Science, pages 55--72, Berlin, Heidelberg, New York, 2003. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Robert DeLine and Manuel Fähndrich. Typestates for objects. In ECOOP '04: European Conference on Object-Oriented Programming, pages 465--490. Springer, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  10. Dawson Engler and Ken Ashcraft. RacerX: effective, static detection of race conditions and deadlocks. In SOSP '03: Proceedings of the nineteenth ACM symposium on Operating systems principles, pages 237--252. ACM Press, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Cormac Flanagan and Shaz Qadeer. A type and effect system for atomicity. In PLDI '03: Proceedings of the ACMSIGPLAN 2003 conference on Programming language design and implementation, pages 338--349. ACM Press, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Stephen Freund and Shaz Qadeer. Checking concise specifications for multithreaded software. In Workshop on Formal Techniques for Java-like Programs, 2003.Google ScholarGoogle Scholar
  13. Jean-Yves Girard. Linear logic. Theor. Comput. Sci., 50(1):1--102, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Aaron Greenhouse and William L. Scherlis. Assuring and evolving concurrent programs: annotations and policy. In ICSE '02: Proceedings of the 24th International Conference on Software Engineering, pages 453--463. ACM Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Dan Grossman. Type-safe multithreading in cyclone. In TLDI '03: Proceedings of the 2003 ACMSIGPLAN international workshop on Types in languages design and implementation, pages 13--25. ACM Press, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Dan Grossman. The transactional memory / garbage collection analogy. In OOPSLA '07: Proceedings of the 22nd annual ACM SIGPLAN conference on Object oriented programming systems and applications, pages 695--706. ACM Press, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Tim Harris and Simon Peyton Jones. Transactional memory with data invariants. In TRANSACT '06: First ACM SIGPLAN Workshop on Languages, Compilers, and Hardware Support for Transactional Computing, 2006.Google ScholarGoogle Scholar
  18. Thomas A. Henzinger, Ranjit Jhala, and Rupak Majumdar. Race checking by context inference. In PLDI '04: Proceedings of the ACM SIGPLAN 2004 conference on Programming language design and implementation, pages 1--13. ACM Press, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Michael Hicks, Jeffrey S. Foster, and Polyvios Pratikakis. Lock inference for atomic sections. In TRANSACT '06: First ACM SIGPLAN Workshop on Languages, Compilers, and Hardware Support for Transactional Computing, 2006.Google ScholarGoogle Scholar
  20. Benjamin Hindman and Dan Grossman. Atomicity via source-tosource translation. In MSPC '06: Proceedings of the 2006 workshop on Memory system performance and correctness, pages 82--91. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Bart Jacobs, Frank Piessens, K. Rustan M. Leino, and Wolfram Schulte. Safe concurrency for aggregate objects with invariants. In SEFM '05: Proceedings of the Third IEEE International Conference on Software Engineering and Formal Methods, pages 137--147, Washington, DC, USA, 2005. IEEE Computer Society. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Cliff B. Jones. Specification and design of (parallel) programs. In Proceedings of IFIP'83, pages 321--332. North-Holland, 1983.Google ScholarGoogle Scholar
  23. Patrick Lincoln and Andre Scedrov. First-order linear logic without modalities is NEXPTIME-hard. Theor. Comput. Sci., 135(1): 139--153, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Richard J. Lipton. Reduction: a method of proving properties of parallel programs. Commun. ACM, 18(12):717--721, 1975. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Katherine F. Moore and Dan Grossman. High-level small-step operational semantics for transactions. In POPL '08: Proceedings of the 35th annual ACMSIGPLAN-SIGACT symposium on Principles of programming languages, pages 51--62. ACM Press, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Peter W. O'Hearn. Resources, concurrency, and local reasoning. Theor. Comput. Sci., 375(1-3):271--307, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Susan Owicki and David Gries. Verifying properties of parallel programs: an axiomatic approach. Commun. ACM, 19(5):279--285, 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Polyvios Pratikakis, Jeffrey S. Foster, and Michael Hicks. Locksmith: context-sensitive correlation analysis for race detection. In PLDI '06: Proceedings of the 2006 ACM SIGPLAN conference on Programming language design and implementation, pages 320--331. ACM Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Edwin Rodriguez, Matthew B. Dwyer, Cormac Flanagan, John Hatcliff, Gary T. Leavens, and Robby. Extending JML for modular specification and verification of multi-threaded programs. In ECOOP '05: Object-Oriented Programming 19th European Conference, pages 551--576, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Amit Sasturkar, Rahul Agarwal, Liqiang Wang, and Scott D. Stoller. Automated type-based analysis of data races and atomicity. In PPoPP '05: Proceedings of the tenth ACM SIGPLAN symposium on Principles and practice of parallel programming, pages 83--94. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Stefan Savage, Michael Burrows, Greg Nelson, Patrick Sobalvarro, and Thomas Anderson. Eraser: a dynamic data race detector for multithreaded programs. ACM Trans. Comput. Syst., 15(4): 391--411, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Stefan Savage, Michael Burrows, Greg Nelson, Patrick Sobalvarro, and Thomas Anderson. Eraser: a dynamic data race detector for multithreaded programs. ACM Trans. Comput. Syst., 15(4): 391--411, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Robert E. Strom and Shaula Yemini. Typestate: A programming language concept for enhancing software reliability. IEEE Trans. Softw. Eng., 12(1):157--171, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Mandana Vaziri, Frank Tip, and Julian Dolby. Associating synchronization constraints with data in an object-oriented language. In POPL '06: Conference record of the 33rd ACM SIGPLANSIGACT symposium on Principles of programming languages, pages 334--345. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Philip Wadler. Linear types can change the world! In M. Broy and C. Jones, editors, IFIP TC 2 Working Conference on Programming Concepts and Methods, Sea of Galilee, Israel, pages 347--359. North Holland, 1990.Google ScholarGoogle Scholar
  36. Yuan Yu, Tom Rodeheffer, and Wei Chen. Racetrack: efficient detection of data race conditions via adaptive tracking. In SOSP'05: Proceedings of the twentieth ACMsymposium on Operating systems principles, pages 221--234. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Yang Zhao. Checking Interference with Fractional Permissions. PhD thesis, University of Wisconsin-Milwaukee, August 2007.Google ScholarGoogle Scholar

Index Terms

  1. Verifying correct usage of atomic blocks and typestate

          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
            OOPSLA '08: Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications
            October 2008
            654 pages
            ISBN:9781605582153
            DOI:10.1145/1449764
            • cover image ACM SIGPLAN Notices
              ACM SIGPLAN Notices  Volume 43, Issue 10
              September 2008
              613 pages
              ISSN:0362-1340
              EISSN:1558-1160
              DOI:10.1145/1449955
              Issue’s Table of Contents

            Copyright © 2008 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: 19 October 2008

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article

            Acceptance Rates

            Overall Acceptance Rate268of1,244submissions,22%

            Upcoming Conference

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader