Debugging Dynamic Memory Usage Errors Using HP WDB (5900-1474; WDB 6.2; January 2011)
Prerequisites
Following are the prerequisites for debugging memory-related problems in WDB:
• The memory-debugging feature in WDB is dependent on the availability of the
dynamic Linker Version B.11.19.
• WDB uses the heap debugging library, librtc.[sl|so], to enable
memory-debugging support. The librtc.[sl|so] library is a part of the HP WDB
product. If the debugger is installed in a directory other than the default
/opt/langtools/bin directory, you must use the environment variable,
LIBRTC_SERVER, to set the path of the appropriate version of librtc.[sl|so].
From HP WDB 5.7 onwards, the archive version of the run time check library,
librtc.a, is not available. You must use the shared version of the library,
librtc.[sl|so], instead.
• WDB does not support debugging of programs that link with the archive version of
the standard C library, libc.a, or the core library, libcl.a. The programs must
be linked with libc.[sl|so].
• The memory-debugging feature is supported only for programs that directly or
indirectly call malloc(), realloc(), free(), mmap(), or munmap() from the
standard C library, libc.[sl|so], or a third party (custom allocator)
implementation of these functions.
• The memory debugging feature is not supported for CMA threaded programs.
• The memory debugging feature cannot be used with applications that redefine or
override the default system-supplied versions of the standard library routines (under
libc.so and libdl.so), such as abort(), strcat(), ctime(), and
dlclose(). Before enabling the memory debugging feature in WDB, use the
nm(1) command to determine if the application or the dependent libraries in the
application redefine or substitute the standard library routines. For more information
on the dependent standard library routines, see the HP WDB release notes, available
at the HP WDB Documentation website at:
http://www.hp.com/go/wdb
Memory-Related Errors
This section discusses the following memory-related errors that can occur in an application:
• Heap corruption
• Memory leaks
• Access errors
Prerequisites 7