Automated Verification of CountDownLatch

The CountDownLatch (CDL) is a versatile concurrency mechanism that was first introduced in Java 5, and is also being adopted into C++ and C#. Its usage allows one or more threads to exchange resources and synchronize by waiting for some tasks to be completed before others can proceed. In this paper, we propose a new framework for verifying the correctness of concurrent applications that use CDLs. Our framework is built on top of two existing mechanisms, concurrent abstract predicate and fictional separation logic, with some enhancements such as borrowed heap and thread local abstraction. In addition, we propose a new inconsistency detection mechanism based on waits-for relation to guarantee deadlock freedom. Prior concurrency verification works have mostly focused on data-race freedom. As a practical proof of concept, we have implemented this new specification and verification mechanism for CDL in a new tool, called HIPCAP, on top of an existing HIP verifier. We have used this new tool to successfully verify various use cases for CDL.

[1]  永田 守男,et al.  Verifying Properties of Parallel Programs : An Axiomatic Approach , 1976 .

[2]  Jan Smans,et al.  Deadlock-Free Channels and Locks , 2010, ESOP.

[3]  Lars Birkedal,et al.  Impredicative Concurrent Abstract Predicates , 2014, ESOP.

[4]  Peter W. O'Hearn,et al.  BI as an assertion language for mutable data structures , 2001, POPL '01.

[5]  Suresh Jagannathan,et al.  Modular reasoning for deterministic parallelism , 2011, POPL '11.

[6]  Viktor Vafeiadis,et al.  Concurrent Abstract Predicates , 2010, ECOOP.

[7]  John Tang Boyland,et al.  Checking Interference with Fractional Permissions , 2003, SAS.

[8]  P ? ? ? ? ? ? ? % ? ? ? ? , 1991 .

[9]  Viktor Vafeiadis,et al.  A Marriage of Rely/Guarantee and Separation Logic , 2007, CONCUR.

[10]  Andrew W. Appel,et al.  Oracle semantics , 2008 .

[11]  John C. Reynolds,et al.  Separation logic: a logic for shared mutable data structures , 2002, Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.

[12]  K. Rustan M. Leino,et al.  A Basis for Verifying Multi-threaded Programs , 2009, ESOP.

[13]  Philippa Gardner,et al.  CoLoSL: Concurrent Local Subjective Logic , 2015, ESOP.

[14]  Marieke Huisman,et al.  Reasoning about Java's Reentrant Locks , 2008, APLAS.

[15]  Lars Birkedal,et al.  A Separation Logic for Fictional Sequential Consistency , 2015, ESOP.

[16]  Aquinas Hobor,et al.  The ramifications of sharing in data structures , 2013, POPL.

[17]  Marieke Huisman,et al.  Permission-Based Separation Logic for Multithreaded Java Programs , 2014, Log. Methods Comput. Sci..

[18]  François Pottier,et al.  The essence of monotonic state , 2011, TLDI '11.

[19]  Ilya Sergey,et al.  Communicating State Transition Systems for Fine-Grained Concurrent Resources , 2014, ESOP.

[20]  Lars Birkedal,et al.  Iris: Monoids and Invariants as an Orthogonal Basis for Concurrent Reasoning , 2015, POPL.

[21]  Xinyu Feng,et al.  Modular verification of concurrent assembly code with dynamic thread creation and termination , 2005, ICFP '05.

[22]  Alexey Gotsman,et al.  Local Reasoning for Storable Locks and Threads , 2007, APLAS.

[23]  Hongseok Yang,et al.  Views: compositional reasoning for concurrent programs , 2013, POPL.

[24]  Lars Birkedal,et al.  Modular Reasoning about Separation of Concurrent Data Structures , 2013, ESOP.

[25]  Abraham Silberschatz,et al.  Operating System Concepts , 1983 .

[26]  Peter W. O'Hearn,et al.  Resources, concurrency, and local reasoning , 2007 .

[27]  Hongseok Yang,et al.  Variables as Resource in Separation Logic , 2005, MFPS.

[28]  Frank Piessens,et al.  Expressive modular fine-grained concurrency specification , 2011, POPL '11.

[29]  Wei-Ngan Chin,et al.  An Expressive Framework for Verifying Deadlock Freedom , 2013, ATVA.

[30]  Cliff B. Jones,et al.  Specification and Design of (Parallel) Programs , 1983, IFIP Congress.

[31]  Lars Birkedal,et al.  Fictional Separation Logic , 2012, ESOP.

[32]  Xinyu Feng Local rely-guarantee reasoning , 2009, POPL '09.

[33]  Ilya Sergey,et al.  Mechanized verification of fine-grained concurrent programs , 2015, PLDI.