SIGILL 信号发送到我的 Android 应用程序
在我的应用程序中,我希望能够播放流视频(通过 RTSP 协议)。 我发现打开的 RTSP 流:rtsp://red7blue.de/Primetime
并尝试播放它。但我的应用程序在尝试播放视频时被信号 SIGILL 终止。我正在使用 libffmpeg.so,SIGILL 信号的原因位于该库的代码中。 看看我在日志中得到的内容:
D/dalvikvm( 217): Trying to load lib /data/data/my.apps.package/lib/libffmpeg.so 0x43757d68
D/dalvikvm( 217): Added shared lib /data/data/my.apps.package/lib/libffmpeg.so 0x43757d68
D/dalvikvm( 217): No JNI_OnLoad found in /data/data/my.apps.package/lib/libffmpeg.so 0x43757d68
D/dalvikvm( 217): Trying to load lib /data/data/my.apps.package/lib/libplayer-4.so 0x43757d68
D/dalvikvm( 217): Added shared lib /data/data/my.apps.package/lib/libplayer-4.so 0x43757d68
D/PlayerActivity( 217): FILE TO OPEN: rtsp://red7blue.de/Primetime
D/dalvikvm( 217): +++ not scanning '/system/lib/libwebcore.so' for 'open' (wrong CL)
D/dalvikvm( 217): +++ not scanning '/system/lib/libexif.so' for 'open' (wrong CL)
D/dalvikvm( 217): +++ not scanning '/system/lib/libFFTEm.so' for 'open' (wrong CL)
I/DEBUG ( 27): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 27): Build fingerprint: 'generic/sdk/generic/:1.6/Donut/20842:eng/test-keys'
I/DEBUG ( 27): pid: 217, tid: 217 >>> my.apps.package <<<
I/DEBUG ( 27): signal 4 (SIGILL), fault addr 81337fb0
I/DEBUG ( 27): r0 00000000 r1 00000000 r2 00000001 r3 00000001
I/DEBUG ( 27): r4 00000001 r5 00000000 r6 00000000 r7 00000000
I/DEBUG ( 27): r8 7fffffff r9 00000000 10 00000000 fp 20000000
I/DEBUG ( 27): ip 00000000 sp bee438a0 lr 81337f68 pc 81337fb0 cpsr 80000010
I/DEBUG ( 27): #00 pc 00337fb0 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #01 pc 00338564 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #02 pc 003368b8 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #03 pc 00079f74 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #04 pc 0007a040 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #05 pc 002c5780 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #06 pc 002d6bc4 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #07 pc 002c67d0 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #08 pc 003110a0 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #09 pc 00317ac4 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #10 pc 003197bc /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #11 pc 00316d04 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #12 pc 00319448 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #13 pc 002c67d0 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #14 pc 002c6fe0 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #15 pc 00004a28 /data/data/my.apps.package/lib/libplayer-4.so
I/DEBUG ( 27): #16 pc 00007d08 /data/data/my.apps.package/lib/libplayer-4.so
I/DEBUG ( 27): #17 pc 0000e434 /system/lib/libdvm.so
I/DEBUG ( 27): #18 pc 00040b0e /system/lib/libdvm.so
I/DEBUG ( 27): #19 pc 000432b6 /system/lib/libdvm.so
I/DEBUG ( 27): #20 pc 00013198 /system/lib/libdvm.so
I/DEBUG ( 27): #21 pc 00017be4 /system/lib/libdvm.so
I/DEBUG ( 27): #22 pc 0001762c /system/lib/libdvm.so
I/DEBUG ( 27): #23 pc 000529a8 /system/lib/libdvm.so
I/DEBUG ( 27): #24 pc 00059eda /system/lib/libdvm.so
I/DEBUG ( 27): #25 pc 00013198 /system/lib/libdvm.so
I/DEBUG ( 27): #26 pc 00017be4 /system/lib/libdvm.so
I/DEBUG ( 27): #27 pc 0001762c /system/lib/libdvm.so
I/DEBUG ( 27): #28 pc 0005282c /system/lib/libdvm.so
I/DEBUG ( 27): #29 pc 0003f790 /system/lib/libdvm.so
I/DEBUG ( 27): #30 pc 00031caa /system/lib/libdvm.so
I/DEBUG ( 27): #31 pc 0002a804 /system/lib/libandroid_runtime.so
I/DEBUG ( 27): stack:
I/DEBUG ( 27): bee43860 00000000
I/DEBUG ( 27): bee43864 00000000
I/DEBUG ( 27): bee43868 20000000
I/DEBUG ( 27): bee4386c 8135cb94 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee43870 20000000
I/DEBUG ( 27): bee43874 00000000
I/DEBUG ( 27): bee43878 00000000
I/DEBUG ( 27): bee4387c 20000000
I/DEBUG ( 27): bee43880 00000000
I/DEBUG ( 27): bee43884 00000000
I/DEBUG ( 27): bee43888 00000000
I/DEBUG ( 27): bee4388c 8135ca5c /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee43890 bee43898 [stack]
I/DEBUG ( 27): bee43894 81337f68 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee43898 df002777
I/DEBUG ( 27): bee4389c e3a070ad
I/DEBUG ( 27): #00 bee438a0 00000000
I/DEBUG ( 27): bee438a4 00000000
I/DEBUG ( 27): bee438a8 00000000
I/DEBUG ( 27): bee438ac 00000000
I/DEBUG ( 27): bee438b0 3ff00000
I/DEBUG ( 27): bee438b4 afc1d8f4 /system/lib/libm.so
I/DEBUG ( 27): bee438b8 afc1d868 /system/lib/libm.so
I/DEBUG ( 27): bee438bc 001f750c [heap]
I/DEBUG ( 27): bee438c0 8146ab20 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee438c4 0000001c
I/DEBUG ( 27): bee438c8 8b9e9309
I/DEBUG ( 27): bee438cc 8b9e9309
I/DEBUG ( 27): bee438d0 3fa56e5f
I/DEBUG ( 27): bee438d4 afc0e3bc /system/lib/libm.so
I/DEBUG ( 27): bee438d8 2d87a4ea
I/DEBUG ( 27): bee438dc 00000000
I/DEBUG ( 27): bee438e0 00000000
I/DEBUG ( 27): bee438e4 bee43928 [stack]
I/DEBUG ( 27): bee438e8 bee4392c [stack]
I/DEBUG ( 27): bee438ec ffffffbe
I/DEBUG ( 27): bee438f0 00000000
I/DEBUG ( 27): bee438f4 bee43928 [stack]
I/DEBUG ( 27): bee438f8 bee4392c [stack]
I/DEBUG ( 27): bee438fc bee43968 [stack]
I/DEBUG ( 27): bee43900 00000000
I/DEBUG ( 27): bee43904 7fffffff
I/DEBUG ( 27): bee43908 00000000
I/DEBUG ( 27): bee4390c 00000000
I/DEBUG ( 27): bee43910 20000000
I/DEBUG ( 27): bee43914 81338568 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #01 bee43918 00000001
I/DEBUG ( 27): bee4391c 00000000
I/DEBUG ( 27): bee43920 7fffffff
I/DEBUG ( 27): bee43924 00000000
I/DEBUG ( 27): bee43928 8145fe10 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee4392c 81336698 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee43930 00000001
I/DEBUG ( 27): bee43934 8146ab50 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee43938 001f74f0 [heap]
I/DEBUG ( 27): bee4393c 00000000
I/DEBUG ( 27): bee43940 00000000
I/DEBUG ( 27): bee43944 bee43968 [stack]
I/DEBUG ( 27): bee43948 7fffffff
I/DEBUG ( 27): bee4394c 8145fe34 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee43950 8145fe10 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee43954 813368bc /data/data/my.apps.package/lib/libffmpeg.so
D/Zygote ( 29): Process 217 terminated by signal (4)
I/ActivityManager( 65): Process my.apps.package (pid 217) has died.
I/WindowManager( 65): WIN DEATH: Window{43846460 my.apps.package/my.apps.package.MainActivity paused=false}
我猜测 SIGILL 信号的原因之一可能是尝试执行特权指令。 RTSP 是一种网络协议。这意味着 ffmpeg.so 尝试使用网络访问媒体流。也许应该为此指定一些特殊权限?在我的应用程序中,我拥有唯一的显式权限 - android.permission.INTERNET
我应该指定其他内容吗?
In my application I want to be able to play streaming video (by way of RTSP protocol).
I found open RTSP stream: rtsp://red7blue.de/Primetime
and tried to play it. But my application is being terminated by signal SIGILL while trying to play video. I'm using libffmpeg.so and cause ofthe SIGILL signal is located in the code of this library.
Look at what I got in logs:
D/dalvikvm( 217): Trying to load lib /data/data/my.apps.package/lib/libffmpeg.so 0x43757d68
D/dalvikvm( 217): Added shared lib /data/data/my.apps.package/lib/libffmpeg.so 0x43757d68
D/dalvikvm( 217): No JNI_OnLoad found in /data/data/my.apps.package/lib/libffmpeg.so 0x43757d68
D/dalvikvm( 217): Trying to load lib /data/data/my.apps.package/lib/libplayer-4.so 0x43757d68
D/dalvikvm( 217): Added shared lib /data/data/my.apps.package/lib/libplayer-4.so 0x43757d68
D/PlayerActivity( 217): FILE TO OPEN: rtsp://red7blue.de/Primetime
D/dalvikvm( 217): +++ not scanning '/system/lib/libwebcore.so' for 'open' (wrong CL)
D/dalvikvm( 217): +++ not scanning '/system/lib/libexif.so' for 'open' (wrong CL)
D/dalvikvm( 217): +++ not scanning '/system/lib/libFFTEm.so' for 'open' (wrong CL)
I/DEBUG ( 27): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 27): Build fingerprint: 'generic/sdk/generic/:1.6/Donut/20842:eng/test-keys'
I/DEBUG ( 27): pid: 217, tid: 217 >>> my.apps.package <<<
I/DEBUG ( 27): signal 4 (SIGILL), fault addr 81337fb0
I/DEBUG ( 27): r0 00000000 r1 00000000 r2 00000001 r3 00000001
I/DEBUG ( 27): r4 00000001 r5 00000000 r6 00000000 r7 00000000
I/DEBUG ( 27): r8 7fffffff r9 00000000 10 00000000 fp 20000000
I/DEBUG ( 27): ip 00000000 sp bee438a0 lr 81337f68 pc 81337fb0 cpsr 80000010
I/DEBUG ( 27): #00 pc 00337fb0 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #01 pc 00338564 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #02 pc 003368b8 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #03 pc 00079f74 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #04 pc 0007a040 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #05 pc 002c5780 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #06 pc 002d6bc4 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #07 pc 002c67d0 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #08 pc 003110a0 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #09 pc 00317ac4 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #10 pc 003197bc /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #11 pc 00316d04 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #12 pc 00319448 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #13 pc 002c67d0 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #14 pc 002c6fe0 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #15 pc 00004a28 /data/data/my.apps.package/lib/libplayer-4.so
I/DEBUG ( 27): #16 pc 00007d08 /data/data/my.apps.package/lib/libplayer-4.so
I/DEBUG ( 27): #17 pc 0000e434 /system/lib/libdvm.so
I/DEBUG ( 27): #18 pc 00040b0e /system/lib/libdvm.so
I/DEBUG ( 27): #19 pc 000432b6 /system/lib/libdvm.so
I/DEBUG ( 27): #20 pc 00013198 /system/lib/libdvm.so
I/DEBUG ( 27): #21 pc 00017be4 /system/lib/libdvm.so
I/DEBUG ( 27): #22 pc 0001762c /system/lib/libdvm.so
I/DEBUG ( 27): #23 pc 000529a8 /system/lib/libdvm.so
I/DEBUG ( 27): #24 pc 00059eda /system/lib/libdvm.so
I/DEBUG ( 27): #25 pc 00013198 /system/lib/libdvm.so
I/DEBUG ( 27): #26 pc 00017be4 /system/lib/libdvm.so
I/DEBUG ( 27): #27 pc 0001762c /system/lib/libdvm.so
I/DEBUG ( 27): #28 pc 0005282c /system/lib/libdvm.so
I/DEBUG ( 27): #29 pc 0003f790 /system/lib/libdvm.so
I/DEBUG ( 27): #30 pc 00031caa /system/lib/libdvm.so
I/DEBUG ( 27): #31 pc 0002a804 /system/lib/libandroid_runtime.so
I/DEBUG ( 27): stack:
I/DEBUG ( 27): bee43860 00000000
I/DEBUG ( 27): bee43864 00000000
I/DEBUG ( 27): bee43868 20000000
I/DEBUG ( 27): bee4386c 8135cb94 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee43870 20000000
I/DEBUG ( 27): bee43874 00000000
I/DEBUG ( 27): bee43878 00000000
I/DEBUG ( 27): bee4387c 20000000
I/DEBUG ( 27): bee43880 00000000
I/DEBUG ( 27): bee43884 00000000
I/DEBUG ( 27): bee43888 00000000
I/DEBUG ( 27): bee4388c 8135ca5c /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee43890 bee43898 [stack]
I/DEBUG ( 27): bee43894 81337f68 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee43898 df002777
I/DEBUG ( 27): bee4389c e3a070ad
I/DEBUG ( 27): #00 bee438a0 00000000
I/DEBUG ( 27): bee438a4 00000000
I/DEBUG ( 27): bee438a8 00000000
I/DEBUG ( 27): bee438ac 00000000
I/DEBUG ( 27): bee438b0 3ff00000
I/DEBUG ( 27): bee438b4 afc1d8f4 /system/lib/libm.so
I/DEBUG ( 27): bee438b8 afc1d868 /system/lib/libm.so
I/DEBUG ( 27): bee438bc 001f750c [heap]
I/DEBUG ( 27): bee438c0 8146ab20 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee438c4 0000001c
I/DEBUG ( 27): bee438c8 8b9e9309
I/DEBUG ( 27): bee438cc 8b9e9309
I/DEBUG ( 27): bee438d0 3fa56e5f
I/DEBUG ( 27): bee438d4 afc0e3bc /system/lib/libm.so
I/DEBUG ( 27): bee438d8 2d87a4ea
I/DEBUG ( 27): bee438dc 00000000
I/DEBUG ( 27): bee438e0 00000000
I/DEBUG ( 27): bee438e4 bee43928 [stack]
I/DEBUG ( 27): bee438e8 bee4392c [stack]
I/DEBUG ( 27): bee438ec ffffffbe
I/DEBUG ( 27): bee438f0 00000000
I/DEBUG ( 27): bee438f4 bee43928 [stack]
I/DEBUG ( 27): bee438f8 bee4392c [stack]
I/DEBUG ( 27): bee438fc bee43968 [stack]
I/DEBUG ( 27): bee43900 00000000
I/DEBUG ( 27): bee43904 7fffffff
I/DEBUG ( 27): bee43908 00000000
I/DEBUG ( 27): bee4390c 00000000
I/DEBUG ( 27): bee43910 20000000
I/DEBUG ( 27): bee43914 81338568 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): #01 bee43918 00000001
I/DEBUG ( 27): bee4391c 00000000
I/DEBUG ( 27): bee43920 7fffffff
I/DEBUG ( 27): bee43924 00000000
I/DEBUG ( 27): bee43928 8145fe10 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee4392c 81336698 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee43930 00000001
I/DEBUG ( 27): bee43934 8146ab50 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee43938 001f74f0 [heap]
I/DEBUG ( 27): bee4393c 00000000
I/DEBUG ( 27): bee43940 00000000
I/DEBUG ( 27): bee43944 bee43968 [stack]
I/DEBUG ( 27): bee43948 7fffffff
I/DEBUG ( 27): bee4394c 8145fe34 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee43950 8145fe10 /data/data/my.apps.package/lib/libffmpeg.so
I/DEBUG ( 27): bee43954 813368bc /data/data/my.apps.package/lib/libffmpeg.so
D/Zygote ( 29): Process 217 terminated by signal (4)
I/ActivityManager( 65): Process my.apps.package (pid 217) has died.
I/WindowManager( 65): WIN DEATH: Window{43846460 my.apps.package/my.apps.package.MainActivity paused=false}
As I guess one of the causes of SIGILL signal may be the try to perform privileged instruction. RTSP is a network protocol. It's meaning that ffmpeg.so tries to access media stream using network. Maybe some special permissions should be specified for that? In my app I have the only explicit permission - android.permission.INTERNET
Should I specify something else?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的错误,很快我意识到问题是因为我已经为armv-7平台编译了程序,并且我尝试在arm v5上运行它。您可以评论 Application.mk 中类似 #APP_ABI := armeabi-v7a 的部分
I encountered the same error, soon i realised that the problem was because i have compiled the program for armv-7 platform and i tried runnig it on arm v5. You may comment the portion in Application.mk which says something like this #APP_ABI := armeabi-v7a
使用arm-eabi-objdump反汇编libplayer-4.so和libffmpeg.so。检查 libplayer-4.so 中的 7d08、4a2b 和 libffmpeg 中的 2c6fe0 周围的地址。
找到地址后,找出标签。是函数名。
use arm-eabi-objdump disassemble the libplayer-4.so and libffmpeg.so. check address around 7d08, 4a2b in libplayer-4.so and 2c6fe0 in libffmpeg.
After the address found, find out the label. It's function name.