Detecting Compilation Errors in Busybox Configurations

Christian Kästner christian.kaestner at uni-marburg.de
Thu Apr 19 17:24:58 UTC 2012


Hi,


In a research setting, I've been working on a tool TypeChef that can
detect compilation errors over all compile-time configurations of a
software. The tool is intended as a lint-like of tool that reports
compilation errors and the configurations in occurs in. Essentially it
predicts with which preprocessor flags the code will not compile.

Among others, we have experimented with that tool on Busybox. In the
current code base, we find the two following problems:

* networking/httpd.c won't compile in configurations with CONFIG_HTTPD
and CONFIG_FEATURE_HTTPD_BASIC_AUTH, without
CONFIG_FEATURE_HTTPD_AUTH_MD5 and with CONFIG_PAM (struct pam_userinfo
not defined)

* shell/hush.c won't compile in configurations with CONFIG_HUSH and
CONFIG_FEATURE_EDITING_SAVE_ON_EXIT but without CONFIG_HUSH_INTERACTIVE
and without CONFIG_FEATURE_EDITING (field line_input_state unknown in
globals)



My question is to what degree you as community are interested in such
feedback? Unfortunately, we don't have the capacity to investigate and
submit actual patches every time we could identify a problem. Would it
be still helpful to send just (automatic) error reports, similar to the
ones above? What kind of channels should we use? Would you be interested
in using such tool yourself?

Currently the tool is somewhat difficult to setup and use -- because we
needed to reverse engineer KConfig and KBuild and because it's a
research prototype that produces quite some noise in the output. It
still evolves quite frequently and there are probably quite some bugs.
We are planning to support incremental checking after every commit and
improve the output, but we are not there yet.
TypeChef is available as open source here:
https://github.com/ckaestne/TypeChef

Finally, we were surprised that we found essentially no compile-time
problems despite the large configuration space (we have found no
compilation errors in released code). Do you have a process to prevent
or detect those kinds of problems for releases, such as randomized testing?



Best regards,
Christian




More information about the busybox mailing list