Abstract
Many important software systems are written in the C programming language. Unfortunately, the C language does not provide strong safety guarantees, and many common programming mistakes introduce type errors that are not caught by the compiler. These errors only manifest themselves at run time through unexpected program behavior, and it is often hard to isolate and identify their causes. This paper presents the Hobbes run-time type checker for compiled C programs. Our tool interprets compiled binaries, tracks type information for all memory and register locations, and reports warnings when a variety of type errors occur. Because the Hobbes type checker does not rely on source code, it is effective in many situations where similar tools are not, such as when full source code is not available or when C source is linked with program fragments written in assembly or other languages.
This work was performed, in part, while all 3 authors were employed at the Compaq Systems Research Center (now part of HP Labs).
Chapter PDF
References
T. M. Austin, S. E. Breach, and G. S. Sohi. Efficient detection of all pointer and array access errors. In Proceedings of the Conference on Programming Language Design and Implementation, pages 290–301, 1994.
S. Chandra and T. W. Reps. Physical type checking for C. In Workshop on Program Analysis For Software Tools and Engineering, pages 66–75, 1999.
R. Hasting and B. Joyce. Purify: Fast detection of memory leaks and access errors. In Proceedings of the Winter Usenix Conference, 1992.
R. W. M. Jones and P. H. J. Kelly. Backwards-compatible bounds checking for arrays and pointers in C programs. In Proceedings of the Third International Workshop on Automated Debugging, pages 13–26. Linkoping University Electronic Press, 1997.
S. Kaufer, R. Lopez, and S. Pratap. Saber-C: an interpreterbased programming environment for the C language. In Proceedings of the Summer Usenix Conference, pages 161–171, 1988.
S. C. Kendall. Bcc: run-time checking for C programs. In Proceedings of the Usenix Summer Conference, 1983.
A. Loginov, S. H. Yong, S. Horwitz, and T. Reps. Debugging via run-time type checking. In Proceedings of the Conference on Fundamental Approaches to Software Engineering, pages 217–232, 2001.
J. G. Morrisett, K. Crary, N. Glew, and D. Walker. Stack-based typed assembly language. In Types in Compilation, pages 280–52, 1998.
A. Mycroft. Type-based decompilation. In Proceedings of the European Symposium of Programming, pages 208–223, 1999.
G. C. Necula, S. McPeak, and W. Weimer. CCured: type-safe retrofitting of legacy code. In Proceedings of the Symposium on Principles of Programming Languages, pages 128–139, 2002.
H. Patil and C. Fischer. Low-cost, concurrent checking of pointer and array accesses in c programs. Software-Practice and Experience, 27(1):87–110, January 1997.
J. Seward. Valgrind, an open-source memory debugger for x86-GNU/Linux, August 2002. Available from http://developer.kde.org/~sewardj/.
M. Si., S. Chandra, T. Ball, K. Kunchithapadam, and T. W. Reps. Coping with type casts in C. In Proceedings of ESEC/FSE’ 99, pages 180–198, 1999.
A. Srivastava and A. Eustace. ATOM: A system for building customized program analysis tools. In Proceedings of the Conference on Programming Language Design and Implementation, pages 196–205, 1994.
J. L. Steffen. Adding run-time checking to the portable C compiler. Software-Practice and Experience, 22(4):305–316, 1992.
Z. Xu, T. Reps, and B. P. Miller. Typestate checking of machine code. In Proceedings of the European Symposium of Programming, pages 335–351, 2001.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Burrows, M., Freund, S.N., Wiener, J.L. (2003). Run-Time Type Checking for Binary Programs. In: Hedin, G. (eds) Compiler Construction. CC 2003. Lecture Notes in Computer Science, vol 2622. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-36579-6_7
Download citation
DOI: https://doi.org/10.1007/3-540-36579-6_7
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-00904-7
Online ISBN: 978-3-540-36579-2
eBook Packages: Springer Book Archive