Font Size: a A A

Research On Memory Leak Detection Of C/C++Code

Posted on:2013-10-12Degree:MasterType:Thesis
Country:ChinaCandidate:Z WangFull Text:PDF
GTID:2248330371996835Subject:Software engineering
Abstract/Summary:PDF Full Text Request
C/C++programming languages have the advantage of flexibility and efficiency, but at the same time, lots of undefined behavior makes it easy to bring serious security violations. As one of common faults of C/C++program, memory leak fault is very harmful. Security analysis on memory leak defect is one of the standards to measure software reliability.As a testing technique, static detection technique exists in the whole life cycle of software development. Static detection does not need to execute the procedures to be detected, and can identify potential security flaws. Compared to dynamic testing techniques, static detection has broader applicability, and it is an important means for software testing.First, this research describes the basic theoretical knowledge and research results on memory leak and software testing, and focuses on static analysis method and its tools. Then, a syntax tree model based on relational storage schema is proposed in this paper, which can get the security attribute. In addition, an intermediate storage model with well extensibility based on XML is designed. Security attribute is finally converted to XML format which is more suitable for static detection. At last, this research proposes a Petri net model of memory leak fault and a defect detection method based on model testing.Based on the method mentioned above, an automatic C/C++code memory leak defect detection system is designed and implemented, which achieved defect detection method based on pattern matching and has well extensibility. The memory leak defect detection system provides lexical analysis, syntax analysis, semantic analysis, dataflow analysis and control flow analysis, which can detect memory leak security efficiently. This system also reduces the requirements on the users, and there is no need to add comments in the source program. Moreover, the detection system supports multiple file parsing.
Keywords/Search Tags:Memory Leak, Static Detection, XML, Petri Net
PDF Full Text Request
Related items