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.
Similar content being viewed by others
References
Apache tomcat, version 6.0.16. Available from http://tomcat.apache.org
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
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
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, USA
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
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–240
Eclipse. Available from http://www.eclipse.org/
Java Grande Forum. Java Grande Multi-threaded Benchmark Suite. version 1.0. Available from http://www.javagrande.org/
Jigsaw, version 2.2.6. Available from http://www.w3c.org
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
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
Majumdar R, Sen K (2007) Hybrid concolic testing. In: Proceedings of the 29th International Conference on Software Engineering (ICSE). Institute of Electrical and Electronics Engineers
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–10
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–218
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 Press
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–105
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
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/
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)
Acknowledgment
This work was supported in part by ONR under Grant N000140910740.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Chen, Q., Wang, L. & Yang, Z. HEAT: a combined approach for thread escape analysis. Int J Syst Assur Eng Manag 2, 135–143 (2011). https://doi.org/10.1007/s13198-011-0069-2
Received:
Revised:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s13198-011-0069-2