Skip to main content

An Optimized Memory Monitoring for Runtime Assertion Checking of C Programs

  • Conference paper

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

Abstract

Runtime assertion checking provides a powerful, highly automatizable technique to detect violations of specified program properties. However, monitoring of annotations for pointers and memory locations (such as being valid, initialized, in a particular block, with a particular offset, etc.) is not straightforward and requires systematic instrumentation and monitoring of memory-related operations.

This paper describes the runtime memory monitoring library we developed for execution support of e-acsl, executable specification language for C programs offered by the Frama-C platform for analysis of C code. We present the global architecture of our solution as well as various optimizations we realized to make memory monitoring more efficient. Our experiments confirm the benefits of these optimizations and illustrate the bug detection potential of runtime assertion checking with e-acsl.

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

Buying options

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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Sullivan, M., Chillarege, R.: Software defects and their impact on system availability: A study of field failures in operating systems. In: The 1991 International Symposium on Fault-Tolerant Computing (FTCS 1991), pp. 2–9. IEEE Computer Society (1991)

    Google Scholar 

  2. Clarke, L.A., Rosenblum, D.S.: A historical perspective on runtime assertion checking in software development. ACM SIGSOFT Software Engineering Notes 31(3), 25–37 (2006)

    Article  Google Scholar 

  3. Turing, A.: Checking a large routine. In: The Conference on High Speed Automatic Calculating Machines, pp. 67–69 (1949)

    Google Scholar 

  4. Leucker, M., Schallhart, C.: A brief account of runtime verification. J. Log. Algebr. Program. 78(5), 293–303 (2009)

    Article  MATH  Google Scholar 

  5. Cuoq, P., Kirchner, F., Kosmatov, N., Prevosto, V., Signoles, J., Yakobowski, B.: Frama-C: A program analysis perspective. In: Eleftherakis, G., Hinchey, M., Holcombe, M. (eds.) SEFM 2012. LNCS, vol. 7504, pp. 233–247. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  6. Delahaye, M., Kosmatov, N., Signoles, J.: Common specification language for static and dynamic analysis of C programs. In: The 28th Annual ACM Symposium on Applied Computing (SAC 2013), pp. 1230–1235. ACM (2013)

    Google Scholar 

  7. Kosmatov, N., Signoles, J.: A lesson on runtime assertion checking with Frama-C. In: Bensalem, S., Legay, A. (eds.) RV 2013. LNCS, vol. 8174, Springer, Heidelberg (2013)

    Google Scholar 

  8. Szpankowski, W.: Patricia tries again revisited. J. ACM 37(4), 691–711 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  9. Signoles, J.: E-ACSL: Executable ANSI/ISO C Specification Language (January 2012), http://frama-c.com/download/e-acsl/e-acsl.pdf

  10. Baudin, P., Filliâtre, J.C., Hubert, T., Marché, C., Monate, B., Moy, Y., Prevosto, V.: ACSL: ANSI/ISO C Specification Language, v1.6 (April 2013), http://frama-c.com/acsl.html

  11. Baudin, P., Pacalet, A., Raguideau, J., Schoen, D., Williams, N.: CAVEAT: a tool for software validation. In: The 2002 International Conference on Dependable Systems and Networks (DSN 2002), p. 537. IEEE Computer Society (2002)

    Google Scholar 

  12. Filliâtre, J.-C., Marché, C.: The why/Krakatoa/Caduceus platform for deductive program verification. In: Damm, W., Hermanns, H. (eds.) CAV 2007. LNCS, vol. 4590, pp. 173–177. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  13. Cheon, Y.: A Runtime Assertion Checker for the Java Modeling Language, Iowa State Univ. (2003), http://cs.iastate.edu/~leavens/JML/Relatedpapers/index.html

  14. Meyer, B.: Object-Oriented Software Construction. Prentice-Hall, Inc. (1988)

    Google Scholar 

  15. ISO/IEC 9899:1999: Programming languages – C

    Google Scholar 

  16. Jones, R.W.M., Kelly, P.H.J.: Backwards-compatible bounds checking for arrays and pointers in c programs. In: The Third International Workshop on Automatic Debugging (AADEBUG 1997), pp. 13–26 (1997)

    Google Scholar 

  17. Nethercote, N., Seward, J.: How to shadow every byte of memory used by a program. In: The 3rd International Conference on Virtual Execution Environments (VEE 2007), pp. 65–74. ACM (2007)

    Google Scholar 

  18. Botella, B., Delahaye, M., Hong-Tuan-Ha, S., Kosmatov, N., Mouy, P., Roger, M., Williams, N.: Automating structural testing of C programs: Experience with PathCrawler. In: The 4th Int. Workshop on Automation of Software Test (AST 2009), pp. 70–78. IEEE Computer Society (2009)

    Google Scholar 

  19. Leavens, G.T., Cheon, Y., Clifton, C., Ruby, C., Cok, D.R.: How the design of JML accommodates both runtime assertion checking and formal verification. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2002. LNCS, vol. 2852, pp. 262–284. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  20. Comar, C., Kanig, J., Moy, Y.: Integrating formal program verification with testing. In: The Embedded Real-Time Software and Systems Congress, ERTS 2012 (2012)

    Google Scholar 

  21. Ruwase, O., Lam, M.S.: A practical dynamic buffer overflow detector. In: The 11th Annual Network and Distributed System Security Symposium (NDSS 2004), pp. 159–169 (2004)

    Google Scholar 

  22. Xu, W., DuVarney, D.C., Sekar, R.: An efficient and backwards-compatible transformation to ensure memory safety of C programs. In: FSE 2004, pp. 117–126. ACM (2004)

    Google Scholar 

  23. Dhurjati, D., Adve, V.S.: Backwards-compatible array bounds checking for C with very low overhead. In: The 28th International Conference on Software Engineering (ICSE 2006), pp. 162–171 (2006)

    Google Scholar 

  24. Akritidis, P., Costa, M., Castro, M., Hand, S.: Baggy bounds checking: An efficient and backwards-compatible defense against out-of-bounds errors. In: The 18th USENIX Security Symposium (USENIX 2009), pp. 51–66. USENIX Association (2009)

    Google Scholar 

  25. Simpson, M.S., Barua, R.: MemSafe: ensuring the spatial and temporal memory safety of C at runtime. Softw., Pract. Exper. 43(1), 93–128 (2013)

    Article  Google Scholar 

  26. Austin, T.M., Breach, S.E., Sohi, G.S.: Efficient detection of all pointer and array access errors. In: The ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation (PLDI 1994), pp. 290–301. ACM (1994)

    Google Scholar 

  27. Necula, G.C., Condit, J., Harren, M., McPeak, S., Weimer, W.: CCured: type-safe retrofitting of legacy software. ACM Trans. Program. Lang. Syst. 27(3), 477–526 (2005)

    Article  Google Scholar 

  28. Oiwa, Y.: Implementation of the memory-safe full ANSI-C compiler. In: The 2009 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2009), pp. 259–269. ACM (2009)

    Google Scholar 

  29. Yuan, J., Johnson, R.: CAWDOR: compiler assisted worm defense. In: The 12th IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM 2012), pp. 54–63. IEEE Computer Society (2012)

    Google Scholar 

  30. Serebryany, K., Bruening, D., Potapenko, A., Vyukov, D.: AddressSanitizer: a fast address sanity checker. In: The 2012 USENIX Annual Technical Conference (USENIX ATC 2012), pp. 309–318. USENIX Association (2012)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Kosmatov, N., Petiot, G., Signoles, J. (2013). An Optimized Memory Monitoring for Runtime Assertion Checking of C Programs. In: Legay, A., Bensalem, S. (eds) Runtime Verification. RV 2013. Lecture Notes in Computer Science, vol 8174. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-40787-1_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-40787-1_10

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-40786-4

  • Online ISBN: 978-3-642-40787-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics