Running your program with gdb can help you to find out where exactly the
un-aligned memory access happens.

Make sure program is compiled with debugging information. (gcc -g option)

To run program with gdb on target,

[EMAIL PROTECTED] ~]#gdb exe_name

Then 

(gdb) run

The program will start executing under control of gdb. When it crashes
execute 

(gdb) backtrace.

This should give you idea where exactly the alignment  trap occurs.

Regards,
Kalpesh


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Vladimir Pantelic
Sent: Friday, June 06, 2008 1:17 PM
To: undisclosed-recipients:
Cc: davinci-linux-open-source@linux.davincidsp.com
Subject: Re: Alignment trap problem

[EMAIL PROTECTED] wrote:
> hi ..
> 
>       I am trying to run an application on davinci .. i have successfully
> cross compiled the source .. and while running on on board .. its
> giving
> 
> alignment trap:
> bus error
> 
> and application will abort..
> 
> I have tried the same source for x86 machine and it worked fine .. i know
> this has to do something with arm memory alignment access .. please can
> anybody tel me how to solve this alignment trap issue .. .. or can tel me
> where in source code i can fix this ??

arm can access 16bit words only on 2 byte aligned addresses and 32 byte
words 
only on 4 byte aligned addresses.

X86 does not care, so a lot of X86 code accesses 16 and 32 unaligned. You'll

have to inspect your code and find the places where this happens, usual
suspects 
are char* pointer which are casted to complex structs.

The aligment trap should give you a hint where in your code this happened.

http://netwinder.osuosl.org/users/b/brianbr/public_html/alignment.html
http://www.mjmwired.net/kernel/Documentation/arm/mem_alignment

Regards,

Vladimir
_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to