Abstract
State-of-the-art dynamic bug detectors such as data race and memory leak detectors report program locations that are likely causes of bugs. However, programmers need more than static program locations to understand the behavior of increasingly complex and concurrent software. Dynamic calling context provides additional information, but it is expensive to record calling context frequently, e.g., at every read and write. Context-sensitive dynamic analyses can build and maintain a calling context tree (CCT) to track calling context--but in order to reuse existing nodes, CCT-based approaches require an expensive lookup.
This paper introduces a new approach for context sensitivity that avoids this expensive lookup. The approach uses a new data structure called the calling context uptree (CCU) that adds low overhead by avoiding the lookup and instead allocating a new node for each context. A key contribution is that the approach can mitigate the costs of allocating many nodes by extending tracing garbage collection (GC): GC collects unused CCU nodes naturally and efficiently, and we extend GC to merge duplicate nodes lazily.
We implement our CCU-based approach in a high-performance Java virtual machine and integrate it with a staleness-based memory leak detector and happens-before data race detector, so they can report context-sensitive program locations that cause bugs. We show that the CCU-based approach, in concert with an extended GC, provides a compelling alternative to CCT-based approaches for adding context sensitivity to dynamic analyses.
- H. Agrawal and J. R. Horgan. Dynamic Program Slicing. In ACM Conference on Programming Language Design and Implementation, pages 246--256, 1990. Google Scholar
Digital Library
- B. Alpern, S. Augart, S. M. Blackburn, M. Butrico, A. Cocchi, P. Cheng, J. Dolby, S. Fink, D. Grove, M. Hind, K. S. McKinley, M. Mergen, J. E. B. Moss, T. Ngo, and V. Sarkar. The Jikes Research Virtual Machine Project: Building an Open-Source Research Community. IBM Systems Journal, 44:399--417, 2005. Google Scholar
Digital Library
- G. Ammons, T. Ball, and J. R. Larus. Exploiting Hardware Performance Counters with Flow and Context Sensitive Profiling. In ACM Conference on Programming Language Design and Implementation, pages 85--96, 1997. Google Scholar
Digital Library
- A. W. Appel and M. J. R. Goncalves. Hash-Consing Garbage Collection. Technical Report TR-412-93, Princeton University, 1993.Google Scholar
- M. Arnold, S. J. Fink, D. Grove, M. Hind, and P. F. Sweeney. Adaptive Optimization in the Jalapeño JVM. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 47--65, 2000. Google Scholar
Digital Library
- G. Ausiello, C. Demetrescu, I. Finocchi, and D. Firmani. k-Calling Context Profiling. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 867--878, 2012. Google Scholar
Digital Library
- T. Ball and J. R. Larus. Efficient Path Profiling. In IEEE/ACM International Symposium on Microarchitecture, pages 46--57, 1996. Google Scholar
Digital Library
- S. M. Blackburn, P. Cheng, and K. S. McKinley. Myths and Realities: The Performance Impact of Garbage Collection. In ACM SIGMETRICS Joint International Conference on Measurement and Modeling of Computer Systems, pages 25--36, 2004. Google Scholar
Digital Library
- S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 169--190, 2006. Google Scholar
Digital Library
- S. M. Blackburn and A. L. Hosking. Barriers: Friend or Foe? In ACM International Symposium on Memory Management, pages 143--151, 2004. Google Scholar
Digital Library
- S. M. Blackburn and K. S. McKinley. Ulterior Reference Counting: Fast Garbage Collection Without a Long Wait. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 344--358, 2003. Google Scholar
Digital Library
- S. M. Blackburn and K. S. McKinley. Immix: A Mark-Region Garbage Collector with Space Efficiency, Fast Collection, and Mutator Performance. In ACM Conference on Programming Language Design and Implementation, pages 22--32, 2008. Google Scholar
Digital Library
- M. D. Bond, G. Z. Baker, and S. Z. Guyer. Breadcrumbs: Efficient Context Sensitivity for Dynamic Bug Detection Analyses. In ACM Conference on Programming Language Design and Implementation, pages 13--24, 2010. Google Scholar
Digital Library
- M. D. Bond, K. E. Coons, and K. S. McKinley. Pacer: Proportional Detection of Data Races. In ACM Conference on Programming Language Design and Implementation, pages 255--268, 2010. Google Scholar
Digital Library
- M. D. Bond and K. S. McKinley. Bell: Bit-Encoding Online Memory Leak Detection. In ACM International Conference on Architectural Support for Programming Languages and Operating Systems, pages 61--72, 2006. Google Scholar
Digital Library
- M. D. Bond and K. S. McKinley. Probabilistic Calling Context. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 97--112, 2007. Google Scholar
Digital Library
- M. D. Bond and K. S. McKinley. Leak Pruning. In ACM International Conference on Architectural Support for Programming Languages and Operating Systems, pages 277--288, 2009. Google Scholar
Digital Library
- T. M. Chilimbi and M. Hauswirth. Low-Overhead Memory Leak Detection Using Adaptive Statistical Profiling. In ACM International Conference on Architectural Support for Programming Languages and Operating Systems, pages 156--164, 2004. Google Scholar
Digital Library
- J.-D. Choi, K. Lee, A. Loginov, R. O'Callahan, V. Sarkar, and M. Sridharan. Efficient and Precise Datarace Detection for Multithreaded Object-Oriented Programs. In ACM Conference on Programming Language Design and Implementation, pages 258--269, 2002. Google Scholar
Digital Library
- D. C. D'Elia, C. Demetrescu, and I. Finocchi. Mining Hot Calling Contexts in Small Space. In ACM Conference on Programming Language Design and Implementation, pages 516--527, 2011. Google Scholar
Digital Library
- T. Elmas, S. Qadeer, and S. Tasiran. Goldilocks: A Race and Transaction-Aware Java Runtime. In ACM Conference on Programming Language Design and Implementation, pages 245--255, 2007. Google Scholar
Digital Library
- C. Flanagan and S. N. Freund. FastTrack: Efficient and Precise Dynamic Race Detection. In ACM Conference on Programming Language Design and Implementation, pages 121--133, 2009. Google Scholar
Digital Library
- C. Flanagan, S. N. Freund, and J. Yi. Velodrome: A Sound and Complete Dynamic Atomicity Checker for Multithreaded Programs. In ACM Conference on Programming Language Design and Implementation, pages 293--303, 2008. Google Scholar
Digital Library
- N. Froyd, J. Mellor-Crummey, and R. Fowler. Low-Overhead Call Path Profiling of Unmodified, Optimized Code. In ACM International Conference on Supercomputing, pages 81--90, 2005. Google Scholar
Digital Library
- R. Garner, S. M. Blackburn, and D. Frampton. Effective Prefetch for Mark-Sweep Garbage Collection. In ACM International Symposium on Memory Management, pages 43--54, 2007. Google Scholar
Digital Library
- B. Goetz. Plugging memory leaks with weak references, 2005. http://www-128.ibm.com/developerworks/java/library/j-jtp11225/.Google Scholar
- K. Hazelwood and D. Grove. Adaptive Online Context-Sensitive Inlining. In IEEE/ACM International Symposium on Code Generation and Optimization, pages 253--264, 2003. Google Scholar
Digital Library
- H. Inoue and T. Nakatani. How a Java VM can get more from a Hardware Performance Monitor. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 137--154, 2009. Google Scholar
Digital Library
- D. F. Jerding, J. T. Stasko, and T. Ball. Visualizing Interactions in Program Executions. In ACM International Conference on Software Engineering, pages 360--370, 1997. Google Scholar
Digital Library
- R. Jones and R. Lins. Garbage Collection: Algorithms for Automatic Dynamic Memory Management. John Wiley & Sons, Inc., New York, NY, USA, 1996. Google Scholar
Digital Library
- M. Jump and K. S. McKinley. Cork: Dynamic Memory Leak Detection for Garbage-Collected Languages. In ACM Symposium on Principles of Programming Languages, pages 31--38, 2007. Google Scholar
Digital Library
- S. Lu, J. Tucek, F. Qin, and Y. Zhou. AVIO: Detecting Atomicity Violations via Access-Interleaving Invariants. In ACM International Conference on Architectural Support for Programming Languages and Operating Systems, pages 37--48, 2006. Google Scholar
Digital Library
- D. Marino, M. Musuvathi, and S. Narayanasamy. LiteRace: Effective Sampling for Lightweight Data-Race Detection. In ACM Conference on Programming Language Design and Implementation, pages 134--143, 2009. Google Scholar
Digital Library
- A. Milanova, A. Rountev, and B. G. Ryder. Parameterized Object Sensitivity for Points-to and Side-Effect Analyses for Java. In ACM International Symposium on Software Testing and Analysis, pages 1--11, 2002. Google Scholar
Digital Library
- T. Mytkowicz, D. Coughlin, and A. Diwan. Inferred Call Path Profiling. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 175--190, 2009. Google Scholar
Digital Library
- N. Nethercote and J. Seward. How to Shadow Every Byte of Memory Used by a Program. In ACM/USENIX International Conference on Virtual Execution Environments, pages 65--74, 2007. Google Scholar
Digital Library
- N. Nethercote and J. Seward. Valgrind: A Framework for Heavyweight Dynamic Binary Instrumentation. In ACM Conference on Programming Language Design and Implementation, pages 89--100, 2007. Google Scholar
Digital Library
- G. Novark, E. D. Berger, and B. G. Zorn. Efficiently and Precisely Locating Memory Leaks and Bloat. In ACM Conference on Programming Language Design and Implementation, pages 397--407, 2009. Google Scholar
Digital Library
- E. Pozniansky and A. Schuster. MultiRace: Efficient On-the-Fly Data Race Detection in Multithreaded C++ Programs. Concurrency and Computation: Practice & Experience, 19(3):327--340, 2007. Google Scholar
Digital Library
- F. Qian and L. Hendren. Towards Dynamic Interprocedural Analysis in JVMs. In USENIX Symposium on Virtual Machine Research and Technology, pages 139--150, 2004. Google Scholar
Digital Library
- F. Qin, S. Lu, and Y. Zhou. SafeMem: Exploiting ECC-Memory for Detecting Memory Leaks and Memory Corruption During Production Runs. In International Symposium on High-Performance Computer Architecture, pages 291--302, 2005. Google Scholar
Digital Library
- A. Sarimbekov, A. Sewe, W. Binder, P. Moret, M. Schoeberl, and M. Mezini. Portable and Accurate Collection of Calling-Context-Sensitive Bytecode Metrics for the Java Virtual Machine. In ACM International Conference on Principles and Practice of Programming in Java, pages 11--20, 2011. Google Scholar
Digital Library
- S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson. Eraser: A Dynamic Data Race Detector for Multi-Threaded Programs. In ACM Symposium on Operating Systems Principles, pages 27--37, 1997. Google Scholar
Digital Library
- J. Seward and N. Nethercote. Using Valgrind to Detect Undefined Value Errors with Bit-Precision. In USENIX Annual Technical Conference, pages 17--30, 2005. Google Scholar
Digital Library
- Y. Smaragdakis, M. Bravenboer, and O. Lhoták. Pick Your Contexts Well: Understanding Object-Sensitivity. In ACM Symposium on Principles of Programming Languages, pages 17--30, 2011. Google Scholar
Digital Library
- J. M. Spivey. Fast, Accurate Call Graph Profiling. Softw. Pract. Exper., 34(3):249--264, 2004. Google Scholar
Digital Library
- Standard Performance Evaluation Corporation. SPECjbb2000 Documentation, release 1.01 edition, 2001.Google Scholar
- W. N. Sumner, Y. Zheng, D. Weeratunge, and X. Zhang. Precise Calling Context Encoding. In ACM International Conference on Software Engineering, pages 525--534, 2010. Google Scholar
Digital Library
- C. von Praun and T. R. Gross. Object Race Detection. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 70--82, 2001. Google Scholar
Digital Library
- J. Whaley. A Portable Sampling-Based Profiler for Java Virtual Machines. In ACM Conference on Java Grande, pages 78--87, 2000. Google Scholar
Digital Library
- B. Wiedermann. Know your Place: Selectively Executing Statements Based on Context. Technical Report TR-07-38, University of Texas at Austin, 2007.Google Scholar
- G. Xu and A. Rountev. Precise Memory Leak Detection for Java Software Using Container Profiling. In ACM International Conference on Software Engineering, pages 151--160, 2008. Google Scholar
Digital Library
- X. Yang, S. M. Blackburn, D. Frampton, and A. L. Hosking. Barriers Reconsidered, Friendlier Still! In ACM International Symposium on Memory Management, pages 37--48, 2012. Google Scholar
Digital Library
- Y. Yu, T. Rodeheffer, and W. Chen. RaceTrack: Efficient Detection of Data Race Conditions via Adaptive Tracking. In ACM Symposium on Operating Systems Principles, pages 221--234, 2005. Google Scholar
Digital Library
- X. Zhang, N. Gupta, and R. Gupta. Pruning Dynamic Slices with Confidence. In ACM Conference on Programming Language Design and Implementation, pages 169--180, 2006. Google Scholar
Digital Library
- X. Zhuang, M. J. Serrano, H. W. Cain, and J.-D. Choi. Accurate, Efficient, and Adaptive Calling Context Profiling. In ACM Conference on Programming Language Design and Implementation, pages 263--271, 2006. Google Scholar
Digital Library
Index Terms
Efficient context sensitivity for dynamic analyses via calling context uptrees and customized memory management
Recommendations
Efficient context sensitivity for dynamic analyses via calling context uptrees and customized memory management
OOPSLA '13: Proceedings of the 2013 ACM SIGPLAN international conference on Object oriented programming systems languages & applicationsState-of-the-art dynamic bug detectors such as data race and memory leak detectors report program locations that are likely causes of bugs. However, programmers need more than static program locations to understand the behavior of increasingly complex ...
Precise Calling Context Encoding
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 ...
Dynamic and Adaptive Calling Context Encoding
CGO '14: Proceedings of Annual IEEE/ACM International Symposium on Code Generation and OptimizationCalling context has been widely used in many software development processes such as testing, event logging, and program analysis. It plays an even more important role in data race detection and performance bottleneck analysis for multi-threaded ...







Comments