Getting Rid of Store-Buffers in TSO Analysis

We propose an approach for reducing the TSO reachability analysis of concurrent programs to their SC reachability analysis, under some conditions on the explored behaviors. First, we propose a linear code-to-code translation that takes as input a concurrent program P and produces a concurrent program P′ such that, running P′ under SC yields the same set of reachable (shared) states as running P under TSO with at most k context-switches for each thread, for a fixed k. Basically, we show that it is possible to use only O(k) additional copies of the shared variables of P as local variables to simulate the store buffers, even if they are unbounded. Furthermore, we show that our translation can be extended so that an unbounded number of context-switches is possible, under the condition that each write operation sent to the store buffer stays there for at most k contextswitches of the thread. Experimental results show that bugs due to TSO can be detected with small bounds, using off-the-shelf SC analysis tools.

[1]  Mohamed Faouzi Atig,et al.  Context-Bounded Analysis for Concurrent Programs with Dynamic Creation of Threads , 2009, TACAS.

[2]  Thomas W. Reps,et al.  Reducing Concurrent Analysis Under a Context Bound to Sequential Analysis , 2008, CAV.

[3]  Zvonimir Rakamaric,et al.  Delay-bounded scheduling , 2011, POPL '11.

[4]  Javier Esparza,et al.  Reachability Analysis of Multithreaded Software with Asynchronous Communication , 2005, FSTTCS.

[5]  Leslie Lamport,et al.  A fast mutual exclusion algorithm , 1987, TOCS.

[6]  Salvatore La Torre,et al.  Reducing Context-Bounded Concurrent Reachability to Sequential Reachability , 2009, CAV.

[7]  Edsger Wybe Dijkstra,et al.  Cooperating Sequential Processes, Technical Report EWD-123 , 1965 .

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

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

[10]  Salvatore La Torre,et al.  Analyzing recursive programs using a fixed-point calculus , 2009, PLDI '09.

[11]  Lucas C. Cordeiro,et al.  Verifying multi-threaded software using smt-based context-bounded model checking , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[12]  Boleslaw K. Szymanski A simple solution to Lamport's concurrent programming problem with linear wait , 1988, ICS '88.

[13]  Sundar Sarukkai,et al.  FSTTCS 2005: Foundations of Software Technology and Theoretical Computer Science, 25th International Conference, Hyderabad, India, December 15-18, 2005, Proceedings , 2005, FSTTCS.

[14]  Brian Case,et al.  SPARC architecture , 1992 .

[15]  Edsger W. Dijkstra,et al.  Cooperating sequential processes , 2002 .

[16]  David L Weaver,et al.  The SPARC architecture manual : version 9 , 1994 .

[17]  Sebastian Burckhardt,et al.  On the verification problem for weak memory models , 2010, POPL '10.

[18]  Jakob Rehof,et al.  Context-Bounded Model Checking of Concurrent Software , 2005, TACAS.

[19]  Gary L. Peterson,et al.  Myths About the Mutual Exclusion Problem , 1981, Inf. Process. Lett..

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

[21]  Madan Musuvathi,et al.  Iterative context bounding for systematic testing of multithreaded programs , 2007, PLDI '07.

[22]  Salvatore La Torre,et al.  Model-Checking Parameterized Concurrent Programs Using Linear Interfaces , 2010, CAV.

[23]  Pierre Wolper,et al.  An Automata-Based Symbolic Approach for Verifying Programs on Relaxed Memory Models , 2010, SPIN.

[24]  Andreas Podelski,et al.  ACSAR: Software Model Checking with Transfinite Refinement , 2007, SPIN.