@inproceedings{0dc8e51255f34dd2956bca1f27f6e978,
title = "Runtime checking for paired functions in device drivers",
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.",
keywords = "Device drivers, Operation system, Paired functions, Resource management, Runtime checking",
author = "Bai, {Jia Ju} and Liu, {Hu Qiu} and Wang, {Yu Ping} and Hu, {Shi Min}",
note = "Publisher Copyright: {\textcopyright} 2014 IEEE.; 21st Asia-Pacific Software Engineering Conference, APSEC 2014 ; Conference date: 01-12-2014 Through 04-12-2014",
year = "2014",
doi = "10.1109/APSEC.2014.66",
language = "English",
series = "Proceedings - Asia-Pacific Software Engineering Conference, APSEC",
publisher = "IEEE Computer Society",
pages = "407--414",
editor = "Yann-Gael Gueheneuc and Gihwon Kwon and Sungdeok Cha",
booktitle = "Proceedings - 21st Asia-Pacific Software Engineering Conference, APSEC 2014",
address = "United States",
}