The Community for Technology Leaders
RSS Icon
Subscribe
Issue No.05 - Sept.-Oct. (2012 vol.38)
pp: 1160-1177
William N. Sumner , Purdue University, West Lafayette
Yunhui Zheng , Purdue University, West Lafayette
Dasarath Weeratunge , Purdue University, West Lafayette
Xiangyu Zhang , Purdue University, West Lafayette
ABSTRACT
Calling contexts (CCs) are very important for a wide range of applications such as profiling, debugging, and event logging. Most applications perform expensive stack walking to recover contexts. The resulting contexts are often explicitly represented as a sequence of call sites and hence are bulky. We propose a technique to encode the current calling context of any point during an execution. In particular, an acyclic call path is encoded into one number through only integer additions. Recursive call paths are divided into acyclic subsequences and encoded independently. We leverage stack depth in a safe way to optimize encoding: If a calling context can be safely and uniquely identified by its stack depth, we do not perform encoding. We propose an algorithm to seamlessly fuse encoding and stack depth-based identification. The algorithm is safe because different contexts are guaranteed to have different IDs. It also ensures contexts can be faithfully decoded. Our experiments show that our technique incurs negligible overhead (0-6.4 percent). For most medium-sized programs, it can encode all contexts with just one number. For large programs, we are able to encode most calling contexts to a few numbers. We also present our experience of applying context encoding to debugging crash-based failures.
INDEX TERMS
Context, Encoding, Instruments, Image edge detection, Runtime, Decoding, Software algorithms, call graph, Calling context, context sensitivity, profiling, path encoding, calling context encoding
CITATION
William N. Sumner, Yunhui Zheng, Dasarath Weeratunge, Xiangyu Zhang, "Precise Calling Context Encoding", IEEE Transactions on Software Engineering, vol.38, no. 5, pp. 1160-1177, Sept.-Oct. 2012, doi:10.1109/TSE.2011.70
REFERENCES
[1] X. Zhang, S. Tallam, and R. Gupta, "Dynamic Slicing Long Running Programs through Execution Fast Forwarding," Proc. 14th ACM SIGSOFT Int'l Symp. Foundations of Software Eng., 2006.
[2] Z. Lin, X. Jiang, D. Xu, and X. Zhang, "Automatic Protocol Format Reverse Engineering through Context-Aware Monitored Execution," Proc. 15th Ann. Network and Distributed System Security Symp., 2008.
[3] A. Villazon, W. Binder, and P. Moret, "Flexible Calling Context Reification for Aspect-Oriented Programming," Proc. Eight ACM Int'l Conf. Aspect-Oriented Software Development, 2009.
[4] Z. Lai, S.C. Cheung, and W.K. Chan, "Inter-Context Control-Flow and Data-Flow Test Adequacy Criteria for nesC Applications," Proc. 16th ACM SIGSOFT Int'l Symp. Foundations of Software Eng., 2008.
[5] G. Ammons, T. Ball, and J.R. Larus, "Exploiting Hardware Performance Counters with Flow and Context Sensitive Profiling," Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, 1997.
[6] M.D. Bond and K.S. McKinley, "Probabilistic Calling Context," Proc. 22nd Ann. ACM SIGPLAN Conf. Object-Oriented Programming Systems and Applications, 2007.
[7] X. Zhuang, M.J. Serrano, H.W. Cain, and J.-D. Choi, "Accurate, Efficient, and Adaptive Calling Context Profiling," Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, 2006.
[8] R.E. Jones and C. Ryder, "A Study of Java Object Demographics," Proc. Seventh Int'l Symp. Memory Management, 2008.
[9] X. Zhang, A. Navabi, and S. Jagannathan, "Alchemist: A Transparent Dependence Distance Profiling Infrastructure," Proc. IEEE/ACM Seventh Ann. Int'l Symp. Code Generation and Optimization, 2009.
[10] M.D. Bond, G.Z. Baker, and S.Z. Guyer, "Breadcrumbs: Efficient Context Sensitivity for Dynamic Bug Detection Analyses," Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, 2010.
[11] T. Mytkowicz, D. Coughlin, and A. Diwan, "Inferred Call Path Profiling," Proc. 24th ACM SIGPLAN Conf. Object Oriented Programming Systems Languages and Applications, 2009.
[12] http://www.cs.purdue.edu/~wsumner/research cc, 2012.
[13] T. Ball and J.R. Larus, "Efficient Path Profiling," Proc. IEEE/ACM 29th Ann. Int'l Symp. Microarchitecture, 1996.
[14] T.M. Chilimbi, B. Liblit, K. Mehra, A.V. Nori, and K. Vaswani, "Holmes: Effective Statistical Debugging via Efficient Path Profiling," Proc. 31st Int'l Conf. Software Eng., 2009.
[15] J.R. Larus, "Whole Program Paths," Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, 1999.
[16] T. Reps, T. Ball, M. Das, and J. Larus, "The Use of Program Profiling for Software Maintenance with Applications to the Year 2000 Problem," Proc. Sixth European Software Eng. Conf. Held Jointly with the Fifth ACM SIGSOFT Int'l Symp. Foundations of Software Eng., 1997.
[17] F. Pizlo, L. Ziarek, E. Blanton, P. Maj, and J. Vitek, "High-Level Programming of Embedded Hard Real-Time Devices," Proc. Fifth European Conf. Computer Systems, 2010.
[18] G.C. Necula, S. McPeak, S.P. Rahul, and W. Weimer, "CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs," Proc. 11th Int'l Conf. Compiler Construction, 2002.
[19] A.V. Aho, R. Sethi, and J.D. Ullman, Compilers: Principles, Techniques, and Tools. Addison-Wesley Longman Publishing Co., Inc., 1986.
[20] http://www.sventantau.de/public_files/mplayer mplayer_ 20050824.txt, 2010.
[21] http://www.securityfocus.com/bid6120, 2012.
[22] http://www.securiteam.com/unixfocus5BP0P2A6AY.html , 2012.
[23] P. Zhou, W. Liu, L. Fei, S. Lu, F. Qin, Y. Zhou, S. Midkiff, and J. Torrellas, "AccMon: Automatically Detecting Memory-Related Bugs via Program Counter-Based Invariants," Proc. IEEE/ACM 37th Ann. Int'l Symp. Microarchitecture, 2004.
[24] http://www.sventantau.de/public_files/chmlib chmlib_ 20051126.txt, 2010.
[25] N. Nethercote and J. Seward, "Valgrind: A Framework for Heavyweight Dynamic Binary Instrumentation," Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, 2007.
[26] J.M. Spivey, "Fast, Accurate Call Graph Profiling," Software— Practice and Experience, vol. 34, pp. 249-264, http://portal.acm.orgcitation.cfm?id=991085.991087 , Mar. 2004.
[27] A. Rountev, S. Kagan, and M. Gibas, "Static and Dynamic Analysis of Call Chains in Java," Proc. ACM SIGSOFT Int'l Symp. Software Testing and Analysis, 2004.
[28] D. Melski and T.W. Reps, "Interprocedural Path Profiling," Proc. Eight Int'l Conf. Compiler Construction, Held as Part of the European Joint Conf. the Theory and Practice of Software, 1999.
[29] J. Law and G. Rothermel, "Whole Program Path-Based Dynamic Impact Analysis," Proc. 25th Int'l Conf. Software Eng., 2003.
[30] B. Wiedermann, "Know Your Place: Selectively Executing Statements Based on Context," Technical Report TR-07-38, Univ. of Texas, 2007.
[31] R. Joshi, M.D. Bond, and C. Zilles, "Targeted Path Profiling: Lower Overhead Path Profiling for Staged Dynamic Optimization Systems," Proc. Int'l Symp. Code Generation and Optimization, 2004.
[32] K. Vaswani, A.V. Nori, and T.M. Chilimbi, "Preferential Path Profiling: Compactly Numbering Interesting Paths," Proc. 34th Ann. ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages, 2007.
[33] M. Serrano and X. Zhuang, "Building Approximate Calling Context from Partial Call Traces," Proc. IEEE/ACM Seventh Ann. Int'l Symp. Code Generation and Optimization, 2009.
[34] M. Arnold and D. Grove, "Collecting and Exploiting High-Accuracy Call Graph Profiles in Virtual Machines," Proc. Int'l Symp. Code Generation and Optimization, 2005.
[35] O. Agesen, "The Cartesian Product Algorithm: Simple and Precise Type Inference of Parametric Polymorphism," Proc. Ninth European Conf. Object-Oriented Programming, 1995.
[36] A. Milanova, A. Rountev, and B.G. Ryder, "Parameterized Object Sensitivity for Points-To Analysis for Java," ACM Trans. Software Eng. and Methodology, vol. 14, pp. 1-41, http://doi.acm.org/10.11451044834.1044835 , Jan. 2005.
[37] O. Shivers, "Control-Flow Analysis of Higher-Order Languages," PhD dissertation, Carnegie Mellon Univ., May 1991.
[38] M. Sridharan and R. Bodík, "Refinement-Based Context-Sensitive Points-To Analysis for Java," Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, 2006.
[39] S. Sinha, H. Shah, C. Görg, S. Jiang, M. Kim, and M.J. Harrold, "Fault Localization and Repair for Java Runtime Exceptions," Proc. 18th Int'l Symp. Software Testing and Analysis, 2009.
[40] J. Clause and A. Orso, "Leakpoint: Pinpointing the Causes of Memory Leaks," Proc. IEEE/ACM 32nd Int'l Conf. Software Eng., 2010.
[41] X. Wang, S.C. Cheung, W.K. Chan, and Z. Zhang, "Taming Coincidental Correctness: Coverage Refinement with Context Patterns to Improve Fault Localization," Proc. 31st Int'l Conf. Software Eng., 2009.
[42] S. Artzi, J. Dolby, F. Tip, and M. Pistoia, "Practical Fault Localization for Dynamic Web Applications," Proc. IEEE/ACM 32nd Int'l Conf. Software Eng., 2010.
[43] E.D. Berger and B.G. Zorn, "Diehard: Probabilistic Memory Safety for Unsafe Languages," Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, 2006.
[44] M.D. Bond, N. Nethercote, S.W. Kent, S.Z. Guyer, and K.S. McKinley, "Tracking Bad Apples: Reporting the Origin of Null and Undefined Value Errors," Proc. 22nd Ann. ACM SIGPLAN Conf. Object-Oriented Programming Systems and Applications, 2007.
[45] Y. Brun and M.D. Ernst, "Finding Latent Code Errors via Machine Learning over Program Executions," Proc. 26th Int'l Conf. Software Eng., 2004.
[46] O.C. Chesley, X. Ren, B.G. Ryder, and F. Tip, "Crisp—A Fault Localization Tool for Java Programs," Proc. 29th Int'l Conf. Software Eng., 2007.
[47] T.M. Chilimbi and V. Ganapathy, "HeapMD: Identifying Heap-Based Bugs Using Anomaly Detection," Proc. 12th Int'l Conf. Architectural Support for Programming Languages and Operating Systems, 2006.
[48] P. Francis, D. Leon, M. Minch, and A. Podgurski, "Tree-Based Methods for Classifying Software Failures," Proc. 15th Int'l Symp. Software Reliability Eng., 2004.
[49] J.A. Jones and M.J. Harrold, "Empirical Evaluation of the Tarantula Automatic Fault-Localization Technique," Proc. IEEE/ACM 20th Int'l Conf. Automated Software Eng., 2005.
[50] A.J. Ko and B.A. Myers, "Debugging Reinvented: Asking and Answering Why and Why Not Questions about Program Behavior," Proc. 30th Int'l Conf. Software Eng., 2008.
[51] B. Liblit, M. Naik, A.X. Zheng, A. Aiken, and M.I. Jordan, "Scalable Statistical Bug Isolation," Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, 2005.
[52] C. Liu, X. Yan, L. Fei, J. Han, and S.P. Midkiff, "Sober: Statistical Model-Based Bug Localization," Proc. 10th European Software Eng. Conf. held jointly with 13th ACM SIGSOFT Int'l Symp. Foundations of Software Eng., 2005.
[53] S. Park, R.W. Vuduc, and M.J. Harrold, "Falcon: Fault Localization in Concurrent Programs," Proc. ACM/IEEE 32nd Int'l Conf. Software Eng., 2010.
[54] M. Arnold, M. Hind, and B.G. Ryder, "Online Feedback-Directed Optimization of Java," Proc. 17th ACM SIGPLAN Conf. Object-Oriented Programming, Systems, Languages, and Applications, 2002.
34 ms
(Ver 2.0)

Marketing Automation Platform Marketing Automation Tool