170 likes | 344 Views
Effective Interprocedural Resource Leak Detection ICSE 10. Emina Torlak Satish Chandra. IBM T.J. Watson Research Center, USA. Author. Publications 2010 MemSAT: checking axiomatic specifications of memory models Proceedings of the 2010 ACM SIGPLAN
E N D
Effective Interprocedural Resource Leak DetectionICSE 10 Emina Torlak Satish Chandra IBM T.J. Watson Research Center, USA
Author Publications 2010 MemSAT: checking axiomatic specifications of memory modelsProceedings of the 2010 ACM SIGPLAN Correct Refactoring of Concurrent Java Code24th European Conference on Object-Oriented Programming (ECOOP) 2008 Controlled physical random functions and applicationsACM Transactions on Information and System Security (TISSEC) Emina Torlak
Author Publications 2010 Making defect-finding tools work for youICSE Programming with Angelic Non-determinism POPL 2009 Snugglebug: a powerful approach to weakest preconditions PLDI 2008 Verifying dereference safety via expanding-scope analysis ISSTA Generating precise and concise procedure summaries POPL Satish Chandra
Related Publications in ICSE ’10 • LEAKPOINT: Pinpointing the Causes of Memory Leaks, James A. Clause and Alessandro Orso (Georgia Institute of Technology, Atlanta, USA) • Efficient and precise Typestate Analysis by determining Continuation-equivalent States, Eric Bodden (Technische Universitaet Darmstadt, Germany) • Precise Calling Context Encoding, William N. Sumner, Yunhui Zheng, Dasarath Weeratunge and Xiangyu Zhang (Purdue University, Lafayette, USA) • Khasiana: Making Defect-Finding Tools Work for You, Mangala Gowri Nanda, Monika Gupta, Saurabh Sinha (IBM Research, India, India), Satish Chandra (IBM T.J. Watson Research Center, USA), David Schmidt (IBM Tivoli, USA), and Pradeep Balachandran (IBM Rational, India)
Example Exception might occur here Exception expected here Exception cause FileOutputStream instance never released!
Contributions of “Tracker” • Useful • the reports produced by the tool is actionable by a user • Scalable • the tool is able to handle real-world Java applications consisting of tens of thousands of classes
p = new FileOutputStream(file) P.close()
Interprocedural Optimization A method is RELEVANT to a fact <p,R,a> if it (or any of its transitive callees) contains a statement that may alter the fact's State. (much like slicing in some sense) This optimization is fruitful, because in practice a lot of methods are auxiliary in nature
COMPUTING ACTIONABLE REPORTS • Prioritization • Exception Flow • processes exceptional edges selectively • Customizable relevant exception types • Nested Resources • Cluster reports around nested resources like: FileOutputStream fos = new FileOutputStream(file); OutputStreamWriter osw = new OutputStreamWriter(fos, enc); ... fos.close();
Evaluation of Efficiency Time used
Evaluation of Exception Flow Filtering Results are the number of true positives and false positives generated by full exception edge flow. Base TP and FP are the results obtained by selective exception flow. The higher the better The lower the better
Comparison with Related Techniques The lower the better The higher the better The higher the better The lower the better
CONCLUSION Their contribution is in overcoming engineering challenges, using a blend of existing and new techniques. An empirical evaluation of the tool showed its overall effectiveness.
FUTURE WORK • Discovering specifications automatically, especially with regards to identifying which pairs of types are related by a wrapper-wrappee relationship. • Another promising direction is to extend the leak detection algorithm to automatically suggest code refactorings.
REFERENCES • M. Arnold, M. Vechev, and E. Yahav. QVM: an efficient runtime for detecting defects in deployed systems OOPSLA `07 • N. Ayewah, D. Hovemeyer, J. D. Morgenthaler, J. Penix, and W. Pugh. Using static analysis to find bugs IEEE Software `08 • R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, and F. K. Zadeck. Efficiently computing static single assignment form and the control dependence graph ACM TRANS PROG LANG • M. Das, S. Lerner, and M. Seigle. Esp: Path-sensitive program verification in polynomial time PLDI `02 • N. Dor, S. Adams, M. Das, and Z. Yang. Software validation via scalable path-sensitive value flow analysis ISSTA `04 • T. Reps, S. Horwitz, and M. Sagiv. Precise interprocedural data flow analysis via graph reachability POPL `95