Runtime checking for paired functions in device drivers

Jia Ju Bai, Hu Qiu Liu, Yu Ping Wang, Shi Min Hu

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

8 Citations (Scopus)

Abstract

Device drivers usually invoke functions to allocate resources for managing hardware devices and communicating with the kernel, and these resources should be released by functions when the work is finished. Thus allocating functions and releasing functions must be invoked in pairs. However, many developers ignore this vital rule, and some allocated resources are not released in time, which may cause resource related problems like deadlocks and memory leak. For improving the resource management of device drivers, we propose an approach named PairDyn to check these paired functions during runtime. When the driver runs, PairDyn records the runtime information of allocating functions such as key parameters and return value, and dynamically detects whether the relevant releasing functions are invoked to free allocated resources during runtime. Before the driver exits, PairDyn automatically attempts to invoke the related releasing functions which are lacked in runtime, in order to free the allocated resources of the operation system. We have implemented PairDyn with the LLVM compiler infrastructure, and make the evaluation with four real device drivers in Linux version 3.10.1. The experimental result shows that with the low extra overhead, PairDyn can provide effective runtime checking for allocate-release paired functions. Moreover, 9 potential bugs are found in the four drivers, which are all fixed automatically before exiting. Finally, no manual modification of the source code is needed with PairDyn.

Original languageEnglish
Title of host publicationProceedings - 21st Asia-Pacific Software Engineering Conference, APSEC 2014
EditorsYann-Gael Gueheneuc, Gihwon Kwon, Sungdeok Cha
PublisherIEEE Computer Society
Pages407-414
Number of pages8
ISBN (Electronic)9781479974252
DOIs
Publication statusPublished - 2014
Externally publishedYes
Event21st Asia-Pacific Software Engineering Conference, APSEC 2014 - Jeju Island, Korea, Republic of
Duration: 1 Dec 20144 Dec 2014

Publication series

NameProceedings - Asia-Pacific Software Engineering Conference, APSEC
Volume1
ISSN (Print)1530-1362

Conference

Conference21st Asia-Pacific Software Engineering Conference, APSEC 2014
Country/TerritoryKorea, Republic of
CityJeju Island
Period1/12/144/12/14

Keywords

  • Device drivers
  • Operation system
  • Paired functions
  • Resource management
  • Runtime checking

Fingerprint

Dive into the research topics of 'Runtime checking for paired functions in device drivers'. Together they form a unique fingerprint.

Cite this