Languages and Scripting

HP-UX_IA64_B.11.31_BUS_ADRALN

 
Phalgun
Occasional Advisor

Re: HP-UX_IA64_B.11.31_BUS_ADRALN

>r8 is a pointer.  It seems to increment that pointer by 8 and then extracts an int

 

I am not good at assembly, could you please help me understand how  did  you arrive at this conclusion?  

 

>What direction is "after"?  Please list your code

Starting from the bottom my code ends at Frame 14, and from Frame 13 to Frame 0 is the 3rd party (Oracle tuxedo) library. 

 

Also, I read in certain other similar threads on BUS_ADRDLN, sometimes this issue occurs because of misaligned offset of the certain members in data structure. I have a hunch that it could it the issue here as well, but what causes the certain members of a structure to be at misaligned? Should they compiler not take care of padding enough bytes and aligning the address of members?

Dennis Handly
Acclaimed Contributor

Re: HP-UX IA64 B.11.31 BUS_ADRALN

>could you help me understand how did you arrive at this conclusion? 

 

0xc00000000e8a3b80:0 <Foccur32+0x100>: adds r9=8,r8

0xc00000000e8a3ba0:0 <Foccur32+0x120>: (p6) ld4 r9=[r9]

 

Adds 8 to pointer in r8.  Then loads an int from that address.

 

>Starting from the bottom my code ends at Frame 14,

 

Since you don't own the code where it aborts, about the only thing you can do is to look at the abort location and see if that address is passed in from your function, N levels away.

 

You need to turn off optimization in your code.

You could also see if gdb can tell you the address of the variable:

info sym 0x600000000051f2fa

info mod 0x600000000051f2fa

 

>what causes the certain members of a structure to be at misaligned?

 

Either the user asked for packed structs or the user manually assembled the "struct" with byte moves.

 

>Should the compiler not take care of padding enough bytes and aligning the address of members?

 

The compiler will do exactly what it is told.  Either the data is from a file or network or the user asked for packed structs.

 

You may want to just give up on fiddling and just tell the hardware to do misaligned loads.  If your program then works, that's the problem.

http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/HTML_Online_Help/pragmas.htm#pragma-pack-ex4