Runtime checking for paired functions in device drivers

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

科研成果: 书/报告/会议事项章节会议稿件同行评审

8 引用 (Scopus)

摘要

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.

源语言英语
主期刊名Proceedings - 21st Asia-Pacific Software Engineering Conference, APSEC 2014
编辑Yann-Gael Gueheneuc, Gihwon Kwon, Sungdeok Cha
出版商IEEE Computer Society
407-414
页数8
ISBN(电子版)9781479974252
DOI
出版状态已出版 - 2014
已对外发布
活动21st Asia-Pacific Software Engineering Conference, APSEC 2014 - Jeju Island, 韩国
期限: 1 12月 20144 12月 2014

出版系列

姓名Proceedings - Asia-Pacific Software Engineering Conference, APSEC
1
ISSN(印刷版)1530-1362

会议

会议21st Asia-Pacific Software Engineering Conference, APSEC 2014
国家/地区韩国
Jeju Island
时期1/12/144/12/14

指纹

探究 'Runtime checking for paired functions in device drivers' 的科研主题。它们共同构成独一无二的指纹。

引用此