Honing the Detection of Interference and Ready Dependence for Slicing Concurrent Java Programs ∗

Despite the usefulness of program slicing as a software specialization and debugging tool and the popularity of concurrent object-oriented programming languages such as Java and C#, slicing techniques for these languages have yet to reach the same level of maturity as foundations and implementations of slicing for sequential languages such as C. In particular, efficiently calculating precise slices in the presence of concurrency and synchronization is challenging, because it is difficult to statically reason about the dependences that arise when multiple threads perform interfering reads/writes on shared data. In this paper, we show how previous work on escape analysis and data race detection can be improved to yield a static analysis that is efficient yet effective for reducing the number of interference dependency edges in program dependence graphs used in slicing concurrent Java programs. The key idea is to statically detect situations where run-time heap objects are reachable from a single thread. In these situations, there is no need to make the worse-case assumption that other threads could be interfering with accesses to these objects (thus, many interference dependency edges are eliminated). Our analysis improves on these previous version by detected situations where accesses to an object cannot be interfered with even though the object escapes its allocated thread. We also show how this analysis can reduce the number of ready dependence edges – dependences that arise due to dependences between Java synchronization constructs. The analysis algorithms described here are implemented in Bandera slicer, which is being applied to reduce the size of software models for model-checking.

[1]  James C. Corbett,et al.  Bandera: extracting finite-state models from Java source code , 2000, ICSE.

[2]  Urs Hölzle,et al.  Removing unnecessary synchronization in Java , 1999, OOPSLA '99.

[3]  Jens Krinke,et al.  Static slicing of threaded programs , 1998, PASTE '98.

[4]  Bruno Blanchet,et al.  Escape analysis for object-oriented languages: application to Java , 1999, OOPSLA '99.

[5]  Stephen N. Freund,et al.  Detecting race conditions in large programs , 2001, PASTE '01.

[6]  George S. Avrunin,et al.  An efficient algorithm for computing MHP information for concurrent Java programs , 1999, ESEC/FSE-7.

[7]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[8]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

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

[10]  Mangala Gowri Nanda,et al.  Slicing concurrent programs , 2000, ISSTA '00.

[11]  Emin Gün Sirer,et al.  Static Analyses for Eliminating Unnecessary Synchronization from Java Programs , 1999, SAS.

[12]  James C. Corbett,et al.  A Formal Study of Slicing for Multi-threaded Programs with JVM Concurrency Primitives , 1999, SAS.

[13]  Jong-Deok Choi,et al.  Static Datarace Analysis for Multithreaded Object-Oriented Programs , 2001 .

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

[15]  Erik Ruf,et al.  Effective synchronization removal for Java , 2000, PLDI '00.

[16]  Jianjun Zhao,et al.  Slicing concurrent Java programs , 1999, Proceedings Seventh International Workshop on Program Comprehension.

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