SAM: Self-adaptive Dynamic Analysis for Multithreaded Programs
- 735 Downloads
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.
KeywordsShared Variable Data Race Runtime Overhead Multithreaded Program Program Context
Unable to display preview. Download preview PDF.
- 2.Callanan, S.: Flexible debugging with controllable overhead. Ph.D. Dissertation, Stony Brook University (2009)Google Scholar
- 3.Chen, Q., Wang, L., Yang, Z.: HEAT: A Combined Static and Dynamic Approach for Escape Analysis. In: 33rd Annual IEEE International Computer Software and Applications Conference (COMPSAC 2009). IEEE Press, Seattle (2009)Google Scholar
- 5.Choi, J.-D., Lee, K., Loginov, A., O’Callahan, R., Sarkar, V., Sridharan, M.: Efficient and precise datarace detection for multithreaded object-oriented programs. In: Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation, PLDI 2002, pp. 258–269. ACM, New York (2002)CrossRefGoogle Scholar
- 6.Dwyer, M.B., Kinneer, A., Elbaum, S.: Adaptive online program analysis. In: ICSE 2007: Proceedings of the 29th International Conference on Software Engineering, pp. 220–229. IEEE Computer Society, Washington, DC (2007)Google Scholar
- 7.Eclipse, http://www.eclipse.org/
- 10.Java Grande Forum. Java Grande Multi-threaded Benchmark Suite. version 1.0, http://www.javagrande.org/
- 12.Muchnick, S.S.: Advanced compiler design and implementation. Morgan Kaufmann Publishers Inc., San Francisco (1997)Google Scholar
- 16.Vakkalanka, S., Szubzda, G., Vo, A., Gopalakrishnan, G., Kirby, R.M., Thakur, R.: Static-Analysis Assisted Dynamic Verification of MPI Waitany Programs (Poster Abstract). In: Ropo, M., Westerholm, J., Dongarra, J. (eds.) PVM/MPI. LNCS, vol. 5759, pp. 329–330. Springer, Heidelberg (2009)CrossRefGoogle Scholar
- 17.von Praun, C., Gross, T.R.: Object race detection. In: Proc. 16th ACM Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA). SIGPLAN Notices, vol. 36(11), pp. 70–82. ACM Press (October 2001)Google Scholar
- 18.Wang, L., Stoller, S.D.: Accurate and efficient runtime detection of atomicity errors in concurrent programs. In: Proc. ACM SIGPLAN 2006 Symposium on Principles and Practice of Parallel Programming (PPoPP). ACM Press (March 2006)Google Scholar