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

Pre-loading the Appropriate Version of librtc.[sl|so] Along With the Application
The appropriate version of the librtc.[sl|so] runtime library must be preloaded to enable
batch mode and attach mode memory debugging of an application.
You can explicitly preload librtc.[sl|so] from the appropriate path by using the LD_PRELOAD
environment variable.
Alternately you can use the +rtc <enable|disable> option for the chatr command to
automatically preload librtc.[sl|so]. Both of these methods are illustrated in this section.
NOTE: The +mem_check <enable> option for the chatr command is available for dynamic
linker versions B.11.61 and later on HP 9000 systems, and dynamic linker versions B.12.46
and later on Integrity systems.
The +rtc <enable> option for the chatr command is available for dynamic linker versions
B.11.66 and later on HP 9000 systems, and dynamic linker versions B.12.51 and later on
Integrity systems. However, +mem_check option is retained with the latest Linker version.
Using chatr +rtc to Automatically Preload librtc.[sl|so]
To automatically preload librtc.[sl|so] by using the +rtc <enable|disable> for the
chatr command, enter the following command at the HP-UX prompt:
$ chatr +rtc <enable> <executable>
In addition to automatically loading librtc.[sl|so], the +rtc option for the chatr command
also maps the shared libraries as private. The +rtc option preloads librtc.[sl|so] from
the following default paths for librtc.[sl|so] :
- For 32 bit IPF applications
/opt/langtools/lib/hpux32/librtc.so
For 64 bit IPF applications,
/opt/langtools/lib/hpux64/librtc.so
For 32 bit PA applications,
opt/langtools/lib/librtc.sl
For 64-bit PA applications,
/opt/langtools/lib/pa20_64/librtc.sl
NOTE: To preload from a path that is different from the default paths, you must use the
LD_PRELOAD environment variable.
Using LD_PRELOAD TO Preload librtc.[sl|so]
To explicitly preload an appropriate version of librtc.[sl|so] with the application, set the
environment variable, LD_PRELOAD as follows:
For 32-bit applications running on Itanium,
LD_PRELOAD=/opt/langtools/lib/hpux32/librtc.so <executable> <arguments>
For 64-bit applications running on Itanium,
LD_PRELOAD=/opt/langtools/lib/hpux64/librtc.so <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>
50