Font Size: a A A

Research On Memory Leak Detection And Fixing Method Based On Value-Flow Analysis

Posted on:2021-03-11Degree:MasterType:Thesis
Country:ChinaCandidate:J ZhangFull Text:PDF
GTID:2518306479965149Subject:Master of Engineering
Abstract/Summary:PDF Full Text Request
With the widely application of software in safety-critical areas such as aerospace,medical treatment,and rail transportation,the software defects caused by industrial scale is increasing.Therefore,how to ensure the reliability of software has become a research hotspot in software development process.As the main implementation language of safety-critical software,C language has a high degree of concealment and harmfulness in its memory leak defects.Memory leaking is a form of resource leakage in runtime programs.It usually occurs when the program performs improper memory allocation and memory release operations.If not fixed in time,it may cause unpredictable losses.For example,a malicious user can exploit a memory leak in a service program to carry out network attacks for stealing or destroying sensitive information in safety-critical systems.At present,the related work on memory leaking mainly contains the following two problems:1.The accuracy of existing methods of memory leak detection need to be improved.For example,the reason for false positives in sparse value-flow analysis technology is the lack of path sensitivity.2.The major concern of existing research about memory leaking is to detect.Moreover,most of the detection methods only report the location information of the allocated memory block where the memory leak occurs,making it difficult to fix a memory leak efficiently based on such information and thus still relying on error-prone and costly manual fix.Based on the above problems,this thesis extends existing memory leak detection technology to improve accuracy,then fix the memory leaks automatically based on the defect path information generated in the detection,reducing the cost of manual fix by developers.The main research contents of this thesis are as follows:(1)Aiming at the problem of lacking path sensitivity of sparse value-flow analysis technology which is widely used in memory leakage,a method of memory leak detection based on pathsensitive value-flow analysis is proposed.It introduces path sensitivity by combining control flow information,which improves the detection accuracy.(2)Aiming at the problem that memory leaks are hard to fix efficiently,a method of memory leak fix based on defect path information is proposed.According to the value-flow information of the memory leak object reported in the detection,this method extracts the control flow graph of the function to be fixed,and then applies backward data flow analysis to find the basic block where the memory leak object is located.Finally,it select the best location to add fix function automatically,which reduces the cost for developers to fix manually.(3)A prototype tool of detection and fix for memory leaks was designed and implemented based on value-flow analysis,and experimental analysis was also performed.The experimental results show that the memory leak detection method based on path-sensitive value-flow analysis can improve the detection accuracy,and the method of memory leak fix based on defect path information can effectively analyze the best location in the program.
Keywords/Search Tags:Memory Leak, Static Analysis, Bug Fixing, Value-Flow analysis, Path-Sensitive Analysis
PDF Full Text Request
Related items