I want to solve the bus error.

619 views
Skip to first unread message

tora

unread,
Sep 4, 2009, 9:31:27 PM9/4/09
to android-ndk
Hello

I cannot solve the problem about bus error.
My Native C source process is normally completed.
But when Native C return. stack error is output.

I examined this is because bus error (non-existent address or
unaligned access ).

and I want to use addr2line to check function name form address ( pc
ad016248 ) , but I could not.
( build/prebuilt/darwin-x86/arm-eabi-4.2.1/bin/arm-eabi-addr2line )

Does anyone know how to use this tool ?
Or does anyone know how to solve bus error in ndk ?


(Java source call Native C)
-> (Native C process)
-> (and when return from Native C, then stack error is output.)

09-05 10:06:56.140: INFO/DEBUG(539): *** *** *** *** *** *** *** ***
*** *** *** *** *** *** *** ***
09-05 10:06:56.140: INFO/DEBUG(539): Build fingerprint: 'generic/sdk/
generic/:1.5/CUPCAKE/148875:eng/test-keys'
09-05 10:06:56.140: INFO/DEBUG(539): pid: 702, tid: 702 >>>
com.test038 <<<
09-05 10:06:56.140: INFO/DEBUG(539): signal 7 (SIGBUS), fault addr
00000000
09-05 10:06:56.150: INFO/DEBUG(539): r0 00000000 r1 00000328 r2
0b0e0a0a r3 060a0a0a
09-05 10:06:56.150: INFO/DEBUG(539): r4 00000003 r5 40008238 r6
0a0a0a11 r7 4100d100
09-05 10:06:56.150: INFO/DEBUG(539): r8 00000000 r9 435e3b30 10
40008238 fp ad083e10
09-05 10:06:56.150: INFO/DEBUG(539): ip 400081e8 sp beea7458 lr
00000003 pc ad016248 cpsr 20000010
09-05 10:06:56.220: INFO/DEBUG(539): #00 pc 00016248 /
system/lib/libdvm.so
09-05 10:06:56.240: INFO/DEBUG(539): #01 pc 00016be8 /
system/lib/libdvm.so
09-05 10:06:56.250: INFO/DEBUG(539): #02 pc 0001535c /
system/lib/libdvm.so
09-05 10:06:56.271: INFO/DEBUG(539): #03 pc 00047c94 /
system/lib/libdvm.so

David Turner

unread,
Sep 7, 2009, 7:45:32 AM9/7/09
to andro...@googlegroups.com
On Fri, Sep 4, 2009 at 6:31 PM, tora <kog...@gmail.com> wrote:

Hello

I cannot solve the problem about bus error.
My Native C source process is normally completed.
But when Native C return. stack error is output.


This is  a common symptom of stack corruption, if that can help.
 

tora

unread,
Sep 7, 2009, 9:21:11 AM9/7/09
to android-ndk
Hello, and thank you for your reply!

I'm trying to release every variables, but I cannot solve this
problem.
Anyway, thank you for your great hint!


On 9月7日, 午後8:45, David Turner <di...@android.com> wrote:

tora

unread,
Sep 14, 2009, 6:02:39 AM9/14/09
to android-ndk
Hello

I finally fixed this problem.
The Solution is simple.

In my native C code, I only initialize the variable.

char abc[10] = "";

That's all, and this is quite important thing.
I never forget this.
Reply all
Reply to author
Forward
0 new messages