A Certified Data Race Analysis for a Java-like Language

A fundamental issue in multithreaded programming is detecting data races . A program is said to be well synchronised if it does not contain data races w.r.t. an interleaving semantics. Formally ensuring this property is central, because the java Memory Model then guarantees that one can safely reason on the interleaved semantics of the program. In this work we formalise in the coq proof assistant a java bytecode data race analyser based on the conditional must-not alias analysis of Naik and Aiken. The formalisation includes a context-sensitive points-to analysis and an instrumented semantics that counts method calls and loop iterations. Our java -like language handles objects, virtual method calls, thread spawning and lock and unlock operations for threads synchronisation.

[1]  Alexander Aiken,et al.  Effective static race detection for Java , 2006, PLDI '06.

[2]  Marieke Huisman,et al.  The Java Memory Model: a Formal Explanation , 2007 .

[3]  Markus Müller-Olm,et al.  Formalization of Conflict Analysis of Programs with Procedures, Thread Creation, and Monitors , 2007, Arch. Formal Proofs.

[4]  D. B. Davis,et al.  Sun Microsystems Inc. , 1993 .

[5]  Alexander Aiken,et al.  Conditional must not aliasing for static race detection , 2007, POPL '07.

[6]  Monica S. Lam,et al.  Cloning-based context-sensitive pointer alias analysis using binary decision diagrams , 2004, PLDI '04.

[7]  Brian Campbell,et al.  Amortised Memory Analysis Using the Depth of Data Structures , 2009, ESOP.

[8]  David Aspinall,et al.  Formalising Java's Data Race Free Guarantee , 2007, TPHOLs.

[9]  David Cachera,et al.  Extracting a Data Flow Analyser in Constructive Logic , 2004, ESOP.

[10]  Peter Neumann,et al.  Safeware: System Safety and Computers , 1995, SOEN.

[11]  Martin C. Rinard,et al.  ACM Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA), November 2002 Ownership Types for Safe Programming: Preventing Data Races and Deadlocks , 2022 .

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

[13]  Xavier Leroy,et al.  Formal certification of a compiler back-end or: programming a compiler with a proof assistant , 2006, POPL '06.

[14]  Jeremy Manson,et al.  The Java memory model , 2005, POPL '05.

[15]  Marieke Huisman,et al.  BicolanoMT: a Formalization of Multi-Threaded Java at Bytecode Level 1 , 2008 .

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

[17]  Andrew W. Appel,et al.  Oracle Semantics for Concurrent Separation Logic , 2008, ESOP.

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

[19]  Martín Abadi,et al.  Types for Safe Locking , 1999, ESOP.

[20]  Tobias Nipkow,et al.  A machine-checked model for a Java-like language, virtual machine, and compiler , 2006, TOPL.