Font Size: a A A

The Design And Implementation Of Improvement Gdb Debugger Supported Memory Error Detection

Posted on:2013-02-04Degree:MasterType:Thesis
Country:ChinaCandidate:Y LiuFull Text:PDF
GTID:2248330371988128Subject:Software engineering
Abstract/Summary:PDF Full Text Request
C language has been widely used in the development of a variety of system and application software. Its memory management machinery and operating pointer enables it great expression power and flexibility, which, however, also leads to a large number of memory errors. Those errors are hard to reproduce and perform cause analysis for, and thus difficult to detect in general.Existing memory error detection approaches can roughly be divided into two categories, dynamic detection and static detection, based on whether it depends on program execution. Static detection methods perform error examination on source code, which is very efficient but leads to high rate of both false-positive and false-negative detection due to the uncertainty and unpredictability during program execution. By contrast, the dynamic approaches achieve better performance by making use of the memory state information gathered during program running. However, as most existing dynamic approaches demand for source code modification, it may undermine the potential structures and functionalities of the programs to analyze. In addition, most existing detection approaches fail to deal with cross-boundary error of static arrays.To address above problems, in this paper, we propose a gdb debugger based memory error detection framework, when packing with which, the gdb debugger can not only locate both the cross-boundary visiting and memory leak error, but also avoid the false-positive and false-negative detection error. The basic idea of the framework consists of following respects:1) During gdb debugging, capture the memory allocation information with specific strategy according to the memory distribution states;2) Analyze the captured information and construct memory debugging symbol table and memory leak error list for detecting cross-boundary visiting and memory leak error respectively.3) Monitor the memory allocation and explore cross-boundary visiting error with debugging symbol table based on the watchpoint theory, as well as memory leak error by analyzing memory leak error lists.4) By calling the original debugging functionality the memory errors can be accurately positioned when detected.
Keywords/Search Tags:memory boundary access, memory leaks, gdb, watchpoint
PDF Full Text Request
Related items