我正在为 android 构建一个 C\C++ 本机应用程序,尝试在 android 上运行它,但出现以下错误:
02-14 14:05:40.261: 信息/调试(31): *** *** *** *** *** *** *** *** *** *** *** * ** *** *** *** *** 02-14 14:05:40.261:INFO/DEBUG(31):构建指纹:'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): 信号 11 (SIGSEGV), 故障地址 deadbaad 02-14 14:05:40.292:信息/调试(31):r0 00000000 r1 00000000 r2 00000027 r3 00000000 02-14 14:05:40.292:信息/调试(31):r4 00000000 r5 deadbaad r6 00001728 r7 44f35010 02-14 14:05:40.292:信息/调试(31):r8 430be000 r9 43170000 10 0000001d fp beb92724 02-14 14:05:40.302:信息/调试(31):ip ffffffff sp beb92448 lr afd154c5 pc afd11dc4 cpsr 40000030 02-14 14:05:40.851:信息/调试(31):#00 pc 00011dc4 /system/lib/libc.so 02-14 14:05:40.851:信息/调试(31):#01 pc 00006ecc /system/lib/libcutils.so 02-14 14:05:40.871: INFO/DEBUG(31): 电脑周围的代码: 02-14 14:05:40.881:信息/调试(31):afd11da4 1c2bd00b 2d00682d e026d1fb 2b0068db 02-14 14:05:40.891:信息/调试(31):afd11db4 4e17d003 51a02001 4d164798 24002227 02-14 14:05:40.891:信息/调试(31):afd11dc4 f7fb702a 2106ee14 ef10f7fc 05592380 02-14 14:05:40.900:信息/调试(31):afd11dd4 6091aa01 1c116054 94012006 eab6f7fc 02-14 14:05:40.910:信息/调试(31):afd11de4 2200a905 f7fc2002 f7fbeac2 2106ee00 02-14 14:05:40.910:INFO/DEBUG(31):lr 周围的代码: 02-14 14:05:40.910:信息/调试(31):afd154a4 b0834a0d 589c447b 26009001 686768a5 02-14 14:05:40.910:信息/调试(31):afd154b4 220ce008 2b005eab 1c28d003 47889901 02-14 14:05:40.922:信息/调试(31):afd154c4 35544306 d5f43f01 2c006824 b003d1ee 02-14 14:05:40.922:信息/调试(31):afd154d4 bdf01c30 0002ae7c 000000d4 1c0fb5f0 02-14 14:05:40.922:信息/调试(31):afd154e4 43551c3d a904b087 1c16ac01 604d9004 02-14 14:05:40.922:信息/调试(31):堆栈: 02-14 14:05:40.932:信息/调试(31):beb92408 000006fd 02-14 14:05:40.961:信息/调试(31):beb9240c afd1453b /system/lib/libc.so 02-14 14:05:40.961:信息/调试(31):beb92410 afd40498 /system/lib/libc.so 02-14 14:05:40.961:信息/调试(31):beb92414 afd41c14 /system/lib/libc.so 02-14 14:05:40.961:信息/调试(31):beb92418 00000000 02-14 14:05:40.961:信息/调试(31):beb9241c afd154c5 /system/lib/libc.so 02-14 14:05:40.961:信息/调试(31):beb92420 6f737265 02-14 14:05:40.981:信息/调试(31):beb92424 afd1450d /system/lib/libc.so 02-14 14:05:40.981:信息/调试(31):beb92428 50776569 02-14 14:05:40.981:信息/调试(31):beb9242c afd40328 /system/lib/libc.so 02-14 14:05:40.981:信息/调试(31):beb92430 00000000 02-14 14:05:40.981:信息/调试(31):beb92434 00001728 02-14 14:05:40.981:信息/调试(31):beb92438 44f35010 /dev/ashmem/mspace/dalvik-heap/2(已删除) 02-14 14:05:40.991:信息/调试(31):beb9243c afd147ab /system/lib/libc.so 02-14 14:05:40.991:信息/调试(31):beb92440 df002777 02-14 14:05:40.991:信息/调试(31):beb92444 e3a070ad 02-14 14:05:41.002:信息/调试(31):#00 beb92448 696a202c 02-14 14:05:41.002:信息/调试(31):beb9244c 202c746e 02-14 14:05:41.002:信息/调试(31):beb92450 746e696a 02-14 14:05:41.002:信息/调试(31):beb92454 696a202c 02-14 14:05:41.012:信息/调试(31):beb92458 2029746e 02-14 14:05:41.012:信息/调试(31):beb9245c fffffbdf 02-14 14:05:41.012:信息/调试(31):beb92460 beb9264c [堆栈] 02-14 14:05:41.012:信息/调试(31):beb92464 400092e8 /dev/ashmem/mspace/dalvik-heap/zygote/0(已删除) 02-14 14:05:41.012:信息/调试(31):beb92468 00000002 02-14 14:05:41.012:信息/调试(31):beb9246c af906ecf /system/lib/libcutils.so 02-14 14:05:41.031:信息/调试(31):#01 beb92470 beb9264c [堆栈] 02-14 14:05:41.031:信息/调试(31):beb92474 af906ecf /system/lib/libcutils.so 02-14 14:05:41.041:信息/调试(31):beb92478 00001893 02-14 14:05:41.052:信息/调试(31):beb9247c beb9264c [堆栈] 02-14 14:05:41.052:信息/调试(31):beb92480 400092e8 /dev/ashmem/mspace/dalvik-heap/zygote/0(已删除) 02-14 14:05:41.052:信息/调试(31):beb92484 45168728 /dev/ashmem/mspace/dalvik-heap/2(已删除) 02-14 14:05:41.052:信息/调试(31):beb92488 0000005f 02-14 14:05:41.052:信息/调试(31):beb9248c 8084a30f /system/lib/libdvm.so 02-14 14:05:41.052:信息/调试(31):beb92490 44f35018 /dev/ashmem/mspace/dalvik-heap/2(已删除) 02-14 14:05:41.070:信息/调试(31):beb92494 00000063 02-14 14:05:41.070:信息/调试(31):beb92498 474f6028 02-14 14:05:41.070:信息/调试(31):beb9249c 00000063 02-14 14:05:41.080:信息/调试(31):beb924a0 00000063 02-14 14:05:41.091:信息/调试(31):beb924a4 beb924d0 [堆栈] 02-14 14:05:41.091:信息/调试(31):beb924a8 40009408 /dev/ashmem/mspace/dalvik-heap/zygote/0(已删除) 02-14 14:05:41.091:信息/调试(31):beb924ac 8081c020 /system/lib/libdvm.so 02-14 14:05:41.102:信息/调试(31):beb924b0 00008cdc /system/bin/app_process 02-14 14:05:41.112:信息/调试(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): 进程 com.keypoint_tech.adaptxt.inputmethod.core.testAdaptxt (pid 467) 已经死亡。 02-14 14:05:42.121: INFO/BootReceiver(59): 复制 /data/tombstones/tombstone_06 到 DropBox (SYSTEM_TOMBSTONE) 02-14 14:05:42.191:INFO/UsageStats(59):com.android.launcher 意外恢复,而 com.keypoint_tech.adaptxt.inputmethod.core.testAdaptxt 已经恢复 02-14 14:05:42.271: WARN/InputManagerService(59): 收到 RemoteException 向 pid 467 uid 10032 发送 setActive(false) 通知
我尝试使用arm-eabi-addr2line
地址0001072a
而不是得到以下结果
/usr/local/google/home/digit/android/main/cupcake/android/bionic/libc/unistd/brk.c:45
我在所有平台上都得到了这个:Android 1.6、2.1 和 2.2。
当我尝试从填充在 JNI 端的缓冲区中检索值时,我的程序崩溃了。
这是我用来从 JNI 端填充的缓冲区中获取值的以下代码。
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));
}
您能否告诉我任何在 Java 和 JNI 之间共享内存的完整证明机制。