Debugging Dynamic Memory Usage Errors Using HP WDB (5900-1474; WDB 6.2; January 2011)
4. You can use the +rtc <enable|disable> option for the chatr command to
automatically preload librtc.[sl|so] or you can explicitly preload
librtc.[sl|so] from the appropriate path by using the LD_PRELOAD environment
variable.
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.
To preload the librtc.[sl|so] runtime library, complete one of the following
steps:
• 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>
NOTE: To preload from a path , which is different from the default path, you
must use the LD_PRELOAD environment variable.
• 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>
If LD_PRELOAD and chatr +rtc are used to preload the
librtc.[sl|so] runtime library, librtc[sl|so] is loaded from the
path specified by LD_PRELOAD.
NOTE: If the application invokes calls such as system(3s), and popen(),
which invoke a new shell, librtc.[sl|so] must not be loaded to the invoked
shell. You must use LD_PRELOAD_ONCE, instead of LD_PRELOAD, to exclusively
load thelibrtc.[sl|so] file to the calling process only.
68