Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Unaligned access debugging

j_elston
Beginner
283 Views
I am receiving warnings like thus:

myprog.x(14285): unaligned access to 0x6000000000e6012c, ip=0x2000000002e8da10

on an Itanium. I understand this is where I'm mixing variables of two diferent types. Ok, I can solve this. My question is how do I locate where this is happening?

I've been using IDB 7.3 and commands such as "catch unaligned, stop unaligned" from the debugger manual but the when executing under the debugger the program just continues straight past where the access is occurring and even suppresses these warnings.

How do I make the debugger stop at this signal and how do I go directly to where the access warning is occuring from the information provided ( 0x6000000000e6012c, ip=0x2000000002e8da10 ).

Excuse the simplicity of the question, but can't seem to figure this out.

J
0 Kudos
2 Replies
TimP
Honored Contributor III
283 Views
Did you try passing --print-map to ld?
0 Kudos
j_elston
Beginner
283 Views
Thanks,

but still a little puzzled

here's why:

I traced this "unaligned access" call to calling to "C" object. The C function is defined as follows:

void df_linux_(char* path,
int* size,
char* dev_name,
int* status,
int length_path,
int length_dev)

and is called from Fortran as:

CALL df_linux(FILESPEC0, DRIVE0WAVAIL, DEVICE, STATUS)

DRIVE0WAVAIL & STATUS are defined as INT*4's

the discrepancy of two extra integers is due to the aspect of passing character arrays and that the "Fortran Compiler User Guide" specifies that an extra integer (not int pointers) must be added for each character array.

Ok, My next query. (on a IA-64) is the integer type added by the compiler of the type int*4 (natural if passing to a C function) or of type int*8 ( the default on IA-64) and is this variable influenced by compiler specification of integer type (-i4, -i8 ... ) ?


The --print-map option mapped this bug to the DRIVE0WAVAIL variable in a common block "MEMORY".

to be exact the unligned access was at:
unaligned access to 0x6000000000e6012c, ip=0x2000000002e8da10
the linker map shows:
0x6000000000e60110 memory_
0x6000000000e60140 filedriv_


but I assume that I have this correct as I passing the address of a int*4 to and integer pointer in C .

?
0 Kudos
Reply