Debugging Dynamic Memory Usage Errors Using HP WDB
Table 14 The config_strings Options for RTC_MALLOC_CONFIG (continued)
Descriptionconfig_string Options
RTC_NO_ABORT must not be set.
If abort_on_nomem is set to 1, the batch mode aborts
execution when an out-of-memory condition is detected.
abort_on_nomem=[01]
The appropriate logfiles for the heap, leak, and corruption
detection are displayed on stderr. The logfiles are
directed to the specified file <filename>. Output is
appended to the file if the + option is used.
mem_logfile=stderr[+]filename
heap_logfile=stderr[+]filename
leak_logfile=stderr[+]filename
Debugging in Batch Mode
To debug an application in the batch mode, complete the following steps:
1. Compile the source files. On HP 9000 systems, you must map the shared libraries as private,
by using the chatr command
chatr +dbg enable ./<executable>
2. Set the following variables in the rtcconfig configuration file:
$ cat rtcconfig
"rtcconfig" 5 lines, 76 characters
set heap-check on
set heap-check free on
files=executable_name
output_dir= ./
3. Set the required environment variables as follows:
export BATCH_RTC=on
4. Load the application using the environmental variable LD_PRELOAD.
Set the environment variable, LD_PRELOAD as follows:
• For 32-bit applications running on Itanium
LD_PRELOAD=/opt/langtools/lib/hpux32/librtc.sl <executable> <arguments>
• For 64-bit applications running on Itanium
LD_PRELOAD=/opt/langtools/lib/hpux64/librtc.sl <executable> <arguments>
• For 32-bit applications running on PA-RISC
LD_PRELOAD=/opt/langtools/lib/librtc.sl <executable> <arguments>
• For 64-bit applications running on PA-RISC
LD_PRELOAD=/opt/langtools/lib/pa20_64/librtc.sl <executable> <arguments>
Supported Modes of Memory-debugging in WDB 59