Debugging Dynamic Memory Usage Errors Using HP WDB v6.3 (5900-2181, August 2012)
NOTE: If LD_PRELOAD and chatr +rtc are used to preload the librtc.[sl|so] runtime
library, librtc[sl|so] is loaded from the path specified by LD_PRELOAD.
Overriding the Default Location for librtc.[sl|so]
By default WDB uses the librtc.[sl|so], available at the location /opt/langtools/lib.
If the application requires the use of librtc.[sl|so] at a different location, you must set the
environment variable, LIBRTC_SERVER, to point to the location where the library is located.
Following is the syntax for setting an alternate location for librtc.[sl|so]:
export LIBRTC_SERVER=<path>
NOTE: This environmental variable is applicable for attach and interactive mode also.
Overriding the Default Path for Searching the GDB Executable
On Itanium systems, from librtc version 6.1, gdb is not invoked in batch mode. Prior to librtc
version 6.1, the GDB_SERVER variable enables you to override the default path from where the
gdb executable is used to debug memory problems. The default path for the gdb executable is
/opt/langtools/bin/gdb.
Following is the syntax to override the default path for the gdb executable:
export GDB_SERVER=<path>
NOTE: On Itanium systems, librtc versions prior to 6.1, the Batch Mode RTC displays one of
the following errors and causes the program to temporarily hang if the version of GDB and
librtc.[sl|so] do not match, or if GDB is not available on the system:
/opt/langtools/bin/gdb: unrecognized option ‘-brtc’ Use ‘/opt/langtools/bin/gdb --help’ for a complete list of
options.
(OR)
execl failed. Cannot print RTC info: No such file or directory
This error does not occur under normal usage where GDB or librtc.[sl|so] is used from the
default location at /opt/langtools/.... However, this error occurs if GDB_SERVER
,LIBRTC_SERVER, or both are set to a mismatched version of GDB or librtc.[sl|so]
respectively.
Enabling the Processing of the .gdbinit File
Processing of the .gdbinit file is not enabled in batch mode from librtc 6.1 version and later.
On Itanium system for librtc versions prior to 6.1, RTC_PROCESS_GDBINIT is an optional
environment variable used to enable processing of the .gdbinit file. You can use the .gdbinit
file to specify path settings such as dir, objectdir, and pathmap to set the path of the source
and object files in case the source or object paths are different than the current directory, so that
the generated RTC reports display the symbol names and line numbers correctly. This feature is
optionally enabled only when the RTC_PROCESS_GDBINIT environment variable is set to 1. There
are limitations on what commands in the .gdbinit file. If there are erroneous commands in the
.gdbinit file, the batch RTC session can possibly hang and not produce the expected RTC
reports. Following are some examples:
1. If the 'q' (quit) command is used, the session would hang and finally terminate after
approximately 10 mins, and not generate any RTC reports. It would print the error message
"Broken synchronization between child/parent process".
2. If any gdb command that would take more processing time is used, this would interfere with
the assumptions of RTC and the session may hang and print the error message "Broken
synchronization between child/parent process".
Supported Modes of Memory-debugging in WDB 51