Memory leak detection method based on symbolic execution

A memory leak and detection method technology, applied in the field of software engineering and software testing, can solve the problems of suspected memory leak alarms, low operating efficiency, time-consuming and labor-intensive problems, and achieve the effect of solving false positives, reducing the scope of monitoring, and improving efficiency

Inactive Publication Date: 2016-07-27
北京系统工程研究所 +1
View PDF5 Cites 14 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

A large number of suspected memory leak alerts from static analysis require manual verification one by one, which is time-consuming and laborious
The method of dynamically testing memory leaks requires test case-driven testing, and no leaks can be detected without the code that the test case passes through.
And because there is no target, dynamic testing needs to insert piles for the entire tested code, and the running efficiency is not high

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Memory leak detection method based on symbolic execution
  • Memory leak detection method based on symbolic execution
  • Memory leak detection method based on symbolic execution

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0042] Example: figure 2 yes figure 1 The process after the test framework is embodied in the middle, specifically introduces the memory leak test method based on symbolic execution, and shows the workflow of using static analysis to guide the dynamic memory leak test method under the LLVM framework. First, enter the C language code into Fortify, a static analysis tool, to get a static memory leak alert. At the same time, after compiling the source code with llvm-gcc, input the LLVM intermediate code (IR) stub tool (LLVMPass) together with the leak alarm, modify the intermediate code, do path tracking and memory object state tracking, etc.; then, put the stub The final intermediate code is input into KLEE for symbolic execution to generate test cases; all test cases are executed to collect the status information of the target memory; finally, the execution results of all test cases are integrated to obtain four categories of memory leak test results.

[0043] Next, we will...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention aims at overcoming the memory leak defect and providing a memory leak detection method based on symbolic execution. Firstly, tested source codes are processed by using a static analysis tool to obtain static memory leak alarms; then, the source codes and the memory leak alarms are simultaneously input into a pile inserting device to obtain pile-inserted codes; then, the pile-inserted codes are input into a test case generating module to generate a large number of test cases and execute all test cases; the target memory leak situation is reported after operation of each test case finishes, finally all test execution outputs are summarized, and memory leak testing results are judged. The memory leak detection method solves the false alarming problem of static memory leak analysis and neglected alarming problem of dynamic testing, utilizes a symbolic execution technology to generate test cases, decreases artificial verification works of static analysis of memory leak results and improves dynamic execution efficiency.

Description

technical field [0001] The invention belongs to the fields of software engineering and software testing, and in particular relates to a method for detecting software memory leaks, which mainly uses symbolic execution technology to solve the problem of false positives in static memory leak analysis and false positives in dynamic testing. Background technique [0002] In a C / C++ program, a memory leak means that the dynamically allocated memory in the program is not released for some reason, so that the system cannot allocate the memory again. There are two types of memory leaks: lost references and forgotten releases. A loss of reference refers to the loss of all pointers or references to a dynamically allocated memory object, making the memory object unreachable. Forgetting to release means that although the dynamically allocated memory is reachable by pointers or references, it is not accessed and released during the rest of the program. [0003] Static analysis of memory...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/07
CPCG06F11/0727G06F11/0784G06F11/0787
Inventor 王兵邓波刘宇李海龙战茅许帅施寅生洪斌周严王林章
Owner 北京系统工程研究所
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products