An approach to improving the structure of error-handling code in the linux kernel

Suman Saha, Julia Lawall, Gilles Muller

Research output: Chapter in Book/Report/Conference proceedingConference contribution

15 Scopus citations

Abstract

The C language does not provide any abstractions for exception handling or other forms of error handling, leaving programmers to devise their own conventions for detecting and handling errors. The Linux coding style guidelines suggest placing error handling code at the end of each function, where it can be reached by gotos whenever an error is detected. This coding style has the advantage of putting all of the error-handling code in one place, which eases understanding and maintenance, and reduces code duplication. Nevertheless, this coding style is not always applied. In this paper, we propose an automatic program transformation that transforms error-handling code into this style.We have applied our transformation to the Linux 2.6.34 kernel source code, on which it reorganizes the error handling code of over 1800 functions, in about 25 minutes.

Original languageEnglish (US)
Title of host publicationLCTES'11 - Proceedings of the ACM SIGPLAN/SIGBED 2011 Conference on Languages, Compilers, Tools and Theory for Embedded Systems
Pages41-50
Number of pages10
DOIs
StatePublished - May 10 2011
EventACM SIGPLAN/SIGBED Conference on Languages Compilers, Tools, and Theory for Embedded Systems, LCTES 2011 - Chicago, IL, United States
Duration: Apr 11 2011Apr 14 2011

Publication series

NameProceedings of the ACM SIGPLAN Conference on Languages, Compilers, and Tools for Embedded Systems (LCTES)

Conference

ConferenceACM SIGPLAN/SIGBED Conference on Languages Compilers, Tools, and Theory for Embedded Systems, LCTES 2011
CountryUnited States
CityChicago, IL
Period4/11/114/14/11

All Science Journal Classification (ASJC) codes

  • Software

Fingerprint Dive into the research topics of 'An approach to improving the structure of error-handling code in the linux kernel'. Together they form a unique fingerprint.

Cite this