Re: Alignment trap problem

2008-06-06 Thread Vladimir Pantelic

[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


RE: Alignment trap problem

2008-06-06 Thread Kalpesh Rathod
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


Re: Alignment trap problem

2008-06-06 Thread munez . bn
hi
thank you for the reply

this is what im getting

Alignment trap: application(1198) PC=0x4074fcf0 Instr=0xe49c2004
Address=0x000e96d6 FSR 0x013

so how can i look in to this?





 [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


RE: Alignment trap problem

2008-06-06 Thread munez . bn
gdb output .. it kils gdb itself so cant run backtrace



oom-killer: gfp_mask=0x1d2
DMA per-cpu:
cpu 0 hot: low 14, high 42, batch 7
cpu 0 cold: low 0, high 14, batch 7
Normal per-cpu: empty
HighMem per-cpu: empty

Free pages:1376kB (0kB HighMem)
Active:24216 inactive:455 dirty:0 writeback:0 unstable:0 free:344 slab:886
mapped:23908 pagetables:113
DMA free:1376kB min:1400kB low:1748kB high:2100kB active:96864kB
inactive:1820kB present:122880kB pages_scanned:100532 all_u
nreclaimable? yes
protections[]: 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
protections[]: 0 0 0
HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
protections[]: 0 0 0
DMA: 0*4kB 0*8kB 0*16kB 1*32kB 1*64kB 0*128kB 1*256kB 0*512kB 1*1024kB
0*2048kB 0*4096kB = 1376kB
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Out of Memory: Killed process 1246 (sshd).





 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



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


RE: Alignment trap problem

2008-06-06 Thread Kalpesh Rathod
If code is compiled with debugging information, gdb gives source level
information. File name and line number when crash occurs.

You can use -g option while compiling. There are other options as well.
Please see gcc man page for that.

Regards,
Kalpesh

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Friday, June 06, 2008 2:35 PM
To: davinci-linux-open-source@linux.davincidsp.com
Subject: Re: Alignment trap problem

hi
thank you for the reply

this is what im getting

Alignment trap: application(1198) PC=0x4074fcf0 Instr=0xe49c2004
Address=0x000e96d6 FSR 0x013

so how can i look in to this?





 [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

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


RE: Alignment trap problem

2008-06-06 Thread munez . bn
i know that .. its an application source code .. and its huge .. and
debugging is  enabled.. but gdb doesnt crash .. its giving following
output


oom-killer: gfp_mask=0x1d2
DMA per-cpu:
cpu 0 hot: low 14, high 42, batch 7
cpu 0 cold: low 0, high 14, batch 7
Normal per-cpu: empty
HighMem per-cpu: empty

Free pages:1400kB (0kB HighMem)
Active:24173 inactive:558 dirty:0 writeback:0 unstable:0 free:350 slab:877
mapped:23950 pagetables:101
DMA free:1400kB min:1400kB low:1748kB high:2100kB active:96692kB
inactive:2232kB present:122880kB pages_scanned:100152 all_u
nreclaimable? yes
protections[]: 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
protections[]: 0 0 0
HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
protections[]: 0 0 0
DMA: 0*4kB 1*8kB 1*16kB 1*32kB 1*64kB 0*128kB 1*256kB 0*512kB 1*1024kB
0*2048kB 0*4096kB = 1400kB
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Out of Memory: Killed process 983 (rpc.statd).





 If code is compiled with debugging information, gdb gives source level
 information. File name and line number when crash occurs.

 You can use -g option while compiling. There are other options as well.
 Please see gcc man page for that.

 Regards,
 Kalpesh

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf
 Of
 [EMAIL PROTECTED]
 Sent: Friday, June 06, 2008 2:35 PM
 To: davinci-linux-open-source@linux.davincidsp.com
 Subject: Re: Alignment trap problem

 hi
 thank you for the reply

 this is what im getting

 Alignment trap: application(1198) PC=0x4074fcf0 Instr=0xe49c2004
 Address=0x000e96d6 FSR 0x013

 so how can i look in to this?





 [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

 ___
 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


Re: Alignment trap problem

2008-06-06 Thread Lisa Parratt

[EMAIL PROTECTED] wrote:

Out of Memory: Killed process 983 (rpc.statd).
  

I think the last line is the most informative. Maybe add some (more) swap?

--
Lisa

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


Re: Alignment trap problem

2008-06-06 Thread Matthias Welwarsky

Lisa Parratt wrote:

[EMAIL PROTECTED] wrote:

Out of Memory: Killed process 983 (rpc.statd).
  
I think the last line is the most informative. Maybe add some (more) 
swap?


Actually, I think the program died due to memory exhaustion before ever 
running into the alignment trap. Running both gdb and the software seems 
to be too much. You should try post-mortem debugging with core dumps 
instead.


regards,
   matthias

--
* Matthias Welwarsky
Project Manager Software
Germany

*



This  email  and any  files  transmitted  with it are  confidential  and are
intended solely  for the use of the individual  or entity to which  they are
addressed.  Access to this e-mail by anyone else is unauthorised. If you are
not the  intended recipient,  any disclosure,  copying,  distribution or any
action taken or omitted to be taken in reliance on it, is prohibited. E-mail
messages are not necessarily secure.  Archos does not accept  responsibility
for any changes made to this message after it was sent.

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


Re: Alignment trap problem

2008-06-06 Thread Bernard Blackham

[EMAIL PROTECTED] wrote:

this is what im getting

Alignment trap: application(1198) PC=0x4074fcf0 Instr=0xe49c2004
Address=0x000e96d6 FSR 0x013

so how can i look in to this?


Start gdb on the process but don't run it. Just type l *0x4074fcf0 and 
it should point you at the offending code (assuming you've got debug 
symbols compiled in). It won't give you a backtrace though - as Matthias 
mentioned, you'll need a coredump for that.


This is also assuming that the code is not in a dynamically loaded 
library, and that /proc/sys/kernel/randomize_va_space is turned off (on 
newer kernels at least - it doesn't seem to be in the montavista one).


HTH,

Bernard.

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