首页 | 本学科首页   官方微博 | 高级检索  
     

跟踪机制引导的C程序内存错误自动修复
引用本文:董玉坤,位欣欣,孙玉雪,唐道龙. 跟踪机制引导的C程序内存错误自动修复[J]. 计算机工程与应用, 2022, 58(19): 76-87. DOI: 10.3778/j.issn.1002-8331.2202-0254
作者姓名:董玉坤  位欣欣  孙玉雪  唐道龙
作者单位:中国石油大学(华东) 计算机科学与技术学院,山东 青岛 266580
摘    要:C语言执行效率高,使用范围广泛,然而存在的安全问题也日益突出。内存错误是C程序中常见的缺陷,严重时将导致系统崩溃。传统的人工修复内存错误耗费大量人力物力,并可能在修复过程中引入新的错误。针对这个问题,提出了一种基于跟踪机制的程序自动修复方法。构建包含程序文件中变量作用分布的作用域树;提出基于全局指针的跟踪机制,通过插入全局指针跟踪发生错误的分配内存在程序中的状态;基于全局指针自动生成补丁,利用作用域树定位缺陷修复位置从而来安全地修复内存错误。基于上述过程,实现了原型工具DTSFix,并在开源程序中对其进行了评估。实验结果表明,DTSFix能够有效检测并修复程序中的真实缺陷而且不产生副作用。

关 键 词:跟踪机制  程序自动修复  内存错误  作用域树  

Automatic Repair of C Program Memory Error Guided by Tracking Mechanism
DONG Yukun,WEI Xinxin,SUN Yuxue,TANG Daolong. Automatic Repair of C Program Memory Error Guided by Tracking Mechanism[J]. Computer Engineering and Applications, 2022, 58(19): 76-87. DOI: 10.3778/j.issn.1002-8331.2202-0254
Authors:DONG Yukun  WEI Xinxin  SUN Yuxue  TANG Daolong
Affiliation:School of Computer Science and Technology, China University of Petroleum(East China), Qingdao, Shandong 266580, China
Abstract: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 constructs 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.
Keywords:tracing mechanism  automatic program repair  memory errors  scope tree  
点击此处可从《计算机工程与应用》浏览原始摘要信息
点击此处可从《计算机工程与应用》下载免费的PDF全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号