Debugging with GDB (September 2007)
Chapter 14: HP-UX Configuration-Specific Information 141
This error does not occur under normal usage where WDB or
librtc.[sl|so] is used from the default location at /opt/langtools/...
However, this error occurs if GDB_SERVER and/or LIBRTC_SERVER are set
to a mismatched version of WDB or librtc.[sl|so] resp ec tively.
5. At the end of the run, output data file is created in output_data_dir, if defined in
rtcconfig,or the current directory. HP WDB creates output data file for each run. It
creates a separate file for leak detection and heap information. The naming convention
for output files is as follows:
<file_name>.<pid>.<suffix>
Where, <pid> is the process id and the value for <suffix> can be either leaks, heap, or
mem.
Note:
During operations such as system(3s)and popen(), which invoke a new
shell, librtc.sl|so must not be loaded to the invoke d shell. You must
use LD_PRELOAD_ONCE, instead of LD_PRELOAD, to exclusively load the
librtc.sl|so file to the calling process only. Following is the syntax for
using LD_PRELOAD_ONCE:
LD_PRELOAD_ONCE= /opt/langtools/lib/librtc.sl
14.10.5.2 Environment variable setting for Batch mode debugging
Batch mode memory leak detection uses the following environment variables:
• GDBRTC_CONFIG species the location of rtc configuration file. If this option is not
specified, the configuration file is assumed to be in the current location, and has the
filename rtcconfig. If use r prefers to set this option, it must include the filename.
• Incorrect usage:
export GDBRTC_CONFIG=./
export GDBRTC_CONFIG=/tmp
• Correct usage:
export GDBRTC_CONFIG=/tmp/yet_another_config
export GDBRTC_CONFIG=/tmp/rtcconfig
• BATCH_RTC enables or disables batch memory leak detection.
• GDB_SERVER is used to override the default path from where the gdb exe cutable is used
to provide the information on memory leak. By default, /opt/langtools/bin/gdb is
used to print the output. This can be overriden by setting GDB_SERVER appropriately.
• RTC_MALLOC_CONFIG is used to override the default config and rtcconfig file settings.
This variable can be set as follows:
export RTC_MALLOC_CONFIG=config_string1[;config_strings].
• The config_strings are separated by ;.
• The following config strings options exist for RTC_MALLOC_CONFIG:
abort_on_bounds=[01]
Aborts execution when heap objects bounds check fail, value is 1,
and the environment variable RTC_NO_ABORT is not set.