Revealing and repairing configuration inconsistencies in large-scale system software

  • Reinhard Tartler
  • Julio Sincero
  • Christian Dietrich
  • Wolfgang Schröder-Preikschat
  • Daniel Lohmann
SW-Diversity

Abstract

System software typically offers a large amount of compile-time options and variability. A good example is the Linux kernel, which provides more than 10,000 configurable features, growing rapidly. This allows users to tailor it with respect to a broad range of supported hardware architectures and application domains. From the maintenance point of view, compile-time configurability poses big challenges. The configuration model (the selectable features and their constraints as presented to the user) and the configurability that is actually implemented in the code have to be kept in sync, which, if performed manually, is a tedious and error-prone task. In the case of Linux, this has led to numerous defects in the source code, many of which are actual bugs. In order to ensure consistency between the variability expressed in the code and the configuration models, we propose an approach that extracts variability from both into propositional logic. This reveals inconsistencies between variability as expressed by the C Preprocessor (CPP) and an explicit variability model, which manifest themselves in seemingly conditional code that is in fact unconditional. We evaluate our approach with the Linux, for which our tool detects 1,766 configurability defects, which turned out as dead/superfluous source code and bugs. Our findings have led to numerous source-code improvements and bug fixes in Linux: 123 patches (49 merged) fix 364 defects, 147 of which have been confirmed by the corresponding Linux developers and 20 as fixing a previously unknown bug.

Keywords

