根据this blog post,我构建了我的Android ffmpeg项目。我用我的Java代码用静态库和jni函数编写了本机代码。 当我运行这部分代码时,我获得了下一个logcat,我知道为什么我的进程会被信号终止吗?
03-14 11:16:06.488: I/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-14 11:16:06.488: I/DEBUG(31): Build fingerprint: generic/google_sdk/generic:2.3.4/GINGERBREAD/123630:eng/test-keys'
03-14 11:16:06.488: I/DEBUG(31): pid: 377, tid: 377 >>> com.testffmpeg <<<
03-14 11:16:06.488: I/DEBUG(31): signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 80a98f10
03-14 11:16:06.488: I/DEBUG(31): r0 002b0030 r1 80b1c410 r2 00030d40 r3 00000000
03-14 11:16:06.488: I/DEBUG(31): r4 00000000 r5 002b0030 r6 00000010 r7 00000010
03-14 11:16:06.488: I/DEBUG(31): r8 be877308 r9 7fffffff 10 80b1bea0 fp 00000000
03-14 11:16:06.488: I/DEBUG(31): ip be8772f0 sp be8772d0 lr 80a99d64 pc 80a98f10 cpsr 60000010
03-14 11:16:06.568: I/DEBUG(31): #00 pc 00298f10 /data/data/com.testffmpeg/lib/libffmpeg.so
03-14 11:16:06.568: I/DEBUG(31): #01 lr 80a99d64 /data/data/com.testffmpeg/lib/libffmpeg.so
03-14 11:16:06.568: I/DEBUG(31): code around pc:
03-14 11:16:06.568: I/DEBUG(31): 80a98ef0 eaffff9e 0009304c fffeffe4 e92d4010
03-14 11:16:06.568: I/DEBUG(31): 80a98f00 e24dd020 e28dc020 e3a04000 e1cd20f8
03-14 11:16:06.568: I/DEBUG(31): 80a98f10 e3003000 e52c4004 e3a02000 e3433ff0
03-14 11:16:06.568: I/DEBUG(31): 80a98f20 e58dc010 e3a0c001 e58dc000 ebffff77
03-14 11:16:06.568: I/DEBUG(31): 80a98f30 e1500004 b1a00004 a59d001c e28dd020
03-14 11:16:06.568: I/DEBUG(31): code around lr:
03-14 11:16:06.568: I/DEBUG(31): 80a99d44 ed947b04 e1a00005 e5941000 eefd7bc7
03-14 11:16:06.568: I/DEBUG(31): 80a99d54 ee17ca90 e1a0200c e1a03fc2 ebfffc65
03-14 11:16:06.568: I/DEBUG(31): 80a99d64 eaffffb8 e1c421d0 e1a00008 e58d9000
03-14 11:16:06.568: I/DEBUG(31): 80a99d74 eb0008cc e1a00005 e5941000 e898000c
03-14 11:16:06.568: I/DEBUG(31): 80a99d84 ebfffc6e eaffffaf e1a00005 e3a01030
03-14 11:16:06.568: I/DEBUG(31): stack:
03-14 11:16:06.568: I/DEBUG(31): be877290 001f9a98 [heap]
03-14 11:16:06.568: I/DEBUG(31): be877294 0008ced8 [heap]
03-14 11:16:06.568: I/DEBUG(31): be877298 00000005
03-14 11:16:06.578: I/DEBUG(31): be87729c a8114ca9 /system/lib/libutils.so
03-14 11:16:06.578: I/DEBUG(31): be8772a0 001f9a48 [heap]
03-14 11:16:06.578: I/DEBUG(31): be8772a4 be8772cc
03-14 11:16:06.578: I/DEBUG(31): be8772a8 fffffffc
03-14 11:16:06.578: I/DEBUG(31): be8772ac 00000000
03-14 11:16:06.578: I/DEBUG(31): be8772b0 be8772cc
03-14 11:16:06.578: I/DEBUG(31): be8772b4 a821a33d /system/lib/libbinder.so
03-14 11:16:06.578: I/DEBUG(31): be8772b8 00271270 [heap]
03-14 11:16:06.578: I/DEBUG(31): be8772bc a821a9d5 /system/lib/libbinder.so
03-14 11:16:06.578: I/DEBUG(31): be8772c0 00000030
03-14 11:16:06.578: I/DEBUG(31): be8772c4 00000000
03-14 11:16:06.578: I/DEBUG(31): be8772c8 df002777
03-14 11:16:06.578: I/DEBUG(31): be8772cc e3a070ad
03-14 11:16:06.578: I/DEBUG(31): #00 be8772d0 00000000
03-14 11:16:06.578: I/DEBUG(31): be8772d4 afd10f08 /system/lib/libc.so
03-14 11:16:06.578: I/DEBUG(31): be8772d8 00030d40 [heap]
03-14 11:16:06.578: I/DEBUG(31): be8772dc 00000000
03-14 11:16:06.578: I/DEBUG(31): be8772e0 000000da
03-14 11:16:06.578: I/DEBUG(31): be8772e4 00000008
03-14 11:16:06.578: I/DEBUG(31): be8772e8 000001b4
03-14 11:16:06.578: I/DEBUG(31): be8772ec c0000000
03-14 11:16:06.578: I/DEBUG(31): be8772f0 80b24938 /data/data/com.testffmpeg/lib/libffmpeg.so
03-14 11:16:06.578: I/DEBUG(31): be8772f4 80a99d64 /data/data/com.testffmpeg/lib/libffmpeg.so
03-14 11:16:06.578: I/DEBUG(31): be8772f8 00000000
03-14 11:16:06.578: I/DEBUG(31): be8772fc afd1386d /system/lib/libc.so
03-14 11:16:06.578: I/DEBUG(31): be877300 00000000
03-14 11:16:06.578: I/DEBUG(31): be877304 80b1be7c /data/data/com.testffmpeg/lib/libffmpeg.so
03-14 11:16:06.578: I/DEBUG(31): be877308 002b0028 [heap]
03-14 11:16:06.578: I/DEBUG(31): be87730c 00000000
03-14 11:16:06.578: I/DEBUG(31): be877310 00000003
03-14 11:16:06.578: I/DEBUG(31): be877314 00000000
03-14 11:16:07.118: D/Zygote(33): Process 377 terminated by signal (4)
答案 0 :(得分:5)
我想说在编译你的libs与你正在测试的设备兼容时,你应该检查你是否给了android ndk工具链的编译器标志。
基本上您收到SIGILL信号,这意味着您正在执行非法指令,请参阅here。
pc(程序计数器寄存器)指向地址80a98f10。在内存转储中,该地址具有下一个数据e3003000。我会说这是指令给你带来的问题(我不知道哪个是指令,因为我不知道如何解码十六进制ARM指令)。
如果您想了解更多线索,可以使用Google的ndk objdump(请参阅/your-ndk-folder/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin/arm-eabi-objdump)。如果执行:
,该程序可以反汇编您的库arm-eabi-objdump -D yourLib.so
获取输出并查找字符串e300。然后你会看到哪个是指令,知道它可以让你知道发生了什么。
我希望有所帮助。