Debugging Dynamic Memory Usage Errors Using HP WDB (5900-1474; WDB 6.2; January 2011)
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?
(gdb) info corruption
Current thread is inside the allocator. Try again later.
This error message signifies that the program execution is in a frame that belongs
to a GDB internal leak detection library. When this error is encountered, it is not
safe to enter commands that involve calls to the leak detection library procedures.
The user must set the frame to the last leak detection library frame and enter the
finish command before resuming to debug memory.
Example 25 (page 105) illustrates the use of the finish to resume memory debugging
when the program execution is in a frame that belongs to the GDB internal leak
detection library.
14 Does memory heap or leak detection work if libmallocng is used for heap
allocation management instead of libc?
Yes. On Itanium systems, the heap or leak detection works if libmallocng is used
for heap management. The arena information cannot be obtained when the
application uses libmallocng.
15 The batch mode RTC sometimes crashes when the application has atfork handlers.
FAQ 107