Wednesday, January 14, 2009

Tools which can be used for debugging applications

One of my friend send me this list of tools. Think it is worth noting it down.

Here is a list of tools which can be used for debugging applications –

mpatrol - This library is available for almost all platforms.
The mpatrol library is a powerful debugging tool that attempts to diagnose run-time errors that are caused by the wrong use of dynamically allocated memory. It acts as a malloc() debugger for debugging dynamic memory allocations, although it can also trace and profile calls to malloc() and free() too

Bcheck - Available in Sun Studio for Solaris OS
Runtime checking (RTC) lets you automatically detect runtime errors, such as memory access errors and memory leak, in a native code application during the development phase. It also lets you monitor memory usage. You cannot use runtime checking on Java code.

Electric Fence - Available for unix
Electric Fence (efence) stops your program on the exact instruction that overruns (or underruns) a malloc() memory buffer. GDB will then display the source-code line that causes the bug. It works by using the virtual-memory hardware to create a red-zone at the border of each buffer - touch that, and your program stops. Catch all of those formerly impossible-to-catch overrun bugs that have been bothering you for years.

DUMA - Fork of Electric Fence library. Available for most of the platforms.
DUMA (Detect Unintended Memory Access) is a multi-platform memory debugging library. It can detect memory leaks and buffer overruns (or underruns) in a malloc() / new memory buffer. DUMA is a fork of Bruce Perens' Electric Fence library.

Dmalloc - Available for most platforms
The debug memory allocation or dmalloc library has been designed as a drop in replacement for the system's malloc, realloc, calloc, free and other memory management routines while providing powerful debugging facilities configurable at runtime. These facilities include such things as memory-leak tracking, fence-post write detection, file/line number reporting, and general logging of statistics.
The library is reasonably portable having been run successfully on at least the following operating systems: AIX, BSD/OS, DG/UX, Free/Net/OpenBSD, GNU/Hurd, HPUX, Irix, Linux, MS-DOG, NeXT, OSF, SCO, Solaris, SunOS, Ultrix, Unixware, Windoze, and even Unicos on a Cray T3E. It also provides support for the debugging of threaded programs.

libcwd - Thread safe, ostream based debugger.
Libcwd is a thread-safe, full-featured debugging support library for C++ developers. It includes ostream-based debug output with custom debug channels and devices, powerful memory allocation debugging support, as well as run-time support for printing source file:line number information and demangled type names.

libumem - Uses "Slab allocator" concept. Available as a part of Solaris from Solaris 9 update 3 onwards.
The slab allocator is designed for systems with many threads and many CPUs. Memory allocation with naive allocators can be a serious bottleneck (in fact we recently used DTrace to find such a bottleneck; using libumem got us a 50% improvement). There are other highly scalable allocators out there, but libumem is about the same or better in terms of performance, has compelling debugging features, and it's free and fully supported by Sun.

Memcheck - Memory Checker, available for unix.

Memwatch - A memory leak detection tool for unix os.
A memory leak detection tool. Basically, you add a header file to your souce code files, and compile with MEMWATCH defined or not.

MTrace - malloc debugging

And finally, a useful comparison of tools is available in -

No comments: