SAM: Self-adaptive Dynamic Analysis for Multithreaded Programs

Many dynamic analysis techniques have been proposed to detect incorrect program behaviors resulted from faulty code. However, the huge overhead incurred by such dynamic analysis prevents thorough testing of large-scale software systems. In this paper, we propose a novel framework using compile-time and run-time optimizations on instrumentation and monitoring that aim to significantly reduce the overhead of dynamic analysis on multithreaded programs. We implemented a tool called SAM (Self-Adaptive Monitoring) that can selectively turn off excessive monitoring on repeated code region invocations if the current program context has been determined to be redundant, which may assist many existing dynamic detection tools to improve their performance. Specifically, we approximate the program context for a code region invocation as a set of variables, which include path-critical variables and shared variables accessed in that region. The path-critical variables are inferred using a use-definition dataflow analysis, and the shared variables are identified using a hybrid thread-based escape analysis. We have implemented the tool in Java and evaluated it on a set of real-world programs. Our experimental results show that it can significantly reduce the runtime overhead of the baseline atomicity violation and data race analyses by an average of 50% and 20%, respectively, while roughly keeping the accuracy of the underlying runtime detection tools.

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

[2]  Michael I. Jordan,et al.  Bug isolation via remote program sampling , 2003, PLDI.

[3]  Harish Patil,et al.  Low‐cost, Concurrent Checking of Pointer and Array Accesses in C Programs , 1997, Softw. Pract. Exp..

[4]  Michael Burrows,et al.  Eraser: a dynamic data race detector for multi-threaded programs , 1997, TOCS.

[5]  Erez Zadok,et al.  Flexible debugging with controllable overhead , 2009 .

[6]  Matthew B. Dwyer,et al.  Adaptive Online Program Analysis , 2007, 29th International Conference on Software Engineering (ICSE'07).

[7]  Rajeev Thakur,et al.  Static-Analysis Assisted Dynamic Verification of MPI Waitany Programs (Poster Abstract) , 2009, PVM/MPI.

[8]  Thomas R. Gross,et al.  Object race detection , 2001, OOPSLA '01.

[9]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .

[10]  Jack Dongarra,et al.  Recent Advances in Parallel Virtual Machine and Message Passing Interface, 15th European PVM/MPI Users' Group Meeting, Dublin, Ireland, September 7-10, 2008. Proceedings , 2008, PVM/MPI.

[11]  Michael Burrows,et al.  Eraser: a dynamic data race detector for multithreaded programs , 1997, TOCS.

[12]  Scott D. Stoller,et al.  Accurate and efficient runtime detection of atomicity errors in concurrent programs , 2006, PPoPP '06.

[13]  Zijiang Yang,et al.  HAVE: Detecting Atomicity Violations via Integrated Dynamic and Static Analysis , 2009, FASE.

[14]  Susan Horwitz,et al.  Using Static Analysis to Reduce Dynamic Analysis Overhead , 2005, Formal Methods Syst. Des..

[15]  Matthew Arnold,et al.  A framework for reducing the cost of instrumented code , 2001, PLDI '01.

[16]  Zijiang Yang,et al.  HEAT: An Integrated Static and Dynamic Approach for Thread Escape Analysis , 2009, 2009 33rd Annual IEEE International Computer Software and Applications Conference.

[17]  Matthias Hauswirth,et al.  Low-overhead memory leak detection using adaptive statistical profiling , 2004, ASPLOS XI.

[18]  Perdita Stevens,et al.  Modelling Recursive Calls with UML State Diagrams , 2003, FASE.

[19]  Samuel P. Midkiff,et al.  Artemis: practical runtime monitoring of applications for execution anomalies , 2006, PLDI '06.

[20]  Monica S. Lam,et al.  Enhancing software reliability with speculative threads , 2002, ASPLOS X.