Abstract
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.
The work was supported in part by ONR N000140910740 and NSF CAREER 1054834.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Arnold, M., Ryder, B.G.: A framework for reducing the cost of instrumented code. SIGPLAN Not. 36(5), 168–179 (2001)
Callanan, S.: Flexible debugging with controllable overhead. Ph.D. Dissertation, Stony Brook University (2009)
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)
Chen, Q., Wang, L., Yang, Z., Stoller, S.: HAVE: Detecting Atomicity Violations via Integrated Dynamic and Static Analysis. In: Chechik, M., Wirsing, M. (eds.) FASE 2009. LNCS, vol. 5503, pp. 425–439. Springer, Heidelberg (2009)
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)
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)
Eclipse, http://www.eclipse.org/
Fei, L., Midkiff, S.P.: Artemis: practical runtime monitoring of applications for execution anomalies. SIGPLAN Not. 41(6), 84–95 (2006)
Hauswirth, M., Chilimbi, T.M.: Low-overhead memory leak detection using adaptive statistical profiling. SIGPLAN Not. 39(11), 156–164 (2004)
Java Grande Forum. Java Grande Multi-threaded Benchmark Suite. version 1.0, http://www.javagrande.org/
Liblit, B., Aiken, A., Zheng, A.X., Jordan, M.I.: Bug isolation via remote program sampling. SIGPLAN Not. 38(5), 141–154 (2003)
Muchnick, S.S.: Advanced compiler design and implementation. Morgan Kaufmann Publishers Inc., San Francisco (1997)
Oplinger, J., Lam, M.S.: Enhancing software reliability with speculative threads. SIGARCH Comput. Archit. News 30, 184–196 (2002)
Patil, H., Fischer, C.: Low-cost, concurrent checking of pointer and array accesses in c programs. Softw. Pract. Exper. 27, 87–110 (1997)
Savage, S., Burrows, M., Nelson, G., Sobalvarro, P., Anderson, T.E.: Eraser: A dynamic data race detector for multi-threaded programs. ACM Transactions on Computer Systems 15(4), 391–411 (1997)
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)
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)
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)
Yong, S.H., Horwitz, S.: Using static analysis to reduce dynamic analysis overhead. Form. Methods Syst. Des. 27, 313–334 (2005)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Chen, Q., Wang, L., Yang, Z. (2012). SAM: Self-adaptive Dynamic Analysis for Multithreaded Programs. In: Eder, K., Lourenço, J., Shehory, O. (eds) Hardware and Software: Verification and Testing. HVC 2011. Lecture Notes in Computer Science, vol 7261. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-34188-5_12
Download citation
DOI: https://doi.org/10.1007/978-3-642-34188-5_12
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-34187-8
Online ISBN: 978-3-642-34188-5
eBook Packages: Computer ScienceComputer Science (R0)