Skip to main content

Automatic Bug Detection in Microcontroller Software by Static Program Analysis

  • Conference paper
SOFSEM 2009: Theory and Practice of Computer Science (SOFSEM 2009)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5404))

Abstract

Microcontroller software typically consists of a few hundred lines of code only, but it is rather different from standard application code. The software is highly hardware and platform specific, and bugs are often a consequence of neglecting subtle specifications of the microcontroller architecture. Currently, there are hardly any tools for analyzing such software automatically. In this paper, we outline specifics of microcontroller software that explain why those programs are different to standard C/C++ code. We develop a static program analysis for a specific microcontroller, in our case the ATmega16, to spot code deficiencies, and integrate it into our generic static analyzer Goanna. Finally, we illustrate the results by a case study of an automotive application. The case study highlights that – even without formal proof – the proposed static techniques can be valuable in pinpointing software bugs that are otherwise hard to find.

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 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.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. Clarke, E., Kröning, D., Lerda, F.: A Tool for Checking ANSI-C Programs. In: Jensen, K., Podelski, A. (eds.) TACAS 2004. LNCS, vol. 2988, pp. 168–176. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  2. Clarke, E., Kröning, D., Sharygina, N., Yorav, K.: SATABS: SAT-based predicate abstraction for ANSI-C. In: Halbwachs, N., Zuck, L.D. (eds.) TACAS 2005. LNCS, vol. 3440, pp. 570–574. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  3. Henzinger, T., Jhala, R., Majumdar, R., Sutre, G.: Software verification with BLAST. In: Ball, T., Rajamani, S.K. (eds.) SPIN 2003. LNCS, vol. 2648, pp. 235–239. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  4. Coverity: Prevent for C and C++, http://www.coverity.com

  5. Gimpel Software: Flexelint for C/C++, http://www.gimpel.com/html/flex.htm

  6. Klocwork: K7, http://www.klocwork.com/products/klocworkk7.asp

  7. Microsoft: Prefast, http://www.microsoft.com/whdc/devtools/tools/PREfast.mspx

  8. Emanuelsson, P., Nilsson, U.: A comparative study of industrial static analysis tools. In: SSV 2008. ENTCS, vol. 127 (2008)

    Google Scholar 

  9. Schlich, B., Kowalewski, S.: Model checking C source code for embedded systems. In: Proc. of the IEEE/NASA Workshop on Leveraging Applications of Formal Methods, Verification, and Validation, NASA/CP-2005-212788 (September 2005)

    Google Scholar 

  10. Fehnker, A., Huuck, R., Jayet, P., Lussenburg, M., Rauch, F.: Model checking software at compile time. In: TASE 2007. IEEE Computer Society Press, Los Alamitos (2007)

    Google Scholar 

  11. Schlich, B.: Model Checking of Software for Microcontrollers. Dissertation thesis, RWTH Aachen University (2008)

    Google Scholar 

  12. Dams, D., Namjoshi, K.: Orion: High-precision methods for static error analysis of C and C++ programs. Bell Labs Tech. Mem. ITD-04-45263Z, Lucent Technologies (2004)

    Google Scholar 

  13. Holzmann, G.J.: Static source code checking for user-defined properties. In: IDPT 2002, Pasadena, CA, USA (June 2002)

    Google Scholar 

  14. Schmidt, D.A., Steffen, B.: Program analysis as model checking of abstract interpretations. In: Levi, G. (ed.) SAS 1998. LNCS, vol. 1503, pp. 351–380. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  15. Cimatti, A., Clarke, E., Giunchiglia, E., Giunchiglia, F., Pistore, M., Roveri, M., Sebastiani, R., Tacchella, A.: NuSMV Version 2. In: Brinksma, E., Larsen, K.G. (eds.) CAV 2002. LNCS, vol. 2404, p. 359. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  16. Salewski, F., Wilking, D., Kowalewski, S.: Diverse hardware platforms in embedded systems lab courses: a way to teach the differences. ACM SIGBED Review 2(4) (2005)

    Google Scholar 

  17. Schlich, B., Salewski, F., Kowalewski, S.: Applying model checking to an automotive microcontroller application. In: SIES 2007. IEEE, Los Alamitos (2007)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Fehnker, A., Huuck, R., Schlich, B., Tapp, M. (2009). Automatic Bug Detection in Microcontroller Software by Static Program Analysis. In: Nielsen, M., Kučera, A., Miltersen, P.B., Palamidessi, C., Tůma, P., Valencia, F. (eds) SOFSEM 2009: Theory and Practice of Computer Science. SOFSEM 2009. Lecture Notes in Computer Science, vol 5404. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-95891-8_26

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-95891-8_26

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-95890-1

  • Online ISBN: 978-3-540-95891-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics