Debugging Dynamic Memory Usage Errors Using HP WDB v6.3 (5900-2181, August 2012)

NOTE:
This feature is not supported in the batch and the attach modes of debugging.
In interactive mode, this feature will result in calls to the user defined memory management
routines being re-routed to default memory management routines.
6 Which version of WDB supports debugging of applications with custom allocators?
WDB 5.5 and above versions support the debugging of applications with custom allocators.
7 Does WDB report the exact instant when the block becomes a leak?
No. WDB does not provide information on when the leak occurred. It reports only the allocation
stack trace of the leaked block and does not report the stack trace where the block leaked.
8 Does WDB support debugging of C++ applications with calls to new() and delete()?
Yes. WDB supports debugging of C++ applications with new() and delete() calls only if
they internally call malloc() and free().
9 Does WDB support memory-debugging of long running applications?
Yes. WDB supports debugging of long running applications such as daemons. However, the
daemons must be started with an explicit LD_PRELOAD of the correct version (32-bit or 64-bit)
of librtc.[sl|so], so that WDB can debug memory when it later attaches to the daemon
process.
10 What is the work-around when the following message is displayed, when attempting to view
the leak report with the info leaks command?
(gdb) info leaks
Current thread is blocked. Cannot detect leaks now.
You can switch execution to a thread, which is not blocked. To switch execution to a different
thread, enter the following command at the gdb prompt:
(gdb)thread <thread-id>
11 Does the debugger find leaks in the executable from the startup of the application when
debugging the application in attach mode?
In the case of Itanium binaries, and PA—RISC 64–bit binaries, the debugger finds leaks in the
executable from the startup of the executable by default, when debugging in attach mode.
However, to find leaks in the executable from the startup of PA-RISC 32–bit binaries in the
attach mode, the environment variable RTC_INIT must be set to on in addition to preloading
the librtc.[sl|so] library before starting the application, as follows:
$ LD_PRELOAD=/opt/langtools/lib/librtc.sl RTC_INIT=on <executable>
If RTC_INIT is enabled, librtc.[sl|so] starts recording heap information for PA–RISC
32–bit process by default. Hence, you must set this environment variable only when memory
debugging is required from the startup of the program
12 When attempting to view the leak report, the following error occurs:
(gdb) info leaks
Scanning for memory leaks...
Error downloading data !
(gdb)
What is the cause for this error and what is the work-around?
This error message is displayed when you attempt to view the heap profile or the leak profile
of a debugged process, which is exiting or has exited program execution. As a work-around,
you can place a breakpoint before the program exits and then enter the info leaks command
or the info heap command.
13 What is the work-around if the following error message is displayed while debugging memory?
FAQ 83