摘要
Qt继承了C++语言动态分配内存机制,保证了开发人员能根据实际需要灵活地使用内存,同时Qt也不可避免的要面对“内存泄漏”这个严重威胁软件安全的问题,虽然Qt采取了半自动化内存管理机制等措施,但不能从根本上解决问题;对此,提出了一种基于Qt的软件内存泄漏静态检测方法,该方法针对Qt的半自动化内存管理机制,通过静态分析被测对象中分配内存的代码识别出是否属于Qt自动管理的范围,从而准确地检测出内存泄漏和内存重复释放问题;并基于该检测方法设计了一种Qt内存泄漏自动检测工具,该工具能很大程度上提高测试效率。
Qt inherits C++ language dynamic allocating memory management mechanism, it ensures that the developers can flexible use memory according to the actual needs. Meanwhile Qt has to face the “memory leak” problem of serious threating to software security. Although Qt adopted measures such as semi-automatic memory management mechanism, it has not fundamentally solved the problem. Therefore, this paper proposes a static detection method of software based Qt memory leak. For this semi-automatic memory management mechanism of QT, this method can identify whether belongs to the scope of Qt automatic management by statically analyzing these codes where the tested object allocated memory. Thereby it can accurately detect memory leak and memory repeated release. And based on this detection method, an automatic Qt memory leak detection tool is designed. This tool can greatly improve the test efficiency.
作者
匡海燕
张玉中
刘仁千
李国杰
谷威
Kuang Haiyan;Zhang Yuzhong;Liu Renqian;Li Guojie;Gu Wei(XJ Electric Co., Ltd., Xuchang 461000, China)
出处
《计算机测量与控制》
2019年第7期36-39,共4页
Computer Measurement &Control
基金
国家电网许继集团重点项目(5292C0170039)
关键词
Qt内存管理机制
内存泄漏
内存重复释放
静态检测技术
Qt memory management mechanism
memory leaks
memory repeated release
static detection technology