基于源代码的内存泄漏静态分析方法  被引量:4

A Static Memory Leak Detection Method Based on Executable Source Code

在线阅读下载全文

作  者:甘红星[1] 金大海[1] 宫云战[1] 

机构地区:[1]北京邮电大学网络与交换技术国家重点实验室,北京100876

出  处:《内蒙古大学学报(自然科学版)》2011年第5期515-520,共6页Journal of Inner Mongolia University:Natural Science Edition

基  金:国家"八六三"高技术研究发展计划基金重点项目(2007AA010302);国家"八六三"高技术研究发展计划基金项目(2009AA012404);国家自然科学基金资助项目(91018002)

摘  要:在很多大型C、C++程序中,内存泄漏是一种十分常见的问题.内存泄漏是很难识别的,因为它唯一的特征就是内存消耗的增长.对内存泄漏产生的原因进行了分析,并且提出了一种基于可执行源码的静态分析方法.对可执行源码进行预处理,生成抽象语法树和控制流图,并且计算出所有可达路径,然后在每条可达路径上进行内存泄漏故障的检测和分析.此方法已在缺陷检测系统(DTS)中进行验证,通过对大量GCC开源工程的测试,证实本方法有效的检测出内存泄漏的故障.In many large-scale C or C++ projects,memory leak is a very common error.Memory leak is difficult to identify,because its feature is only a slow increase in memory consumption.The causes of memory leak is analyzed and a static detection method based on executable source code is proposed.The source code is preprocessed and the Abstract syntax tree and control flow graph are generated,and then the reachable paths are calculated in order to detect and analyze memory leaks for every generated path.This method is applied in Defect Testing System(a software defect detecting tool),a lot of open source projects of GCC are tested.The results showed that this method is effective and correct.

关 键 词:内存泄漏 控制流图 抽象语法树 可达路径 

分 类 号:TP311[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象