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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
Aiken, A.: Introduction to set constraint-based program analysis. Science of Computer Programming 35, 79–111 (1999)
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)
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)
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)
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)
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)
Cardelli, L.: Typechecking dependent types and subtypes. In: Workshop on Foundations of Logic and Functional Programming, pp. 45–57 (1988)
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)
Flanagan, C., Freund, S.N.: Type-based race detection for Java. In: ACM Conference on Programming Language Design and Implementation, pp. 219–232 (2000)
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)
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)
Flanagan, C., Freund, S.N.: Type inference against races. Technical Note 04-06, Williams College (2004)
Flanagan, C., Qadeer, S.: Transactions for Software Model Checking. In: Workshop on Software Model Checking, pp. 338–349 (2003)
Flanagan, C., Qadeer, S.: A type and effect system for atomicity. In: ACM Conference on Programming Language Design and Implementation, pp. 338–349 (2003)
Flanagan, C., Qadeer, S.: Types for atomicity. In: ACM Workshop on Types in Language Design and Implementation, pp. 1–12 (2003)
Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: ACM Symposium on the Principles of Programming Languages, pp. 171–183 (1998)
Grossman, D.: Type-safe multithreading in Cyclone. In: ACM Workshop on Types in Language Design and Implementation, pp. 13–25 (2003)
Haack, C., Wells, J.B.: Type error slicing in implicitly typed higher-order languages. In: European Symposium on Programming, pp. 284–301 (2003)
Java Grande Forum. Java Grande benchmark suite (2003), Available from http://www.javagrande.org/
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)
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)
Standard Performance Evaluation Corporation. SPEC benchmarks (2003), Available from http://www.spec.org/
Stoller, S.D.: Model-Checking Multi-Threaded Distributed Java Programs. International Journal on Software Tools for Technology Transfer 4(1), 71–91 (2002)
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)
Talpin, J.-P., Jouvelot, P.: Polymorphic type, region and effect inference. Journal of Functional Programming 2(3), 245–271 (1992)
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)
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)
Wand, M.: Finding the source of type errors. In: ACM Symposium on the Principles of Programming Languages, pp. 38–43 (1986)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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