Operating System - HP-UX
1827724 Members
3109 Online
109968 Solutions
New Discussion

Re: a library with debugging information is working fine but without that is not working.

 
SOLVED
Go to solution
ankur saxena
Occasional Advisor

a library with debugging information is working fine but without that is not working.

i build a library with debugging information and used , its works fine.
when i build that with out debugging information it soesnt work.
the thing is i am using optimization Level 3 for compiling. when we build with debugging info the optimization level is decreased to 2 . may b that removes some of the symbols.
But when i built that with +O2 that still didnt work.
the compiulation string i m using is
+O2 +Oconservative +Ovolatile +Onofail_safe +Ofastaccess +Onopipeline +ESlit
13 REPLIES 13
Vibhor Kumar Agarwal
Esteemed Contributor

Re: a library with debugging information is working fine but without that is not working.

Can you give us the error.
Vibhor Kumar Agarwal
Arunvijai_4
Honored Contributor

Re: a library with debugging information is working fine but without that is not working.

Hello,

Is it a shared library or archive ? What error message you get when it loads ? Try to give more information possible,

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: a library with debugging information is working fine but without that is not working.

how did you compile for debugging information? (Flags).

what is the error message you are getting when using that library? Change optimization level to 3 as +03 and compile with debug symbols.

check symbols information with odump or elfdump.

--
Muthu
Easy to suggest when don't know about the problem!
ankur saxena
Occasional Advisor

Re: a library with debugging information is working fine but without that is not working.

the problem is not coming at loading the library. its coming at the time of call of some functions.
whats happenening is when we are compiling with -g option some extra symbols are coming as compared with the compilation without -g symbols. Means it is removing some symbols at compilation with +O3 flag. and at run time those symbols are required.
only core dump is coming during execution of the program.
since it is very big project its difficult to track the exact point of failure.
can anyone suggest me the probable reasons whic can lead to such type of errors?
Arunvijai_4
Honored Contributor

Re: a library with debugging information is working fine but without that is not working.

Hello,

Tyr running your application with "tusc" to find out where exactly it core dumps. "tusc" can be downloaded from,
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-7.8/

-Arun
P.S Remember to assign points.
"A ship in the harbor is safe, but that is not what ships are built for"
ankur saxena
Occasional Advisor

Re: a library with debugging information is working fine but without that is not working.

cc -c -Ae +O3 +Oconservative +Ovolatile +Onofail_safe +Ofastaccess +Onopipeline +ESlit -D_HP
UX_SOURCE -DHP -DSYSV -DCDF -DUNIX -DTND -D__HP_NO_STRING_OVERLOADS -DB1000 +DAportable

this s the compile string

ld -b -o ../lib/libpig.sl cachain.o cactime.o caulic.o camsgf.o dbgwrite.o casig.o castring.o CAgetenv.o catrans.o catstenv.o capstat.o capstats.o caimsgv.o caimsgio.o calic.o liccciem.o cad.o CAchmod.o CAget_tty.o enf_exists.o SIGNAL.o casetusr.o ca_hostname.o casrcpth.o caddcpath.o execgenrs.o pwcrypt.o ca_nodename.o ca_nodename_has.o caprof.o structpk.o caregex.o cauwvapi.o sdsapi.o cauwvsaf.o cauwvsds.o casystype.o quehlp.o cawcmbcn.o ufcmpcnv.o match.o calocale.o cmlocale.o caping.o camfunc.o dynlib.o chkemcci.o loaddll2.o cauemevt_ldr.o cauopr_ldr.o -lnsl -lpthread -ldld -lm -lcrypt -L/opt/CA/CAlib -lccimt -lenf


THIS IS THE BUILD STRING.
Arunvijai_4
Honored Contributor
Solution

Re: a library with debugging information is working fine but without that is not working.

Hello,

One more thing, have you applied all necessary latest pathces related to compiler and linker ? Probably, this could be due to a known bug with +O3. You can download patches from, http://www1.itrc.hp.com/service/patch/search.do?BC=patch.breadcrumb.main|&pageContextName=hpux:::

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
ankur saxena
Occasional Advisor

Re: a library with debugging information is working fine but without that is not working.

i found a segment of code in a c file.
in the C program a function call is there.
the definition of the called is in different library.
there is no conditional check to execute that function call (means taht statement has to be executed always).
on compilation with -g option that symbol is there in its object file but on compiling without -g option the symbol is not found in that object file. i used nm to do that.
ankur saxena
Occasional Advisor

Re: a library with debugging information is working fine but without that is not working.

Arun,
can you please help me in finding out the patch for the +O3 problem. i tried the making the hostname.fs file on my system and uploaded that on the site. there are atoo many patches coming .so what to apply here.?
i am attaching the hostname.fs file here.
please help me.
Arunvijai_4
Honored Contributor

Re: a library with debugging information is working fine but without that is not working.

Hi Ankur,

You can post this question to the following Mailing lists, you will defintely find an answer there.

http://h21007.www2.hp.com/dspp/ml/ml_MailingLists_IDX/1,1275,,00.html#24

C++ Mailing list

http://h21007.www2.hp.com/dspp/ml/ml_MailingLists_IDX/1,1275,,00.html#4

HP-UC Dev tools mailing list.

Also, Do you have PHSS_32509 installed on your system, just check that as well.

http://www2.itrc.hp.com/service/patch/patchDetail.do?BC=patch.breadcrumb.main|patch.breadcrumb.search|&patchid=PHSS_32509&context=hpux:800:11:11

-Arun

P.S Rememer to assign points.
"A ship in the harbor is safe, but that is not what ships are built for"
ankur saxena
Occasional Advisor

Re: a library with debugging information is working fine but without that is not working.

hi Arun,
i have applied the patch PSS_32509 and then built the library.
its still not working.
kindly give me another approach of solving the problem.

-Ankur
Arunvijai_4
Honored Contributor

Re: a library with debugging information is working fine but without that is not working.

Hi Anukur,

Have you posted your question to HP C++ mailing lists ? If not, do so now.. Compiler gurus from HP will answer your question right away.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Andrew Merritt_2
Honored Contributor

Re: a library with debugging information is working fine but without that is not working.

No definite answers, but some suggestions.

If the problem doesn't occur with symbols present, but does without, that most likely indicates a problem with the C code you're compiling. It doesn't necesarily mean a problem with the compiler. (By the way, is it C or C++ code?)

This can happen if the code is accessing locations it shouldn't, e.g. due to unitialised values. When you compile with symbols included that can hide the problem because you might land on memory locations that have sensible values in.

You should check your malloc() usage, and make sure everything is initialised before use.

Use lint, and pay attention to any warnings from the compiler, too. Use a memory checking library, or a tool such as purify (if that's still around) to make sure your only using initialised memory. (For example, one fault is to malloc some memory, free it, but still use the pointer to it later.)

Andrew