Duma (software)

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Detect Unintended Memory Access (or DUMA) is a memory debugger. It consists of a library which programmers can link into their code to override the C standard library and C++ memory management functions. DUMA triggers a program crash when the memory error occurs, so a debugger can be used to inspect the code that caused the error.

This library is a fork of Bruce Perens' Electric Fence library, but also runs on Windows operating systems.

DUMA is intended to find several common types of programming bugs:

  • Overrunning the end (or beginning) of a dynamically allocated buffer
  • Using a dynamically allocated buffer after returning it to the heap
  • Detecting memory leaks
  • Detects mismatch of allocation/deallocation functions: f.e. allocation with malloc() but deallocation with operator delete

In above cases, DUMA causes the errant program to abort immediately via a segmentation fault. Normally, these errors would cause heap corruption, which would manifest itself only much later, usually in unrelated ways. Thus, DUMA helps programmers find the precise location of memory programming errors.

DUMA allocates at least two pages (often 8kB) for every allocated buffer. In some modes of operation, it does not deallocate freed buffers. Thus, DUMA vastly increases the memory requirements of programs being debugged. This leads to the recommendation that programmers should never leave DUMA linked against production code.

DUMA is free software licensed under the GNU General Public License.

See also[edit]

External links[edit]