Precise Null Pointer Analysis Through Global Value Numbering
2017, Automated Technology for Verification and Analysis
https://doi.org/10.1007/978-3-319-68167-2_2Abstract
Precise analysis of pointer information plays an important role in many static analysis tools. The precision, however, must be balanced against the scalability of the analysis. This paper focusses on improving the precision of standard context and flow insensitive alias analysis algorithms at a low scalability cost. In particular, we present a semantics-preserving program transformation that drastically improves the precision of existing analyses when deciding if a pointer can alias Null. Our program transformation is based on Global Value Numbering, a scheme inspired from compiler optimization literature. It allows even a flow-insensitive analysis to make use of branch conditions such as checking if a pointer is Null and gain precision. We perform experiments on real-world code and show that the transformation improves precision (in terms of the number of dereferences proved safe) from 86.56% to 98.05%, while incurring a small overhead in the running time.
References (29)
- Andersen, L.O.: Program analysis and specialization for the C programming lan- guage. Ph.D. thesis, DIKU, University of Copenhagen, May 1994
- Barnett, M., Qadeer, S.: BCT: A translator from MSIL to Boogie. In: Sev- enth Workshop on Bytecode Semantics, Verification, Analysis and Transformation (2012)
- Choi, J.D., Burke, M., Carini, P.: Efficient flow-sensitive interprocedural compu- tation of pointer-induced aliases and side effects. In: Principles of Programming Languages, pp. 232-245 (1993)
- Cocke, J.: Global common subexpression elimination. In: Proceedings of a Sympo- sium on Compiler Optimization, pp. 20-24. ACM, New York (1970)
- Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Efficiently computing static single assignment form and the control dependence graph. ACM Trans. Program. Lang. Syst. 13(4), 451-490 (1991)
- Das, A., Lahiri, S.K., Lal, A., Li, Y.: Angelic verification: precise verification mod- ulo unknowns. In: Kroening, D., Pȃsȃreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9206, pp. 324-342. Springer, Cham (2015). doi:10.1007/978-3-319-21690-4 19
- Das, A., Lal, A.: Precise null pointer analysis through global value numbering. CoRR abs/1702.05807 (2017). http://arxiv.org/abs/1702.05807
- De, A., D'Souza, D.: Scalable flow-sensitive pointer analysis for java with strong updates. In: Noble, J. (ed.) ECOOP 2012. LNCS, vol. 7313, pp. 665-687. Springer, Heidelberg (2012). doi:10.1007/978-3-642-31057-7 29
- Fink, S.J., Yahav, E., Dor, N., Ramalingam, G., Geay, E.: Effective typestate verification in the presence of aliasing. ACM Trans. Softw. Eng. Methodol. 17(2), 9:1-9:34 (2008)
- Gulwani, S., Necula, G.C.: Global value numbering using random interpretation. In: Principles of Programming Languages, POPL, pp. 342-352 (2004)
- Hardekopf, B., Lin, C.: Flow-sensitive pointer analysis for millions of lines of code. In: Code Generation and Optimization (CGO), pp. 289-298 (2011)
- Hasti, R., Horwitz, S.: Using static single assignment form to improve flow- insensitive pointer analysis. In: Programming Language Design and Implemen- tation (PLDI), pp. 97-105 (1998)
- Heintze, N., Tardieu, O.: Demand-driven pointer analysis. In: Programming Lan- guage Design and Implementation (PLDI), pp. 24-34 (2001)
- Horwitz, S.: Precise flow-insensitive may-alias analysis is NP-Hard. ACM Trans. Program. Lang. Syst. 19(1), 1-6 (1997)
- Jones, N.D., Muchnick, S.S.: A flexible approach to interprocedural data flow analy- sis and programs with recursive data structures. In: Principles of Programming Languages (POPL), pp. 66-74 (1982)
- Kildall, G.A.: A unified approach to global program optimization. In: Principles of Programming Languages, pp. 194-206 (1973)
- Lal, A., Qadeer, S.: Powering the static driver verifier using corral. In: Foundations of Software Engineering, pp. 202-212 (2014)
- Landi, W., Ryder, B.G.: A safe approximate algorithm for interprocedural pointer aliasing. SIGPLAN Not. 39(4), 473-489 (2004)
- Leino, K.R.M.: This is boogie 2 (2008). https://github.com/boogie-org/boogie
- Lerch, J., Spth, J., Bodden, E., Mezini, M.: Access-path abstraction: scaling field- sensitive data-flow analysis with unbounded access paths (t). In: Automated Soft- ware Engineering (ASE), pp. 619-629 (2015)
- Lhoták, O., Hendren, L.: Evaluating the benefits of context-sensitive points-to analysis using a bdd-based implementation. ACM Trans. Softw. Eng. Methodol. (TOSEM) 18(1), 3 (2008)
- Microsoft: Static driver verifier. http://msdn.microsoft.com/en-us/library/ windows/hardware/ff552808(v=vs.85).aspx
- Rakamarić, Z., Emmi, M.: SMACK: decoupling source language details from veri- fier implementations. In: Biere, A., Bloem, R. (eds.) CAV 2014. LNCS, vol. 8559, pp. 106-113. Springer, Cham (2014). doi:10.1007/978-3-319-08867-9 7
- Ramalingam, G.: The undecidability of aliasing. ACM Trans. Program. Lang. Syst. 16(5), 1467-1471 (1994)
- Sharir, M., Pnueli, A.: Two approaches to interprocedural data flow analysis, pp. 189-234. Prentice-Hall, Englewood Cliffs, NJ (1981). Chap. 7
- Sridharan, M., Chandra, S., Dolby, J., Fink, S.J., Yahav, E.: Alias analysis for object-oriented programs. In: Clarke, D., Noble, J., Wrigstad, T. (eds.) Aliasing in Object-Oriented Programming. Types, Analysis and Verification. LNCS, vol. 7850, pp. 196-232. Springer, Heidelberg (2013). doi:10.1007/978-3-642-36946-9 8
- Steensgaard, B.: Points-to analysis in almost linear time. In: Principles of Pro- gramming Languages (POPL), pp. 32-41. ACM, New York (1996)
- Whaley, J., Lam, M.S.: An efficient inclusion-based points-to analysis for strictly- typed languages. In: Static Analysis Symposium, pp. 180-195 (2002)
- Zheng, X., Rugina, R.: Demand-driven alias analysis for c. In: Proceedings of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2008, pp. 197-208. ACM, New York (2008)