Soundness of Data Flow Analyses for Weak Memory Models

Modern multi-core microprocessors implement weak memory consistency models; programming for these architectures is a challenge. This paper solves a problem open for ten years, and originally posed by Rinard: we identify sufficient conditions for a data flow analysis to be sound w.r.t. weak memory models. We first identify a class of analyses that are sound, and provide a formal proof of soundness at the level of trace semantics. Then we discuss how analyses unsound with respect to weak memory models can be repaired via a fixed point iteration, and provide experimental data on the runtime overhead of this method.

[1]  Jade Alglave,et al.  Fences in Weak Memory Models , 2010, CAV.

[2]  Bertrand Jeannet Relational Interprocedural Verification of Concurrent Programs , 2009, SEFM.

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

[4]  Ana Cavalcanti,et al.  FM 2009: Formal Methods, Second World Congress, Eindhoven, The Netherlands, November 2-6, 2009. Proceedings , 2009, FM.

[5]  Chao Wang,et al.  Symbolic Predictive Analysis for Concurrent Programs , 2009, FM.

[6]  Antoine Mid The Octagon Abstract Domain , 2001 .

[7]  Leslie Lamport,et al.  How to Make a Correct Multiprocess Program Execute Correctly on a Multiprocessor , 1997, IEEE Trans. Computers.

[8]  Rajeev Alur,et al.  A Temporal Logic of Nested Calls and Returns , 2004, TACAS.

[9]  Pietro Ferrara Static Analysis Via Abstract Interpretation of the Happens-Before Memory Model , 2008, TAP.

[10]  Jade Alglave,et al.  Stability in Weak Memory Models , 2011, CAV.

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

[12]  Nicolas Halbwachs,et al.  Automatic discovery of linear restraints among variables of a program , 1978, POPL.

[13]  Peter Sewell,et al.  A Better x86 Memory Model: x86-TSO (Extended Version) , 2009 .

[14]  Mark D. Hill,et al.  Weak ordering—a new definition , 1998, ISCA '98.

[15]  Bjarne Steensgaard,et al.  Points-to analysis in almost linear time , 1996, POPL '96.

[16]  Antoine Miné,et al.  Static Analysis of Run-Time Errors in Embedded Critical Parallel C Programs , 2011, ESOP.

[17]  Martin C. Rinard,et al.  Pointer analysis for multithreaded programs , 1999, PLDI '99.

[18]  No License,et al.  Intel ® 64 and IA-32 Architectures Software Developer ’ s Manual Volume 3 A : System Programming Guide , Part 1 , 2006 .

[19]  Bernhard Steffen,et al.  Parallelism for Free : E cient and Optimal Bitvector Analyses for Parallel Programs , 1996 .

[20]  Patrick Cousot,et al.  Static determination of dynamic properties of programs , 1976 .

[21]  Jan Wen Voung,et al.  Dataflow analysis for concurrent programs using datarace detection , 2008, PLDI '08.

[22]  Francesco Zappa Nardelli,et al.  x86-TSO , 2010, Commun. ACM.

[23]  Viktor Vafeiadis,et al.  Verifying Fence Elimination Optimisations , 2011, SAS.

[24]  Sebastian Burckhardt,et al.  CheckFence: checking consistency of concurrent data types on relaxed memory models , 2007, PLDI '07.

[25]  Chao Wang,et al.  Trace-Based Symbolic Analysis for Atomicity Violations , 2010, TACAS.

[26]  Dhananjay M. Dhamdhere,et al.  A generalized theory of bit vector data flow analysis , 1994, TOPL.

[27]  Flemming Nielson,et al.  Principles of Program Analysis , 1999, Springer Berlin Heidelberg.

[28]  Jade Alglave,et al.  Litmus: Running Tests against Hardware , 2011, TACAS.

[29]  Suresh Jagannathan,et al.  Relaxed-memory concurrency and verified compilation , 2011, POPL '11.

[30]  Suresh Jagannathan,et al.  CompCertTSO: A Verified Compiler for Relaxed-Memory Concurrency , 2013, JACM.

[31]  Martin C. Rinard,et al.  Analysis of Multithreaded Programs , 2001, SAS.

[32]  Antoine Miné,et al.  The octagon abstract domain , 2001, High. Order Symb. Comput..

[33]  Daniel Kroening,et al.  Model checking concurrent linux device drivers , 2007, ASE.

[34]  Peter Sewell,et al.  A Better x86 Memory Model: x86-TSO , 2009, TPHOLs.

[35]  Zachary Kincaid,et al.  Compositional Bitvector Analysis for Concurrent Programs with Nested Locks , 2010, SAS.

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

[37]  Sarita V. Adve,et al.  Shared Memory Consistency Models: A Tutorial , 1996, Computer.

[38]  Hans-Juergen Boehm,et al.  Foundations of the C++ concurrency memory model , 2008, PLDI '08.