The software is a memory debugger designed for C and C++ programs. It includes a range of useful features for debugging and analyzing memory-related issues in these languages.
DBGMEM works by overriding GLIBC memory allocation functions and memory and string manipulation functions to add its features. Although it does not require changes to your program, some advanced features might require alterations. The tool is implemented as shared libraries that are loaded into the address space of the debugged process.
DBGMEM has several memory debugging tools, and each can be loaded into the debugged program. The Simple tool is particularly useful for detecting memory leak problems. It keeps track of all allocated memory blocks, adds bookkeeping information such as the stack at the time the block was allocated into an arena header preceding the allocated memory block. It also adds a guard word before and after the allocated block. However, this tool is susceptible to corruption by the debugged program.
In contrast, the Checking tool puts all bookkeeping information off the stack in an anonymous memory-mapped file, making it more robust in the face of memory overwriting bugs. It also enables you to quickly look up information on any heap block for a pointer value contained in that heap block. It adds validation of parameters to common string and memory manipulation functions and checks for possible stack smashing by these functions.
DBGMEM does not require the debugged program to be linked with any specific libraries. It is a shared library that is loaded into the address space of a process that is checked using DLL Injection. The LD_PRELOAD feature of the Dynamic linker is used to load the shared library before any other library, intercepting and first calling memory allocation and string manipulation functions from the tool library to enable it to add its checks.
During the runtime of the debugged process, a raw report is written that is further processed after termination of the debugged process. The augmented report adds symbolic function names to stack traces contained in the raw report. The Gdb debugger is used to turn numeric addresses into symbolic addresses during further processing of the raw report.
Version 1.9.2: N/A