HEAT: a combined approach for thread escape analysis

Original Article
  • 77 Downloads

Abstract

Thread escape analysis can determine whether and when a variable becomes shared by multiple threads, which is a foundation for many other program analysis and software testing techniques. Most existing escape analysis tools are either purely dynamic or static analyses. Static analysis, which considers all possible behaviors of a program, may produce false positives; whereas dynamic approaches miss the information from unexecuted code sections of a program. This paper presents a hybrid approach that integrates static and dynamic analyses to address this problem. We first perform static analysis to obtain succinct summaries of accesses to all variables and interprocedural information. Dynamic analysis is then used to confirm variable sharing; for unexecuted code, we determine the sharing of variables by performing an interprocedural synthesis based on the runtime information and static summaries. Compared to dynamic analysis, the hybrid approach is able to determine the escape property of variables in unexecuted code. Compared to static analysis, the hybrid approach produces fewer false alarms. We implemented this hybrid escape analysis in Java. Our experiments on several benchmarks and real-world applications show that the hybrid approach improves the accuracy of escape analysis compared to existing approaches and significantly reduces the performance overhead of a subsequent program analysis.

Keywords

Thread escape analysis Program analysis Concurrent program Software testing Dynamic analysis 

Notes

Acknowledgment

This work was supported in part by ONR under Grant N000140910740.

References

  1. Apache tomcat, version 6.0.16. Available from http://tomcat.apache.org
  2. Bogda J, Hölzle U (1999) Removing unnecessary synchronization in java. SIGPLAN Not 34(10):35–46 http://doi.acm.org/10.1145/320385.320388 Google Scholar
  3. Chen F, Serbanuta TF, Rosu G (2008) jpredictor: a predictive runtime analysis tool for java. In: ICSE ’08: proceedings of the 30th international conference on Software engineering, pp 221–230. ACM, New York, NY, USA. http://doi.acm.org/10.1145/1368088.1368119
  4. Chen Q, Wang L, Yang Z (2009) HEAT: a combined static and dynamic approach for escape analysis. In: 33rd annual IEEE international Computer Software and Applications Conference (COMPSAC2009). IEEE Press, Seattle, USAGoogle Scholar
  5. Choi JD, Gupta M, Serrano MJ, Sreedhar VC, Midkiff SP (2003) Stack allocation and synchronization optimizations for java using escape analysis. ACM Trans. Program Lang Syst 25(6):876–910. http://doi.acm.org/10.1145/945885.945892 Google Scholar
  6. Dwyer MB, Hatcliff J, Robby, Ranganath VP (2004) Exploiting object escape and locking information in partial-order reductions for concurrent object-oriented programs. Form Method Syst Des 25(2–3):199–240Google Scholar
  7. Eclipse. Available from http://www.eclipse.org/
  8. Java Grande Forum. Java Grande Multi-threaded Benchmark Suite. version 1.0. Available from http://www.javagrande.org/
  9. Jigsaw, version 2.2.6. Available from http://www.w3c.org
  10. Lee K, Midkiff SP (2006) A two-phase escape analysis for parallel java programs. In: PACT ’06: proceedings of the 15th international conference on Parallel architectures and compilation techniques. ACM, New York, NY, USA, pp 53–62. http://doi.acm.org/10.1145/1152154.1152166
  11. Lee K, Fang X, Midkiff SP (2007) Practical escape analyses: how good are they? In: VEE ’07: proceedings of the 3rd international conference on virtual execution environments. ACM, New York, NY, USA, pp 180–190. http://doi.acm.org/10.1145/1254810.1254836
  12. Majumdar R, Sen K (2007) Hybrid concolic testing. In: Proceedings of the 29th International Conference on Software Engineering (ICSE). Institute of Electrical and Electronics EngineersGoogle Scholar
  13. Nishiyama H (2004) Detecting data races using dynamic escape analysis based on read barrier. In: VM’04: proceedings of the 3rd conference on Virtual Machine Research And Technology Symposium. USENIX Association, Berkeley, CA, USA, pp 10–10Google Scholar
  14. Ruf E (2000) Effective synchronization removal for Java. In: Proceedings of ACM SIGPLAN conference on Programming Language Design and Implementation (PLDI). ACM Press, pp 208–218Google Scholar
  15. Salcianu A, Rinard M (2001) Pointer and escape analysis for multithreaded programs. In: Proceedings of ACM SIGPLAN 2001 Symposium on Principles and Practice of Parallel Programming (PPoPP). ACM PressGoogle Scholar
  16. Smith LA, Bull JM (2001) A multithreaded java grande benchmark suite. In: Proceedings of the third workshop on java for high performance computing, pp 97–105Google Scholar
  17. Sura Z, Fang X, Wong CL, Midkiff SP, Lee J, Padua D (2005) Compiler techniques for high performance sequentially consistent java programs. In: PPoPP ’05: proceedings of the tenth ACM SIGPLAN symposium on principles and practice of parallel programming. ACM, New York, NY, USA, pp 2–13. http://doi.acm.org/10.1145/1065944.1065947
  18. von Praun C, Gross TR (2001) Object race detection. In: Proceedings of 16th ACM conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA), SIGPLAN Notices. ACM Press, vol 36(11):70–82. http://www.inf.ethz.ch/ praun/
  19. Whaley J, Rinard M (1999) Compositional pointer and escape analysis for Java programs. In: Proceedings of ACM conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA). ACM Press, pp 187–206. Appeared in ACM SIGPLAN Notices 34(10)Google Scholar

Copyright information

© The Society for Reliability Engineering, Quality and Operations Management (SREQOM), India and The Division of Operation and Maintenance, Lulea University of Technology, Sweden 2011

Authors and Affiliations

  1. 1.Department of Computer ScienceUniversity of WyomingLaramieUSA
  2. 2.Department of Computer ScienceWestern Michigan UniversityKalamazooUSA

Personalised recommendations