Operating System - Linux
1753781 Members
7423 Online
108799 Solutions
New Discussion юеВ

Problems with BUS_ADRALN - Invalid address alignment on Itanium

 
Michael Stricker
New Member

Problems with BUS_ADRALN - Invalid address alignment on Itanium

With Itanium and HP-UX 11.23 I cant execute a programm compiled with

aCC: HP aC++/ANSI C B3910B A.06.10 [Mar 22 2006]

Options:

+DD32 -Ae -Wl,+s -z -g

I always get:
BUS_ADRALN - Invalid address alignment

ret_value->lfd_wert.string= &string_tab[eintrag_ptr->eintrags_wert.index_string];

On 7 other plattform this program and code is running for years without problems and changing, including PA-Risc HPUX 11.11B and HPUX 10.20. I don't understand why it doesn't run.

Any ideas?


Moved from HP-UX Technical Documentation to HP-UX > languages

5 REPLIES 5
Dennis Handly
Acclaimed Contributor

Re: Problems with BUS_ADRALN - Invalid address alignment on Itanium

You'll have to provide the types (.string and string_tab) and addresses. But the signal says you have a misaligned field.
Michael Stricker
New Member

Re: Problems with BUS_ADRALN - Invalid address alignment on Itanium

string_tab is a simple unsigned char pointer:

unsigned char *string_tab;

index_string is a long value:

typedef long Index;
Index index_string;

I don't unterstand that this code is running for years without changing on different plattforms, even on Sun Solaris, which compiler is very ambitious.
Michael Stricker
New Member

Re: Problems with BUS_ADRALN - Invalid address alignment on Itanium

Hmm, running with wdb program runs to another code with the same error. Previous error is gone ???
Dennis Handly
Acclaimed Contributor

Re: Problems with BUS_ADRALN - Invalid address alignment on Itanium

You may want to break up the expression so you can see if it is eintrag_ptr or ret_value that is bad. A disassembly and register dump would be useful:

disas $pc-16*8 $pc+16
info reg
Michael Stricker
New Member

Re: Problems with BUS_ADRALN - Invalid address alignment on Itanium

I've found the error, union and alignment is the problem:

old:
struct Eintrag {
unsigned char eintrags_art;
union Eintrags_wert {
unsigned short eintrags_laenge;

new:

struct Eintrag {
unsigned char eintrags_art;
union Eintrags_wert {
long eintrags_laenge;

the same trouble we had with old Sinix Unix a long time before.

But thx for your suggestions and help.