Experimentation Management Configurability Maintenance Linux Static analysis 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Badros G.J., Notkin D.: A framework for preprocessor-aware C source code analyses. Softw. Practice Experience 30(8), 907–924 (2000)CrossRefGoogle Scholar
  2. 2.
    Batory, D.: Feature-oriented programming and the AHEAD tool suite. In: Proceedings of the 26th International Conference on Software Engineering (ICSE ’04), pp. 702–703. IEEE Computer Society Press, Los Alamitos (2004)Google Scholar
  3. 3.
    Baxter, I.D.: DMS: program transformations for practical scalable software evolution. In: Proceedings of the 5th International Workshop on Principles of Software Evolution (IWPSE’02), pp. 48–51. ACM Press, New York (2002)Google Scholar
  4. 4.
    Baxter, I.D., Mehlich, M.: Preprocessor conditional removal by simple partial evaluation. In: Proceedings of the 8th Working Conference on Reverse Engineering (WCRE ’01), p. 281. IEEE Computer Society Press, Los Alamitos (2001)Google Scholar
  5. 5.
    Benavides, D., Ruiz-Cortés, A., Trinidad, P.: Automated reasoning on feature models. In: Proceedings of the 17th International Conference on Advanced Information Systems Engineering (CAISE ’05), vol. 3520, pp. 491–503. Springer, Heidelberg (2005)Google Scholar
  6. 6.
    Berger, T., She, S.: Formal semantics of the CDL language. Technical note, University of Leipzig (2010)Google Scholar
  7. 7.
    Berger, T., She, S., Czarnecki, K., Wasowski A.: Feature-to-code mapping in two large product lines. Technical report, University of Leipzig (Germany), University of Waterloo (Canada), IT University of Copenhagen (Denmark) (2010)Google Scholar
  8. 8.
    Beuche, D., Guerrouat, A., Papajewski, H., Schröder-Preikschat, W., Spinczyk, O., Spinczyk, U.: The PURE family of object-oriented operating systems for deeply embedded systems. In: Proceedings of the 2nd IEEE International Symposium on Object-Oriented Real-Time Distributed Computing (ISORC ’99), pp. 45–53. IEEE Computer Society Press, California (1999)Google Scholar
  9. 9.
    Cadar, C., Dunbar, D., Engler, D.: KLEE: unassisted and automatic generation of high-coverage tests for complex systems programs. In: 8th Symposium on Operating System Design and Implementation (OSDI ’08). USENIX Association (2008)Google Scholar
  10. 10.
    Campbell R., Islam N., Madany P., Raila D.: Designing and implementing choices: an object-oriented system in C++. Commun. ACM 36(9), 117–126 (1993). doi:10.1145/162685.162717 CrossRefGoogle Scholar
  11. 11.
    Chou, A., Yang, J., Chelf, B., Hallem, S., Engler, D.: An empirical study of operating systems errors. In: Proceedings of the 18th ACM Symposium on Operating Systems Principles (SOSP’01), pp. 73–88. ACM Press, New York (2001)Google Scholar
  12. 12.
    Coady, Y., Kiczales, G.: Back to the future: a retroactive study of aspect evolution in operating system code. In: Mehmet, A. (ed) Proceedings of the 2nd International Conference on Aspect-Oriented Software Development (AOSD’03), pp. 50–59, Boston (2003)Google Scholar
  13. 13.
    Czarnecki K., Eisenecker U.W.: Generative Programming. Methods, Tools and Applications. Addison-Wesley, Boston (2000)Google Scholar
  14. 14.
    Czarnecki, K., Pietroszek, K.: Verifying feature-based model templates against well-formedness OCL constraints. In: Proceedings of the 6th International Conference on Generative Programming and Component Engineering (GPCE’06), pp. 211–220. ACM Press, New York (2006)Google Scholar
  15. 15.
    Czarnecki, K., Wasowski, A.: Feature diagrams and logics: There and back again. In: Proceedings of the 11th Software Product Line Conference (SPLC’07), pp. 23–34. IEEE Computer Society Press, California (2007)Google Scholar
  16. 16.
    Engler, D., Chen, D.Y., Hallem, S., Chou, A., Chelf, B.: Bugs as deviant behavior: a general approach to inferring errors in systems code. In: Proceedings of the 18th ACM Symposium on Operating Systems Principles (SOSP’01), pp. 57–72. ACM Press, New York (2001)Google Scholar
  17. 17.
    Ernst, M.D., Czeisler, A., Griswold, W.G., Notkin, D.: Quickly detecting relevant program invariants. In: Proceedings of the 22nd International Conference on Software Engineering (ICSE’00), pp. 449–458. ACM Press, New York (2000)Google Scholar
  18. 18.
    Fassino, J.-P., Stefani, J.-B., Lawall, J., Muller, G.: THINK: a software framework for component-based operating system kernels. In: Proceedings of the 2002 USENIX Annual Technical Conference, pp. 73–86. USENIX Association (2002)Google Scholar
  19. 19.
    Garrido, A.: Program refactoring in the presence of preprocessor directives. PhD thesis, University of Illinois at Urbana-Champaign, Champaign, IL, USA, 2005. Adviser-Johnson, RalphGoogle Scholar
  20. 20.
    Guo, P.J., Engler, D.: Linux kernel developer responses to static analysis bug reports. In: Proceedings of the 2009 USENIX Annual Technical Conference. USENIX Association (2009)Google Scholar
  21. 21.
    Hu, Y., Merlo, E., Dagenais, M., Lagüe, B.: C/C++ conditional compilation analysis using symbolic execution. In: Proceedings of the 16th IEEE International Conference on Software Maintainance (ICSM’00), pp. 196. IEEE Computer Society Press, California (2000)Google Scholar
  22. 22.
    Jones N.D., Gomard C.K., Sestoft P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, Inc, Upper Saddle River (1993)MATHGoogle Scholar
  23. 23.
    Kästner, C., Giarrusso, P.G., Rendel, T., Erdweg, S., Ostermann, K., Berger, T.: Variability-aware parsing in the presence of lexical macros and conditional compilation. In: Proceedings of the 26th ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA’11). ACM Press, New York (2011)Google Scholar
  24. 24.
    Kremenek, T., Twohey, P., Back, G., Ng, A., Engler, D.: From uncertainty to belief: inferring the specification within. In: 7th Symposium on Operating System Design and Implementation (OSDI’06), pp. 161–176. USENIX Association (2006)Google Scholar
  25. 25.
    Latendresse, M.: Rewrite systems for symbolic evaluation of c-like preprocessing. In: CSMR ’04: Proceedings of the Eighth Euromicro Working Conference on Software Maintenance and Reengineering (CSMR’04), p. 165. IEEE Computer Society Press, California (2004)Google Scholar
  26. 26.
    Li, Z., Zhou, Y.: PR-miner: automatically extracting implicit programming rules and detecting violations in large software code. In: Proceedings of the 10th European Software Engineering Conference and the 13th ACM Symposium on the Foundations of Software Engineering (ESEC/FSE’00), pp. 306–315. ACM Press, New York (2005)Google Scholar
  27. 27.
    Liebig, J., Apel, S., Lengauer, C., Kästner, C., Schulze, M.: An analysis of the variability in forty preprocessor-based software product lines. In: Proceedings of the 32nd International Conference on Software Engineering (ICSE ’10). ACM Press, New York (2010)Google Scholar
  28. 28.
    Lohmann, D., Hofer, W., Schröder-Preikschat, W., Streicher, J., Spinczyk, O.: CiAO: An aspect-oriented operating-system family for resource-constrained embedded systems. In: Proceedings of the 2009 USENIX Annual Technical Conference, pp. 215–228. USENIX Association (2009)Google Scholar
  29. 29.
    Lohmann, D., Scheler, F., Tartler, R., Spinczyk, O., Schröder-Preikschat, W.: A quantitative analysis of aspects in the eCos kernel. In: Proceedings of the ACM SIGOPS/EuroSys European Conference on Computer Systems 2006 (EuroSys’06), pp. 191–204. ACM Press, New York (2006)Google Scholar
  30. 30.
    Massa A.: Embedded Software Development with eCos. New Riders, Indianapolis (2002)Google Scholar
  31. 31.
    Metzger, A., Heymans, P., Pohl, K., Schobbens, P.-Y., Saval, G.: Disambiguating the documentation of variability in software product lines. In: Proceedings of the 15th IEEE International Conference on Requirements Engineering (RE’07), pp. 243–253. IEEE Computer Society, California (2007)Google Scholar
  32. 32.
    Padioleau, Y., Lawall, J.L., Muller, G., Hansen, R.R.: Documenting and automating collateral evolutions in Linux device drivers. In: Proceedings of the ACM SIGOPS/EuroSys European Conference on Computer Systems 2008 (EuroSys’08). ACM Press, California (2008)Google Scholar
  33. 33.
    Palix, N., Lawall, J., Muller, G.: Tracking code patterns over multiple software versions with Herodotos. In: Proceedings of the 9th International Conference on Aspect-Oriented Software Development (AOSD’10), pp. 169–180. ACM Press, New York (2010)Google Scholar
  34. 34.
    Palix, N., Thomas, G., Saha, S., Calvès, C., Lawall, J.L., Muller, G.: Faults in Linux: ten years later. In: Proceedings of the 16th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS’11), pp. 305–318. ACM Press, New York (2011)Google Scholar
  35. 35.
    Parnas D.L.: Designing software for ease of extension and contraction. IEEE Trans. Softw. Eng. SE-5(2), 128–138 (1979)CrossRefGoogle Scholar
  36. 36.
    Pohl K., Böckle G., van der Linden F.J.: Software Product Line Engineering: Foundations, Principles and Techniques. Springer, Berlin (2005)MATHGoogle Scholar
  37. 37.
    Reid, A., Flatt, M., Stoller, L., Lepreau, J., Eide, E.: Knit: component composition for systems software. In: 4th Symposium on Operating System Design and Implementation (OSDI’00), pp. 347–360. USENIX Association (2000)Google Scholar
  38. 38.
    She, S., Lotufo, R., Berger, T., Wasowski, A., Czarnecki, K.: Reverse engineering feature models. In: Proceedings of the 33nd International Conference on Software Engineering (ICSE’11). ACM Press, New York (2011)Google Scholar
  39. 39.
    Sincero, J., Schröder-Preikschat, W.: The Linux kernel configurator as a feature modeling tool. In: Thiel, S., Pohl, K. (eds.) Proceedings of the 12th Software Product Line Conference (SPLC ’08), Second Volume, pp. 257–260. Lero Int. Science Centre, University of Limerick, Ireland (2008)Google Scholar
  40. 40.
    Sincero, J., Tartler, R., Lohmann, D., Schröder-Preikschat, W.: Efficient extraction and analysis of preprocessor-based variability. In: Proceedings of the 9th International Conference on Generative Programming and Component Engineering (GPCE ’10). ACM Press, New York (2010)Google Scholar
  41. 41.
    Spencer, H., Collyer, G.: #ifdef considered harmful, or portability experience with C News. In: Proceedings of the 1992 USENIX Annual Technical Conference. USENIX Association (1992)Google Scholar
  42. 42.
    Spinellis, D.: A tale of four kernels. In: Wilhem, S., Dwyer, M.B., Gruhn, V. (eds.) Proceedings of the 30th International Conference on Software Engineering (ICSE ’08), pp. 381–390. ACM Press, New York (2008)Google Scholar
  43. 43.
    Tan, L., Yuan, D., Krishna, G., Zhou, Y.: /*icomment: Bugs or bad comments?*/. In: Proceedings of the 21st ACM Symposium on Operating Systems Principles (SOSP’07), pp. 145–158. ACM Press, New York (2007)Google Scholar
  44. 44.
    Tartler, R., Lohmann, D., Sincero, J., Schröder-Preikschat, W.: Feature consistency in compile-time-configurable system software: facing the Linux 10,000 feature problem. In: Proceedings of the ACM SIGOPS/EuroSys European Conference on Computer Systems 2011 (EuroSys’11), pp. 47–60. ACM Press, New York (2011)Google Scholar
  45. 45.
    Tartler, R., Sincero, J., Schröder-Preikschat, W., Lohmann, D.: Dead or alive: Finding zombie features in the Linux kernel. In: Proceedings of the 1st Workshop on Feature-Oriented Software Development (FOSD’09), pp. 81–86. ACM Press, New York (2009)Google Scholar
  46. 46.
    Thaker, S., Batory, D., Kitchin, D., Cook, W.: Safe composition of product lines. In: Proceedings of the 7th International Conference on Generative Programming and Component Engineering (GPCE’07), pp. 95–104. ACM Press, New York (2007)Google Scholar
  47. 47.
    Urban, M., Lohmann, D., Spinczyk, O.: The aspect-oriented design of the PUMA C/C++ parser framework. In: Proceedings of the 9th International Conference on Aspect-Oriented Software Development (AOSD’10), pp. 217–221. ACM Press, New York (2010)Google Scholar
  48. 48.
    Zengler, C., Küchlin, W.: Encoding the Linux kernel configuration in propositional logic. In: Hotz, L., Haselböck, A. (eds,) Proceedings of the 19th European Conference on Artificial Intelligence (ECAI 2010) Workshop on Configuration 2010, pp. 51–56 (2010)Google Scholar

Copyright information

© Springer-Verlag 2012

Authors and Affiliations

  • Reinhard Tartler
    • 1
  • Julio Sincero
    • 1
  • Christian Dietrich
    • 1
  • Wolfgang Schröder-Preikschat
    • 1
  • Daniel Lohmann
    • 1
  1. 1.Friedrich-Alexander University Erlangen-NurembergErlangenGermany

Personalised recommendations