Getting the signal 11 (SIGSEGV), fault addr deadbaad in Android

4.5k views Asked by At

I am building a C\C++ native application for android, trying to run it on android but I get the following error:

02-14 14:05:40.261: INFO/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-14 14:05:40.261: INFO/DEBUG(31): Build fingerprint: 'generic/sdk/generic/:2.2/FRF91/43546:eng/test-keys'
02-14 14:05:40.280: INFO/DEBUG(31): pid: 467, tid: 467  >>> com.keypoint_tech.adaptxt.inputmethod.core.testAdaptxt <<<
02-14 14:05:40.280: INFO/DEBUG(31): signal 11 (SIGSEGV), fault addr deadbaad
02-14 14:05:40.292: INFO/DEBUG(31):  r0 00000000  r1 00000000  r2 00000027  r3 00000000
02-14 14:05:40.292: INFO/DEBUG(31):  r4 00000000  r5 deadbaad  r6 00001728  r7 44f35010
02-14 14:05:40.292: INFO/DEBUG(31):  r8 430be000  r9 43170000  10 0000001d  fp beb92724
02-14 14:05:40.302: INFO/DEBUG(31):  ip ffffffff  sp beb92448  lr afd154c5  pc afd11dc4  cpsr 40000030
02-14 14:05:40.851: INFO/DEBUG(31):          #00  pc 00011dc4  /system/lib/libc.so
02-14 14:05:40.851: INFO/DEBUG(31):          #01  pc 00006ecc  /system/lib/libcutils.so
02-14 14:05:40.871: INFO/DEBUG(31): code around pc:
02-14 14:05:40.881: INFO/DEBUG(31): afd11da4 1c2bd00b 2d00682d e026d1fb 2b0068db 
02-14 14:05:40.891: INFO/DEBUG(31): afd11db4 4e17d003 51a02001 4d164798 24002227 
02-14 14:05:40.891: INFO/DEBUG(31): afd11dc4 f7fb702a 2106ee14 ef10f7fc 05592380 
02-14 14:05:40.900: INFO/DEBUG(31): afd11dd4 6091aa01 1c116054 94012006 eab6f7fc 
02-14 14:05:40.910: INFO/DEBUG(31): afd11de4 2200a905 f7fc2002 f7fbeac2 2106ee00 
02-14 14:05:40.910: INFO/DEBUG(31): code around lr:
02-14 14:05:40.910: INFO/DEBUG(31): afd154a4 b0834a0d 589c447b 26009001 686768a5 
02-14 14:05:40.910: INFO/DEBUG(31): afd154b4 220ce008 2b005eab 1c28d003 47889901 
02-14 14:05:40.922: INFO/DEBUG(31): afd154c4 35544306 d5f43f01 2c006824 b003d1ee 
02-14 14:05:40.922: INFO/DEBUG(31): afd154d4 bdf01c30 0002ae7c 000000d4 1c0fb5f0 
02-14 14:05:40.922: INFO/DEBUG(31): afd154e4 43551c3d a904b087 1c16ac01 604d9004 
02-14 14:05:40.922: INFO/DEBUG(31): stack:
02-14 14:05:40.932: INFO/DEBUG(31):     beb92408  000006fd  
02-14 14:05:40.961: INFO/DEBUG(31):     beb9240c  afd1453b  /system/lib/libc.so
02-14 14:05:40.961: INFO/DEBUG(31):     beb92410  afd40498  /system/lib/libc.so
02-14 14:05:40.961: INFO/DEBUG(31):     beb92414  afd41c14  /system/lib/libc.so
02-14 14:05:40.961: INFO/DEBUG(31):     beb92418  00000000  
02-14 14:05:40.961: INFO/DEBUG(31):     beb9241c  afd154c5  /system/lib/libc.so
02-14 14:05:40.961: INFO/DEBUG(31):     beb92420  6f737265  
02-14 14:05:40.981: INFO/DEBUG(31):     beb92424  afd1450d  /system/lib/libc.so
02-14 14:05:40.981: INFO/DEBUG(31):     beb92428  50776569  
02-14 14:05:40.981: INFO/DEBUG(31):     beb9242c  afd40328  /system/lib/libc.so
02-14 14:05:40.981: INFO/DEBUG(31):     beb92430  00000000  
02-14 14:05:40.981: INFO/DEBUG(31):     beb92434  00001728  
02-14 14:05:40.981: INFO/DEBUG(31):     beb92438  44f35010  /dev/ashmem/mspace/dalvik-heap/2 (deleted)
02-14 14:05:40.991: INFO/DEBUG(31):     beb9243c  afd147ab  /system/lib/libc.so
02-14 14:05:40.991: INFO/DEBUG(31):     beb92440  df002777  
02-14 14:05:40.991: INFO/DEBUG(31):     beb92444  e3a070ad  
02-14 14:05:41.002: INFO/DEBUG(31): #00 beb92448  696a202c  
02-14 14:05:41.002: INFO/DEBUG(31):     beb9244c  202c746e  
02-14 14:05:41.002: INFO/DEBUG(31):     beb92450  746e696a  
02-14 14:05:41.002: INFO/DEBUG(31):     beb92454  696a202c  
02-14 14:05:41.012: INFO/DEBUG(31):     beb92458  2029746e  
02-14 14:05:41.012: INFO/DEBUG(31):     beb9245c  fffffbdf  
02-14 14:05:41.012: INFO/DEBUG(31):     beb92460  beb9264c  [stack]
02-14 14:05:41.012: INFO/DEBUG(31):     beb92464  400092e8  /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)
02-14 14:05:41.012: INFO/DEBUG(31):     beb92468  00000002  
02-14 14:05:41.012: INFO/DEBUG(31):     beb9246c  af906ecf  /system/lib/libcutils.so
02-14 14:05:41.031: INFO/DEBUG(31): #01 beb92470  beb9264c  [stack]
02-14 14:05:41.031: INFO/DEBUG(31):     beb92474  af906ecf  /system/lib/libcutils.so
02-14 14:05:41.041: INFO/DEBUG(31):     beb92478  00001893  
02-14 14:05:41.052: INFO/DEBUG(31):     beb9247c  beb9264c  [stack]
02-14 14:05:41.052: INFO/DEBUG(31):     beb92480  400092e8  /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)
02-14 14:05:41.052: INFO/DEBUG(31):     beb92484  45168728  /dev/ashmem/mspace/dalvik-heap/2 (deleted)
02-14 14:05:41.052: INFO/DEBUG(31):     beb92488  0000005f  
02-14 14:05:41.052: INFO/DEBUG(31):     beb9248c  8084a30f  /system/lib/libdvm.so
02-14 14:05:41.052: INFO/DEBUG(31):     beb92490  44f35018  /dev/ashmem/mspace/dalvik-heap/2 (deleted)
02-14 14:05:41.070: INFO/DEBUG(31):     beb92494  00000063  
02-14 14:05:41.070: INFO/DEBUG(31):     beb92498  474f6028  
02-14 14:05:41.070: INFO/DEBUG(31):     beb9249c  00000063  
02-14 14:05:41.080: INFO/DEBUG(31):     beb924a0  00000063  
02-14 14:05:41.091: INFO/DEBUG(31):     beb924a4  beb924d0  [stack]
02-14 14:05:41.091: INFO/DEBUG(31):     beb924a8  40009408  /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)
02-14 14:05:41.091: INFO/DEBUG(31):     beb924ac  8081c020  /system/lib/libdvm.so
02-14 14:05:41.102: INFO/DEBUG(31):     beb924b0  00008cdc  /system/bin/app_process
02-14 14:05:41.112: INFO/DEBUG(31):     beb924b4  00002337  
02-14 14:05:42.000: INFO/WindowManager(59): WIN DEATH: Window{44f9e8f0 com.keypoint_tech.adaptxt.inputmethod.core.testAdaptxt/com.keypoint_tech.adaptxt.inputmethod.core.testAdaptxt.TestAdaptxt paused=false}
02-14 14:05:42.012: INFO/ActivityManager(59): Process com.keypoint_tech.adaptxt.inputmethod.core.testAdaptxt (pid 467) has died.
02-14 14:05:42.121: INFO/BootReceiver(59): Copying /data/tombstones/tombstone_06 to DropBox (SYSTEM_TOMBSTONE)
02-14 14:05:42.191: INFO/UsageStats(59): Unexpected resume of com.android.launcher while already resumed in com.keypoint_tech.adaptxt.inputmethod.core.testAdaptxt
02-14 14:05:42.271: WARN/InputManagerService(59): Got RemoteException sending setActive(false) notification to pid 467 uid 10032

I tried to use arm-eabi-addr2line with address 0001072a than i got the following result

/usr/local/google/home/digit/android/main/cupcake/android/bionic/libc/unistd/brk.c:45

I am getting this for all platforms: Android 1.6, 2.1, and 2.2.

My program getting crash when i am trying to retrieve the values from buffer which is populated in JNI side.

Here is following code I am using to get the value from JNI side populated buffer.

for(int j = 0; j < count; j++)
{
    len = outBuf.getInt();
    CharBuffer cbuf = outBuf.asCharBuffer();
    CharSequence cS = cbuf.subSequence(0, len);
    wordsPage[j] = cS.toString();
    outBuf.position(outBuf.position()+ (len*2));
}

And could you please tell me any full proof mechanism to share the memory between Java and JNI.

1

There are 1 answers

1
su2000 On

What's your wordsPage size? Any index out of bounds issue there? Suggest you enable dalvik.vm.checkjni=true and see more information.