Debugging Dynamic Memory Usage Errors Using HP WDB (766161-001, March 2014)
NOTE A note contains additional information to emphasize or supplement
important points of the main text.
Related Information
The HP WDB documentation is available at the following location:
/opt/langtools/wdb/doc/
Table 1 lists the documentation available for WDB.
Table 1 Documentation for HP WDB
LocationDocument
/opt/langtools/wdb/doc/gdb.pdfDebugging with GDB
/opt/langtools/wdb/doc/refcard_a4.pdfGDB Quick Reference Card
/opt/langtools/wdb/doc/refcard_a3.df
/opt/langtools/wdb/doc/refcard.pdf (Letter
Format)
/opt/langtools/wdb/doc/html/wdb/C/GDBtutorial.htmlGetting Started with WDB
/opt/langtools/wdb/doc/index.htmlWDB Online Help
/opt/langtools/wdb/doc/html/wdbgui/C/HP WDB GUI Documentation
gdb(1)GDB manpage
For the most current WDB documentation, see the HP WDB technical resources website at:
http://www.hp.com/go/wdb
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
6