Operating System - HP-UX
1753837 Members
8776 Online
108806 Solutions
New Discussion юеВ

structures behaviour 32 bit versus 64 bit

 
Bert Verhoeven
Occasional Advisor

structures behaviour 32 bit versus 64 bit

assignment of structure members works on 32 bit, but gives a core dump on 64 bit.

I compile

cc +DD64 structest.c

When I execute a.out. It gives a core dump when I assign p->next (or any other member)

What is causing this?

I attached the source code.

thanks
5 REPLIES 5
Paula J Frazer-Campbell
Honored Contributor

Re: structures behaviour 32 bit versus 64 bit

Hi Bert

Look at the core dump:-

Down load and install wdb:-

http://hp.com/go/wdb

fire up /opt/langtools/bin/gdb -c
"bt" will give a stack trace:-

(gdb) bt
#0 0xc01ecb88 in ??
#1 0xc01ecb68 in ?? ()
#2 0xc01ecb68 in ?? ()

or use "where"

There are two stored registers that will tell you the address being
accessed
and instruction the process was executing when it failed. In gdb or at
the
"(gdb)" command prompt in wdb, try:

(gdb) p /x $ior

This prints the "Interrupt Offset Register" that is the address the
program was trying to access when it failed.

(gdb) p /x $iir

This is the "Interrupt Instruction Register" that shows the machine instruction that caused the failure. To decode this start up a separate "adb" (adb) should already be installed ??? note it has no prompt and the $ prefixes each command - $q = quit) session and enter the value from the above command and follow it
with "=i". For example,

(gdb) p /x $iir
$2 = 0xfe01280

$ adb
0xfe01280=i
LDW 254,0(r31)
This is a Load word command being executed. See instructions set for PA Risc.

HTH

Paula


If you can spell SysAdmin then you is one - anon
Paula J Frazer-Campbell
Honored Contributor

Re: structures behaviour 32 bit versus 64 bit

Hi Also

Try a :-

what core
strings core
file core


Paula
If you can spell SysAdmin then you is one - anon
Bert Verhoeven
Occasional Advisor

Re: structures behaviour 32 bit versus 64 bit

What do I have to change in my source code to make this work on 64 bit? Is there something
wrong with declaration/allocation?
Paula J Frazer-Campbell
Honored Contributor

Re: structures behaviour 32 bit versus 64 bit

Bert

By looking at the core dump file it will/should indicate where in your code it is falling over and causing the dump.

Paula
If you can spell SysAdmin then you is one - anon
Bert Verhoeven
Occasional Advisor

Re: structures behaviour 32 bit versus 64 bit

Yes, It is failing over the assignment. But why?