【问题标题】:Process terminates by signal calling ffmpeg part in Android NDK project进程通过信号调用 Android NDK 项目中的 ffmpeg 部分终止
【发布时间】:2012-03-30 20:48:22
【问题描述】:

根据this blog post 我已经构建了我的Android ffmpeg 项目。我已经使用静态库和 jni 函数从我的 Java 代码编写了本机代码。 当我运行这部分代码时,我获得了下一个 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)

【问题讨论】:

    标签: android c android-ndk ffmpeg java-native-interface


    【解决方案1】:

    我会说你应该检查你在编译你的库时提供给 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。然后你会看到哪个是指令,知道它可能会让你知道发生了什么。

    我希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多