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

NOTE: It is incorrect to use spaces before or after the ’=’ symbol in the batch mode configuration
options in the configuration file, rtcconfig. Additionally, it is incorrect to use spaces before the
batch mode configuration options.
For example:
Correct Usage:
$ cat rtcconfig
check_leaks=on
check_heap=on
files=batchrtc4
Incorrect Usage:
$ cat rtcconfig
check_leaks=on
check_heap = on
files=batchrtc4
Overriding the Configuration File Settings
The RTC_MALLOC_CONFIG variable enables you to override the default rtcconfig file settings.
Following is the syntax for exporting the configuration to RTC_MALLOC_CONFIG:
export RTC_MALLOC_CONFIG=config_string1[;config_strings]
The overriding settings of RTC_MALLOC_CONFIG are dependent on the global environment variable
RTC_NO_ABORT setting. RTC_NO_ABORT must not be set if the configuration strings must abort
the execution of the program on detection of the first occurrence of bounds, double-free, or
out-of-memory conditions.
If RTC_NO_ABORT is set to 1, the program does not abort for failed checks and you can view the
logfiles for all the failed checks in a single execution run.
Table 15 lists the config_strings options that are available for RTC_MALLOC_CONFIG. The
config_strings are separated by semicolon (;).
Table 15 The config_strings Options for RTC_MALLOC_CONFIG
Descriptionconfig_string Options
RTC_NO_ABORT must not be set.abort_on_bounds=[01]
If abort_on_bounds is set to 1, the batch mode aborts
execution of the program and reports the bounds condition,
when bound checking fails.
RTC_NO_ABORT must not be set.abort_on_bad_free=[01]
If abort_on_bad_free is set to 1, the batch mode aborts
execution when a free(), or a realloc() call attempts
to free a heap object that is not valid.
RTC_NO_ABORT must not be set.abort_on_nomem=[01]
If abort_on_nomem is set to 1, the batch mode aborts
execution when an out-of-memory condition is detected.
The appropriate logfiles for the heap, leak, and corruption
detection are displayed on stderr. The logfiles are
mem_logfile=stderr[+]filename
heap_logfile=stderr[+]filename
directed to the specified file <filename>. Output is
appended to the file if the + option is used.
leak_logfile=stderr[+]filename
Supported Modes of Memory-debugging in WDB 53