Random Testing of C Calling Conventions
by
Christian Lindig
Jong Deok Choi, Raimondas Lencevicius (Ed.), Sixth International Symposium on Automated and Analysis-Driven Debugging (AADEBUG), Pages 3-11, ACM Press, September 2005.
Abstract
In a C compiler, function calls are difficult to implement correctly because they must respect a platform-specific calling convention. But they are governed by a simple invariant: parameters passed to a function must be received unaltered. A violation of this invariant signals an inconsistency in a compiler. We automatically test the consistency of C compilers using randomly generated programs. An inconsistency manifests itself as an assertion failure when compiling and running the generated code. The generation of programs is type-directed and can be controlled by the user with composable random generators in about 100 lines of Lua. Lua is a scripting language built into our testing tool that drives program generation. Random testing is fully automatic, requires no specification, yet is comparable in effectiveness with specification-based testing from prior work. Using this method, we uncovered 13 new bugs in mature open-source and commercial C compilers.
BibTeX Entry
@inproceedings{lindig-aadebug-2005, title = "Random Testing of C Calling Conventions", author = "Christian Lindig", year = "2005", month = sep, booktitle = "Sixth International Symposium on Automated and Analysis-Driven Debugging (AADEBUG)", editors = "Jong Deok Choi and Raimondas Lencevicius", location = "Monterey, CA, USA", pages = "3--11", publisher = "ACM Press", }