Debugging Dynamic Memory Usage Errors Using HP WDB (766161-001, March 2014)

will be absolute i.e. having information right from start of application run. Format/content of the
reports is same as of the normal batch mode report.
This feature is very useful for many applications, especially for long-running/daemon processes
which typically does not have an exit point or would not be viable to terminate.
Limitation:
The choice of the signal is important and should be done carefully. The signal you choose should
neither be generated nor be handled by the application/process you wish to monitor.
Steps for nudge triggered batch rtc reporting:
NOTE: This feature is available only on Itanium. These steps should be followed in conjunction
with batch mode debugging steps as explained in earlier section.
1. Set the following two RTC parameters in the rtcconfig file along with other setting like
check_heap, check_leaks etc.
$ cat rtcconfig
nudge=on
nudge_signal=2
check_heap=on
check_leaks=on
files=a.out
2. Start the application under RTC batch mode. Make sure that right rtcconfig file with above
mentioned settings is picked.
$ ./a.out
RTC_INFO: rtcconfig file being processed:"./rtcconfig".
RTC_INFO: nudge signal = 2.
3. To generate the RTC reports at any point in time during execution, send the assigned nudge
signal to the process using kill command (or since in the given example the assigned nudge
signal is 2 (SIGINT) it can be generated using keyboard by pressing Ctrl+c). Reports can be
generated multiple times during the same run. Each report has time stamp appended to the
name of the RTC reports so that they are not overwritten. Eg:
$ kill -2 <PID of a.out>
RTC_INFO: Nudge signal (= 2) received.
RTC_INFO: Generating requested RTC reports...
RTC_INFO: Memory leak info is written to "a.out.23334.leaks.19-Feb.11-45-55".
RTC_INFO: Memory heap info is written to "a.out.23334.heap.19-Feb.11-45-55".
RTC_INFO: Nudge signal (= 2) received.
RTC_INFO: Generating requested RTC reports...
RTC_INFO: Memory leak info is written to "a.out.23334.leaks.19-Feb.11-46-01".
RTC_INFO: Memory heap info is written to "a.out.23334.heap.19-Feb.11-46-01".
Debugging Multiple Applications in Batch Mode
To debug multiple applications in the batch mode, complete the following steps:
1. Compile the source files.
2. Set the required variables in the rtcconfig configuration file, as follows:
$ cat rtcconfig
"rtcconfig" 5 lines, 83 characters
set heap-check on
set heap-check free on
files=exec1:exec2:exec3
output_dir= ./
3. Set the required environment variables as follows:
export BATCH_RTC=on
58