Skip to main content

Interprocedural Exception Analysis for C++

  • Conference paper
ECOOP 2011 – Object-Oriented Programming (ECOOP 2011)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6813))

Included in the following conference series:

Abstract

C++ Exceptions provide a useful way for dealing with abnormal program behavior, but often lead to irregular interprocedural control flow that complicates compiler optimizations and static analysis. In this paper, we present an interprocedural exception analysis and transformation framework for C++ that captures the control-flow induced by exceptions and transforms it into an exception-free program that is amenable for precise static analysis. Control-flow induced by exceptions is captured in a modular interprocedural exception control-flow graph (IECFG). The IECFG is further refined using a novel interprocedural dataflow analysis algorithm based on a compact representation for a set of types called the Signed-TypeSet domain. The results of the interprocedural analysis are used by a lowering transformation to generate an exception-free C++ program. The lowering transformations do not affect the precision and accuracy of any subsequent program analysis. Our framework handles all the features of synchronous C++ exception handling and all exception sub-typing rules from the C++0x standard. We demonstrate two applications of our framework: (a) automatic inference of exception specifications for C++ functions for documentation, and (b) checking the “no-throw” and “no-leak” exception-safety properties.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bravenboer, M., Smaragdakis, Y.: Exception analysis and points-to analysis: Better together. In: International Symposium on Software Testing and Analysis (ISSTA), pp. 1–12. ACM, New York (2009)

    Google Scholar 

  2. Buse, R.P., Weimer, W.R.: Automatic documentation inference for exceptions. In: ISSTA, pp. 273–282. ACM, New York (2008)

    Chapter  Google Scholar 

  3. Chang, B.-M., Jo, J.-W., Yi, K., Choe, K.-M.: Interprocedural exception analysis for Java. In: Proc. of Symp. on Applied Computing, pp. 620–625 (2001)

    Google Scholar 

  4. Dean, J., Grove, D., Chambers, C.: Optimization of object-oriented programs using static class hierarchy analysis. In: Olthoff, W. (ed.) ECOOP 1995. LNCS, vol. 952, pp. 77–101. Springer, Heidelberg (1995)

    Google Scholar 

  5. Fu, C., Ryder, B.: Exception-chain analysis: Revealing exception handling architecture in Java server applications. In: ICSE, pp. 230–239 (May 2007)

    Google Scholar 

  6. Gherghina, C., David, C.: A specification logic for exceptions and beyond. In: Bouajjani, A., Chin, W.-N. (eds.) ATVA 2010. LNCS, vol. 6252, pp. 173–187. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  7. Ivančić, F., Shlyakhter, I., Gupta, A., Ganai, M., Kahlon, V., Wang, C., Yang, Z.: Model checking C programs using F-Soft. In: IEEE International Conference on Computer Design, pp. 297–308 (October 2005)

    Google Scholar 

  8. Jo, J.-W., Chang, B.-M.: Constructing Control Flow Graph for Java by Decoupling Exception Flow from Normal Flow. In: Laganá, A., Gavrilova, M.L., Kumar, V., Mun, Y., Tan, C.J.K., Gervasi, O. (eds.) ICCSA 2004. LNCS, vol. 3043, pp. 106–113. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  9. Jo, J.-W., Chang, B.-M., Yi, K., Choe, K.-M.: An uncaught exception analysis for Java. Journal of Systems and Software 72(1), 59–69 (2004)

    Article  Google Scholar 

  10. Lattner, C., Adve, V.: LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In: International Symposium on Code Generation and Optimization (CGO), Palo Alto, California (March 2004)

    Google Scholar 

  11. Li, X., Hoover, H., Rudnicki, P.: Towards automatic exception safety verification. In: Proc. of Formal Methods, pp. 396–411. Springer, Heidelberg (2006)

    Google Scholar 

  12. Mao, C.-Y., Lu, Y.-S.: Improving the robustness and reliability of object-oriented programs through exception analysis and testing. In: IEEE International Conference on Engineering of Complex Computer Systems, vol. 0, pp. 432–439 (2005)

    Google Scholar 

  13. NECLA verification benchmarks, http://www.nec-labs.com/research/system/systems_SAV-website/benchmarks.php

  14. Necula, G.C., McPeak, S., Rahul, S.P., Weimer, W.: CIL: Intermediate language and tools for analysis and transformation of C programs. In: Int. Conf. on Comp. Construct, pp. 213–228. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  15. Robillard, M.P., Murphy, G.C.: Static analysis to support the evolution of exception structure in object-oriented systems. ACM Transactions on Software Engineering Methodologies 12(2), 191–221 (2003)

    Article  Google Scholar 

  16. Sinha, S., Harrold, M.J.: Analysis and testing of programs with exception handling constructs. IEEE Trans. on Software Engineering 26, 849–871 (2000)

    Article  Google Scholar 

  17. C.standards commitee. Working draft, standard for programming language C++ (2010), http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3126.pdf (accessed September 26, 2010)

  18. Stroustrup, B.: Exception safety: Concepts and techniques. In: Romanovsky, A., Cheraghchi, H.S., Lee, S.H., Babu, C. S. (eds.) ECOOP-WS 2000. LNCS, vol. 2022, pp. 60–76. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  19. Torlak, E., Chandra, S.: Effective interprocedural resource leak detection. In: Int. Conf. on Softw. Eng., pp. 535–544. ACM, New York (2010)

    Google Scholar 

  20. Weimer, W., Necula, G.C.: Exceptional situations and program reliability. ACM Trans. Programming Languauges and Systems 30(2), 1–51 (2008)

    Article  Google Scholar 

  21. Weiss, M.A.: Data Structures and Algorithm Analysis in C++. Addison-Wesley Longman Publishing Co., Inc., Boston (1998)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Prabhu, P., Maeda, N., Balakrishnan, G., Ivančić, F., Gupta, A. (2011). Interprocedural Exception Analysis for C++. In: Mezini, M. (eds) ECOOP 2011 – Object-Oriented Programming. ECOOP 2011. Lecture Notes in Computer Science, vol 6813. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-22655-7_27

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-22655-7_27

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-22654-0

  • Online ISBN: 978-3-642-22655-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics