Skip to main content

Type Inference Against Races

  • Conference paper
Static Analysis (SAS 2004)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3148))

Included in the following conference series:

Abstract

The race condition checker rccjava uses a formal type system to statically identify potential race conditions in concurrent Java programs, but it requires programmer-supplied type annotations. This paper describes a type inference algorithm for rccjava. Due to the interaction of parameterized classes and dependent types, this type inference problem is NP-complete. This complexity result motivates our new approach to type inference, which is via reduction to propositional satisfiability. This paper describes our type inference algorithm and its performance on programs of up to 30,000 lines of code.

This work was supported in part by the National Science Foundation under Grants CCR-0341179 and CCR-0341387.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Agarwal, R., Stoller, S.D.: Type inference for parameterized race-free Java. In: Conference on Verification, Model Checking, and Abstract Interpretation, pp. 149–160 (2004)

    Google Scholar 

  2. Aiken, A.: Introduction to set constraint-based program analysis. Science of Computer Programming 35, 79–111 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  3. Aldrich, J., Kostadinov, V., Chambers, C.: Alias annotations for program understanding. In: ACM Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 311–330 (2002)

    Google Scholar 

  4. Aloul, F.A., Ramani, A., Markov, I.L., Sakallah, K.A.: PBS: A backtracksearch pseudo-boolean solver and optimizer. In: Symposium on the Theory and Applications of Satisfiability Testing, pp. 346–353 (2002)

    Google Scholar 

  5. Bacon, D.F., Sweeney, P.F.: Fast static analysis of C++ virtual function calls. In: ACM Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 324–341 (1996)

    Google Scholar 

  6. Bogda, J., Hölzle, U.: Removing unnecessary synchronization in Java. In: ACM Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 35–46 (1999)

    Google Scholar 

  7. Boyapati, C., Rinard, M.: A parameterized type system for race-free Java programs. In: ACM Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 56–69 (2001)

    Google Scholar 

  8. Cardelli, L.: Typechecking dependent types and subtypes. In: Workshop on Foundations of Logic and Functional Programming, pp. 45–57 (1988)

    Google Scholar 

  9. Dwyer, M.B., Hatcliff, J., Prasad, V.R., Robby: Exploiting Object Escape and Locking Information in Partial Order Reduction for Concurrent Object-Oriented Programs. In: Formal Methods in System Design (2003)

    Google Scholar 

  10. Flanagan, C., Freund, S.N.: Type-based race detection for Java. In: ACM Conference on Programming Language Design and Implementation, pp. 219–232 (2000)

    Google Scholar 

  11. Flanagan, C., Freund, S.N.: Detecting Race Conditions in Large Programs. In: Workshop on Program Analysis for Software Tools and Engineering, pp. 90–96 (2001)

    Google Scholar 

  12. Flanagan, C., Freund, S.N.: Atomizer: A dynamic atomicity checker for multithreaded programs. In: ACM Symposium on the Principles of Programming Languages, pp. 256–267 (2004)

    Google Scholar 

  13. Flanagan, C., Freund, S.N.: Type inference against races. Technical Note 04-06, Williams College (2004)

    Google Scholar 

  14. Flanagan, C., Qadeer, S.: Transactions for Software Model Checking. In: Workshop on Software Model Checking, pp. 338–349 (2003)

    Google Scholar 

  15. Flanagan, C., Qadeer, S.: A type and effect system for atomicity. In: ACM Conference on Programming Language Design and Implementation, pp. 338–349 (2003)

    Google Scholar 

  16. Flanagan, C., Qadeer, S.: Types for atomicity. In: ACM Workshop on Types in Language Design and Implementation, pp. 1–12 (2003)

    Google Scholar 

  17. Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: ACM Symposium on the Principles of Programming Languages, pp. 171–183 (1998)

    Google Scholar 

  18. Grossman, D.: Type-safe multithreading in Cyclone. In: ACM Workshop on Types in Language Design and Implementation, pp. 13–25 (2003)

    Google Scholar 

  19. Haack, C., Wells, J.B.: Type error slicing in implicitly typed higher-order languages. In: European Symposium on Programming, pp. 284–301 (2003)

    Google Scholar 

  20. Java Grande Forum. Java Grande benchmark suite (2003), Available from http://www.javagrande.org/

  21. Moskewicz, M.W., Madigan, C.F., Zhao, Y., Zhang, L., Malik, S.: Chaff: Engineering an efficient SAT solver. In: Design Automation Conference, pp. 530–535 (2001)

    Google Scholar 

  22. Savage, S., Burrows, M., Nelson, G., Sobalvarro, P., Anderson, T.E.: Eraser: A dynamic data race detector for multi-threaded programs. ACM Transactions on Computer Systems 15(4), 391–411 (1997)

    Article  Google Scholar 

  23. Standard Performance Evaluation Corporation. SPEC benchmarks (2003), Available from http://www.spec.org/

  24. Stoller, S.D.: Model-Checking Multi-Threaded Distributed Java Programs. International Journal on Software Tools for Technology Transfer 4(1), 71–91 (2002)

    Article  Google Scholar 

  25. Stoller, S.D., Cohen, E.: Optimistic Synchronization-Based State-Space Reduction. In: International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pp. 489–504 (2003)

    Google Scholar 

  26. Talpin, J.-P., Jouvelot, P.: Polymorphic type, region and effect inference. Journal of Functional Programming 2(3), 245–271 (1992)

    Article  MATH  MathSciNet  Google Scholar 

  27. Tofte, M., Talpin, J.-P.: Implementation of the typed call-by-value lambdacalculus using a stack of regions. In: ACM Symposium on the Principles of Programming Languages, pp. 188–201 (1994)

    Google Scholar 

  28. von Praun, C., Gross, T.: Static conflict analysis for multi-threaded objectoriented programs. In: ACM Conference on Programming Language Design and Implementation, pp. 115–128 (2003)

    Google Scholar 

  29. Wand, M.: Finding the source of type errors. In: ACM Symposium on the Principles of Programming Languages, pp. 38–43 (1986)

    Google Scholar 

  30. Yang, J., Michaelson, G., Trinder, P., Wells, J.B.: Improved type error reporting. In: International Workshop on Implementation of Functional Languages, pp. 71–86 (2000)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Flanagan, C., Freund, S.N. (2004). Type Inference Against Races. In: Giacobazzi, R. (eds) Static Analysis. SAS 2004. Lecture Notes in Computer Science, vol 3148. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-27864-1_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-27864-1_11

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-22791-5

  • Online ISBN: 978-3-540-27864-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics