1820057 Members
2930 Online
109608 Solutions
New Discussion юеВ

Re: Segmentation Fault

 
SOLVED
Go to solution
rajanandhini
Advisor

Segmentation Fault

Hi,

We are in the process of migrating our old HP-UX 11.00, PA-RISC
architecture to a new HP-UX 11.23i, Itanium architecture. We have
compiled the codes and now we are testing the executables. While
running the executable, we get the following error.


SEGV_ACCERR - Invalid Permissions for object
#0 0x60000000c0340160:1 in _wrtchk+0x341 () from /usr/lib/hpux32/
libc.so.1


I am not sure why we are getting this error. Am pretty new to C and it
would great if someone can help me in this.


Thanks,
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: Segmentation Fault

You need to provide a complete stack trace. You use gdb's "bt" command.

I'm guessing you are trying to use fwrite(3)?
rajanandhini
Advisor

Re: Segmentation Fault

Thanks for your suggestion. We used bt and below is its result. Sorry that i forgot to add it before.
#0 0x60000000c0340160:1 in _wrtchk+0x341 () from /usr/lib/hpux32/libc.so.1
#1 0x60000000c0341b40:0 in fprintf+0x160 () from /usr/lib/hpux32/libc.so.1
#2 0x60000000c55865d0:0 in Initialize (su=0x40051800, genhdr=0)
at fab_elec.c:1143
#3 0x60000000c5584220:0 in fab_elec (su=0x40051800, suf=0x40068c30)
at fab_elec.c:345
#4 0x60000000c5501190:0 in MontFabricate (msfr=112) at fab.c:740
#5 0x4008160:0 in main (argc=5, argv=0x7ffff064) at fabrptmod.c:881

Please let me know if anything more is needed.
Dennis Handly
Acclaimed Contributor
Solution

Re: Segmentation Fault

#1 0x60000000c0341b40:0 in fprintf+0x160 /usr/lib/hpux32/libc.so.1

Unless you have a bad FILE* value, you should look at the parms to fprintf and make sure they match with the format.

If you have a fairly new C compiler, A.06.05 or later (the latest is A.06.14), the compiler will warn if there is a mismatch.