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

C程序中的内存泄漏机制分析与检测方法设计
引用本文:张静,黄志球,沈国华,喻垚慎,艾磊. C程序中的内存泄漏机制分析与检测方法设计[J]. 计算机工程与科学, 2020, 42(5): 776-787
作者姓名:张静  黄志球  沈国华  喻垚慎  艾磊
作者单位:(1.南京航空航天大学计算机科学与技术学院, 江苏 南京 211106;2.南京航空航天大学高安全系统的软件开发与验证技术工业和信息化部重点实验室,江苏 南京 211106)
摘    要:C语言作为安全关键软件的主要实现语言,其存在的内存泄漏缺陷具有很高的隐蔽性和危害性,如何保证内存泄漏检测的准确性和高效性是一大挑战。静态分析具有直接分析源码、能够较早发现软件错误,从而降低修复代价的优势。基于静态分析技术,提出了一种基于路径敏感的值流分析的内存泄漏检测方法,首先进行指针分析生成精确指向信息;然后基于指向信息构建值流约束,执行可达性分析以识别程序中的泄漏路径;最后借助指针与内存地址的有效生命周期进行验证。在典型基准C程序上的实验结果分析表明,本文方法与现有技术相比在效率和精度上都具有一定优势。

关 键 词:内存泄漏  静态分析  指针分析  值流分析
收稿时间:2019-09-05
修稿时间:2019-12-11

Memory leak mechanism analysis and detection of C Programs
ZHANG Jing,HUANG Zhi-qiu,SHEN Guo-hua,YU Yao-shen,AI Lei. Memory leak mechanism analysis and detection of C Programs[J]. Computer Engineering & Science, 2020, 42(5): 776-787
Authors:ZHANG Jing  HUANG Zhi-qiu  SHEN Guo-hua  YU Yao-shen  AI Lei
Affiliation:(1.College of Computer Science and Technology,Nanjing University of Aeronautics and Astronautics,Nanjing 211016;2.Key Laboratory of Safety-Critical Software(Nanjing University of Aeronautics and Astronautics),Ministry of Industry and Information Technology,Nanjing 211106,China) 
Abstract:As the main implementation language of safety-critical software, memory leak defects of C language are highly concealed and harmful. How to ensure the accuracy and efficiency of memory leak detection is a big challenge. Static analysis has the advantage of directly analyzing the source code, detecting software errors early, so it can reduce the cost of repairs. Based on static analysis technology, the paper proposes a memory leak detection method based on path-sensitive value-flow analysis. Firstly, pointer analysis is performed to generate precise point-to information. Secondly, based on the point-to information, value-flow constraints are constructed, and reachability analysis is performed to identify the memory leak paths in the program. Finally, the memory leak paths are verified by the effective life cycle of pointers and memory addresses. Experimental results on typical benchmark C programs show that the proposed method can improve the efficiency and accuracy compared with the existing technology.
Keywords:memory leak  static analysis  pointer analysis  value-flow analysis  
本文献已被 维普 万方数据 等数据库收录!
点击此处可从《计算机工程与科学》浏览原始摘要信息
点击此处可从《计算机工程与科学》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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