DocumentCode
3587360
Title
Runtime Checking for Paired Functions in Device Drivers
Author
Jia-Ju Bai ; Hu-Qiu Liu ; Yu-Ping Wang ; Shi-Min Hu
Author_Institution
Nat. Lab. for Inf. Sci. & Technol., Tsinghua Univ., Beijing, China
Volume
1
fYear
2014
Firstpage
407
Lastpage
414
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 Pair Dyn to check these paired functions during runtime. When the driver runs, Pair Dyn 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, Pair Dyn 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 Pair Dyn 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, Pair Dyn 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 Pair Dyn.
Keywords
Linux; device drivers; program compilers; LLVM compiler infrastructure; Linux version 3.10.1; Pair Dyn; device drivers; resource allocation; resource management; runtime checking; Computer bugs; Instruments; Kernel; Linux; Reliability; Runtime; device drivers; operation system; paired functions; resource management; runtime checking;
fLanguage
English
Publisher
ieee
Conference_Titel
Software Engineering Conference (APSEC), 2014 21st Asia-Pacific
ISSN
1530-1362
Print_ISBN
978-1-4799-7425-2
Type
conf
DOI
10.1109/APSEC.2014.66
Filename
7091337
Link To Document