Operating System - Linux
1751976 Members
4609 Online
108784 Solutions
New Discussion юеВ

Re: Tools for performance monitoring/memory checks

 
Miguel Silva Rentes
Regular Advisor

Tools for performance monitoring/memory checks

Hi everynone!

I want to know if there are performance tools for HP-UX and/or some kind of tool that can check in a given C program for memory leaks, incorrect C coding, etc.

I have a C process that is crashing while doing a simple SQL update (I'm using Pro C and an Oracle DB server version 10.2.0.2) and I want to know if there are some kind of memory leaks or incorrect C coding in this process.
So, I need to know if there are tools that can help me with this crash.

I also believe that the problem is not on the Oracle side because this process is the only one that crashes in a set of processes that makes SQL update/inserts/deletes, all with no problem.

If you can point to me some URLs or documentation I'd be very appreciated.

Best regards,

Miguel Rentes
9 REPLIES 9
Dennis Handly
Acclaimed Contributor

Re: Tools for performance monitoring/memory checks

Are you on PA or IPF? For Integrity there is +check= options to check for various errors. It also has +check=malloc for heap problems using gdb:
http://www.hp.com/go/wdb
http://docs.hp.com/en/10946/options.htm#opt+checkalloption

For PA, there is just gdb's heap checking.

Also on PA and IPF is Cadvise to check for coding errors:
http://www.hp.com/go/cadvise

For IPF performance tools there is caliper:
http://www.hp.com/go/caliper
Miguel Silva Rentes
Regular Advisor

Re: Tools for performance monitoring/memory checks

Hi,

I'm in a HP-UX 11iv2 (11.23) Itanium 2 server.

I'm checking out caliper and the flag +check=all.

Thank you very much!

Best regards,

Miguel Rentes
Miguel Silva Rentes
Regular Advisor

Re: Tools for performance monitoring/memory checks

Hi,

While inserting the flag +check=all at compile and linkage time, the linker can't find librtc and I've done a find on the file system and there is no library with such name. Do I have to download it somewhere?

This is the linkage snapshot:

cc +DD64 +tru64 -mt -Wl,+as,mpas -D_NO_PROTO -DDEBUG_PRINT -D__alpha -D_XOPEN_SOURCE_EXTENDED +check=all -D__ORACLE__ -D__hpux -DDEBUG_PRINT -g0 -DSTRINGS_ALIGNED -DSNAPSHOT -D_BSD -I/usr/include -I/scatex/13/scatex/hdr -I/scatex/13/scatex/lib -I/usr/include/X11R6 -I/usr/include/Motif2.1 -g0 -o arc arc.o slow_arc.o fast_arc.o ddb_arc.o /scatex/13/sxbin/libsx_ora.a /scatex/13/sxbin/libseemdb_ora.a /scatex/13/sxbin/libelcmdb_ora.a /scatex/13/sxbin/libpaco_ora.a /scatex/13/sxbin/libarc_ora.a -lMrm -lXm -lXt -lX11 -lclntst10 -lnsl -lpthread -lCsup -lunwind -lm
ld: Can't find library for -lrtc
Fatal error.
*** Error exit code 1

Stop.

Regards,

Miguel Rentes
Miguel Silva Rentes
Regular Advisor

Re: Tools for performance monitoring/memory checks

Just found the librtc I was looking for =)

This is what I found:

./opt/langtools/lib/hpux32/librtc_aux.a
./opt/langtools/lib/hpux32/librtc.so.1
./opt/langtools/lib/hpux64/librtc_aux.a
./opt/langtools/lib/hpux64/librtc.so.1

Sorry!

I'll link my process with ./opt/langtools/lib/hpux64/librtc.so.1
and give it a try.

Regards,

Miguel Rentes
Dennis Handly
Acclaimed Contributor

Re: Tools for performance monitoring/memory checks

>the linker can't find librtc

If you haven't fiddled with LPATH, the linker should find in in /opt/langtools/lib/hpux??/.

-I/usr/include

You should NOT specify the default include path, remove it.

>I'll link my process with /opt/langtools/lib/hpux64/librtc.so.1

This should automatically happen.

Also you can use +wlint for code analysis.
Miguel Silva Rentes
Regular Advisor

Re: Tools for performance monitoring/memory checks

Hi Dennis,

>If you haven't fiddled with LPATH, the >linker should find in >in /opt/langtools/lib/hpux??/.

I did a

"setenv LPATH /opt/langtools/lib/hpux64:$LPATH"

and the linkage worked fine after that.


>-I/usr/include

>You should NOT specify the default include >path, remove it.

Why should I remove this include? I can't seem to realize why does it make such a big difference...

Regards,

Miguel
Dennis Handly
Acclaimed Contributor

Re: Tools for performance monitoring/memory checks

>I did a "setenv LPATH /opt/langtools/lib/hpux64:$LPATH" and the linkage worked fine after that.

Yes but you shouldn't be using LPATH at all. It is reserved for the driver.

>Why should I remove this include? I can't seem to realize why does it make such a big difference...

Because it is a common mistake, especially with aCC. By adding the default in the wrong place, you may be messing up some complex set of -I paths that the driver supplies.
Miguel Silva Rentes
Regular Advisor

Re: Tools for performance monitoring/memory checks

Hi Dennis,

Thanks for your reply.

I've set the LPATH environment variable because it was the only way that ld could find librtc. If I don't set LPATH how can I make ld find that librtc in /opt/langtools/lib/hpux64 ? I tested setting LD_LIBRARY_PATH and SHLIB_PATH and didn't work. Only setting LPATH did the job.

Regarding "-I/usr/include" I will take it out.

Thanks for the advices!

Best regards,

Miguel Rentes
Dennis Handly
Acclaimed Contributor

Re: Tools for performance monitoring/memory checks

>I've set the LPATH environment variable because it was the only way that ld could find librtc.

The driver should automatically set LPATH for you, if not already set.