Automated type-based analysis of data races and atomicity

Concurrent programs are notorious for containing errors that are difficult to reproduce and diagnose at run-time. This motivated the development of type systems that statically ensure the absence of some common kinds of concurrent programming errors including data races and atomicity violations. A method is atomic if every execution of the concurrent program is equivalent to an execution in which the atomic method is executed without being interleaved with other concurrently executed methods. Atomicity is a common correctness requirement in concurrent programs; atomicity violations may indicate incorrect synchronization. This paper presents Extended Parameterized Atomic Java (EPAJ), a type system for specifying and verifying atomicity in Java programs. EPAJ combines Flanagan and Qadeer's atomicity types [11] with a new and significantly more expressive type system for analyzing data races, called Extended Parameterized Race-Free Java (EPRFJ), allowing a more accurate analysis of atomicity. The paper also presents a type discovery algorithm to automatically obtain EPRFJ types, and a static interprocedural type inference algorithm that, given EPRFJ types, infers atomicity types. These algorithms can be incorporated into testing and debugging tools, benefiting users who know nothing about type systems. We report our experience with a prototype implementation.

[1]  Stephen N. Freund,et al.  Type inference for atomicity , 2005, TLDI '05.

[2]  Stephen N. Freund,et al.  Type-based race detection for Java , 2000, PLDI '00.

[3]  Cormac Flanagan,et al.  A type and effect system for atomicity , 2003, PLDI.

[4]  Alan Bundy,et al.  Constructing Induction Rules for Deductive Synthesis Proofs , 2006, CLASE.

[5]  Stephen N. Freund,et al.  Atomizer: a dynamic atomicity checker for multithreaded programs , 2004, 18th International Parallel and Distributed Processing Symposium, 2004. Proceedings..

[6]  A. Tarski A LATTICE-THEORETICAL FIXPOINT THEOREM AND ITS APPLICATIONS , 1955 .

[7]  Jong-Deok Choi,et al.  Efficient and precise datarace detection for multithreaded object-oriented programs , 2002, PLDI '02.

[8]  Martin C. Rinard,et al.  A parameterized type system for race-free Java programs , 2001, OOPSLA '01.

[9]  Martín Abadi,et al.  Types for safe locking: Static race detection for Java , 2006, TOPL.

[10]  Eitan Farchi,et al.  Framework for testing multi‐threaded Java programs , 2003, Concurr. Comput. Pract. Exp..

[11]  Scott D. Stoller,et al.  Runtime analysis for atomicity for multi-threaded programs , 2005 .

[12]  Thomas R. Gross,et al.  Object race detection , 2001, OOPSLA '01.

[13]  Scott D. Stoller,et al.  Run-Time Analysis for Atomicity , 2003, Electron. Notes Theor. Comput. Sci..

[14]  Rahul Agarwal,et al.  Type Discovery for Parameterized Race-Free Java , 2004 .

[15]  Stephen N. Freund,et al.  Type inference against races , 2004, Sci. Comput. Program..

[16]  Michael Burrows,et al.  Eraser: a dynamic data race detector for multi-threaded programs , 1997, TOCS.

[17]  Aaron Greenhouse,et al.  Assuring and evolving concurrent programs: annotations and policy , 2002, Proceedings of the 24th International Conference on Software Engineering. ICSE 2002.

[18]  Rahul Agarwal,et al.  Type Inference for Parameterized Race-Free Java , 2004, VMCAI.

[19]  Michael Burrows,et al.  Eraser: a dynamic data race detector for multithreaded programs , 1997, TOCS.