摘要
C语言执行效率高,使用范围广泛,然而存在的安全问题也日益突出。内存错误是C程序中常见的缺陷,严重时将导致系统崩溃。传统的人工修复内存错误耗费大量人力物力,并可能在修复过程中引入新的错误。针对这个问题,提出了一种基于跟踪机制的程序自动修复方法。构建包含程序文件中变量作用分布的作用域树;提出基于全局指针的跟踪机制,通过插入全局指针跟踪发生错误的分配内存在程序中的状态;基于全局指针自动生成补丁,利用作用域树定位缺陷修复位置从而来安全地修复内存错误。基于上述过程,实现了原型工具DTSFix,并在开源程序中对其进行了评估。实验结果表明,DTSFix能够有效检测并修复程序中的真实缺陷而且不产生副作用。
C is a highly efficient and widely used language,but its widespread use has been accompanied by growing security issues.The memory error is a common error in C programs,which will cause the system to collapse in severe cases.Manually fixing memory error requires considerable efforts,and potentially introduces new errors in the repair process.To address this problem,an automatic program repair method based on tracking mechanism is proposed.Firstly,it con-structs the scope-tree containing the distribution of variables in the program file.Then,a global pointer-based tracking mechanism is proposed to track the state of allocated memory with errors in the program.Finally,a patch is automatically generated based on a global pointer,and a scope-tree is used to locate where the defect is fixed so that the memory error can be safely repaired.Based on the above process,the prototype tool DTSFix has implemented,in addition evaluated it with open-source programs.The experimental results show that DTSFix can effectively detect and repair the real defects in open-source programs without side effects.
作者
董玉坤
位欣欣
孙玉雪
唐道龙
DONG Yukun;WEI Xinxin;SUN Yuxue;TANG Daolong(School of Computer Science and Technology,China University of Petroleum(East China),Qingdao,Shandong 266580,China)
出处
《计算机工程与应用》
CSCD
北大核心
2022年第19期76-87,共12页
Computer Engineering and Applications
基金
山东省自然科学基金(ZR2021MF058)。
关键词
跟踪机制
程序自动修复
内存错误
作用域树
tracing mechanism
automatic program repair
memory errors
scope tree