应用程序出现致命信号7(SIGBUS),代码2或致命信号11(SIGSEGV),代码1的随机崩溃 [英] App random crashes with Fatal signal 7 (SIGBUS), code 2 or Fatal signal 11 (SIGSEGV), code 1

查看:2499
本文介绍了应用程序出现致命信号7(SIGBUS),代码2或致命信号11(SIGSEGV),代码1的随机崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文

我正在创建一个应在Fragment上显示一些图像的应用程序,其中大多数是从Internet下载的.

我正在使用 Glide 为我在CardViews和壁画在我的图像滑块上(还有此分叉.

重要:我要加载的图像可以是PNGSVG.

更多信息::我正在使用 Moto Maxx (运行 Droid Turbo 的国际版本).在运行Android 4.4.2(cyanogen mod)的三星Galaxy S4上也发生过这种情况,但是这种情况发生的频率要少得多.

附言::我正在使用NDK.

问题

有时,我的应用程序崩溃了,突然崩溃,甚至没有任何用户交互.这样做的时候,我在logcat上收到以下错误消息:

Fatal signal 7 (SIGBUS), code 2, fault addr 0x9a74c060 in tid 21894

完整堆栈:

04-07 07:59:08.110 21894 21894 F libc    : Fatal signal 7 (SIGBUS), code 2, fault addr 0x9a74c060 in tid 21894 (asus.saitestore)
04-07 07:59:08.161 21946 21946 E Diag_Lib:  Diag_LSM_Init: Failed to open handle to diag driver, error = 2
04-07 07:59:08.263   333   333 I DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-07 07:59:08.263   333   333 I DEBUG   : Build fingerprint: 'motorola/quark_retbr/quark_umts:5.0.2/LXG22.33-12.16/16:user/release-keys'
04-07 07:59:08.263   333   333 I DEBUG   : Revision: 'p4a0'
04-07 07:59:08.263   333   333 I DEBUG   : ABI: 'arm'
04-07 07:59:08.263   333   333 I DEBUG   : pid: 21894, tid: 21894, name: asus.saitestore  >>> org.unasus.saitestore <<<
04-07 07:59:08.264   333   333 I DEBUG   : signal 7 (SIGBUS), code 2 (BUS_ADRERR), fault addr 0x9a74c060
04-07 07:59:08.446   333   333 I DEBUG   :     r0 00000000  r1 bead50cc  r2 00000000  r3 9dae4000
04-07 07:59:08.446   333   333 I DEBUG   :     r4 9dae4000  r5 9a74c060  r6 bead50d4  r7 00000001
04-07 07:59:08.446   333   333 I DEBUG   :     r8 00063054  r9 00000000  sl 000000fe  fp 00000000
04-07 07:59:08.446   333   333 I DEBUG   :     ip 00000000  sp bead5094  lr b5952d63  pc b5a38426  cpsr 800b0030
04-07 07:59:08.447   333   333 I DEBUG   : 
04-07 07:59:08.447   333   333 I DEBUG   : backtrace:
04-07 07:59:08.447   333   333 I DEBUG   :     #00 pc 001b2426  /system/lib/libskia.so (S32_opaque_D32_nofilter_DX_neon(SkBitmapProcState const&, unsigned int const*, int, unsigned int*)+141)
04-07 07:59:08.447   333   333 I DEBUG   :     #01 pc 000ccd61  /system/lib/libskia.so (SkBitmapProcShader::BitmapProcShaderContext::shadeSpan(int, int, unsigned int*, int)+86)
04-07 07:59:08.447   333   333 I DEBUG   :     #02 pc 000d6cff  /system/lib/libskia.so (SkARGB32_Shader_Blitter::blitV(int, int, int, unsigned char)+528)
04-07 07:59:08.447   333   333 I DEBUG   :     #03 pc 001076c1  /system/lib/libskia.so
04-07 07:59:08.447   333   333 I DEBUG   :     #04 pc 0010782d  /system/lib/libskia.so
04-07 07:59:08.447   333   333 I DEBUG   :     #05 pc 001078b9  /system/lib/libskia.so
04-07 07:59:08.447   333   333 I DEBUG   :     #06 pc 00107cf3  /system/lib/libskia.so (SkScan::AntiFillRect(SkRect const&, SkRegion const*, SkBlitter*)+178)
04-07 07:59:08.447   333   333 I DEBUG   :     #07 pc 0010804b  /system/lib/libskia.so (SkScan::AntiFillRect(SkRect const&, SkRasterClip const&, SkBlitter*)+14)
04-07 07:59:08.447   333   333 I DEBUG   :     #08 pc 000e2031  /system/lib/libskia.so (SkDraw::drawRect(SkRect const&, SkPaint const&) const+252)
04-07 07:59:08.447   333   333 I DEBUG   :     #09 pc 000e3513  /system/lib/libskia.so (SkDraw::drawBitmap(SkBitmap const&, SkMatrix const&, SkPaint const&) const+276)
04-07 07:59:08.447   333   333 I DEBUG   :     #10 pc 000db7c5  /system/lib/libskia.so
04-07 07:59:08.447   333   333 I DEBUG   :     #11 pc 000db8ad  /system/lib/libskia.so (SkCanvas::drawBitmap(SkBitmap const&, float, float, SkPaint const*)+116)
04-07 07:59:08.447   333   333 I DEBUG   :     #12 pc 000f97bb  /system/lib/libskia.so (SkPicturePlayback::draw(SkCanvas&, SkDrawPictureCallback*)+1186)
04-07 07:59:08.447   333   333 I DEBUG   :     #13 pc 000b54c7  /system/framework/arm/boot.oat
04-07 07:59:09.190   333   333 I DEBUG   : Tombstone written to: /data/tombstones/tombstone_08
04-07 07:59:09.205   806   828 I BootReceiver: Copying /data/tombstones/tombstone_08 to DropBox (SYSTEM_TOMBSTONE)

一次,它也给了我不同的错误信息:

Fatal signal 11 (SIGSEGV), code 1, fault addr 0x9abe300c in tid 30052

还有完整的堆栈:

04-04 15:41:34.059: A/libc(30052): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x9abe300c in tid 30052 (asus.saitestore)
04-04 15:41:34.161: I/DEBUG(28994): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-04 15:41:34.161: I/DEBUG(28994): Build fingerprint: 'motorola/quark_retbr/quark_umts:5.0.2/LXG22.33-12.16/16:user/release-keys'
04-04 15:41:34.161: I/DEBUG(28994): Revision: 'p4a0'
04-04 15:41:34.161: I/DEBUG(28994): ABI: 'arm'
04-04 15:41:34.161: I/DEBUG(28994): pid: 30052, tid: 30052, name: asus.saitestore  >>> org.unasus.saitestore <<<
04-04 15:41:34.161: I/DEBUG(28994): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x9abe300c
04-04 15:41:34.177: I/DEBUG(28994):     r0 00000000  r1 bede70a4  r2 00000000  r3 9ce89000
04-04 15:41:34.178: I/DEBUG(28994):     r4 9ce89000  r5 9abe300c  r6 bede70ac  r7 00000001
04-04 15:41:34.178: I/DEBUG(28994):     r8 00000000  r9 00000000  sl 000000fe  fp 00000000
04-04 15:41:34.178: I/DEBUG(28994):     ip 00000000  sp bede706c  lr b5992d63  pc b5a78426  cpsr 800b0030
04-04 15:41:34.178: I/DEBUG(28994): backtrace:
04-04 15:41:34.178: I/DEBUG(28994):     #00 pc 001b2426  /system/lib/libskia.so (S32_opaque_D32_nofilter_DX_neon(SkBitmapProcState const&, unsigned int const*, int, unsigned int*)+141)
04-04 15:41:34.178: I/DEBUG(28994):     #01 pc 000ccd61  /system/lib/libskia.so (SkBitmapProcShader::BitmapProcShaderContext::shadeSpan(int, int, unsigned int*, int)+86)
04-04 15:41:34.178: I/DEBUG(28994):     #02 pc 000d6cff  /system/lib/libskia.so (SkARGB32_Shader_Blitter::blitV(int, int, int, unsigned char)+528)
04-04 15:41:34.178: I/DEBUG(28994):     #03 pc 0010721d  /system/lib/libskia.so
04-04 15:41:34.178: I/DEBUG(28994):     #04 pc 00107669  /system/lib/libskia.so
04-04 15:41:34.178: I/DEBUG(28994):     #05 pc 0010782d  /system/lib/libskia.so
04-04 15:41:34.178: I/DEBUG(28994):     #06 pc 001078b9  /system/lib/libskia.so
04-04 15:41:34.178: I/DEBUG(28994):     #07 pc 00107cf3  /system/lib/libskia.so (SkScan::AntiFillRect(SkRect const&, SkRegion const*, SkBlitter*)+178)
04-04 15:41:34.179: I/DEBUG(28994):     #08 pc 0010804b  /system/lib/libskia.so (SkScan::AntiFillRect(SkRect const&, SkRasterClip const&, SkBlitter*)+14)
04-04 15:41:34.179: I/DEBUG(28994):     #09 pc 000e2031  /system/lib/libskia.so (SkDraw::drawRect(SkRect const&, SkPaint const&) const+252)
04-04 15:41:34.179: I/DEBUG(28994):     #10 pc 000e3513  /system/lib/libskia.so (SkDraw::drawBitmap(SkBitmap const&, SkMatrix const&, SkPaint const&) const+276)
04-04 15:41:34.179: I/DEBUG(28994):     #11 pc 000db7c5  /system/lib/libskia.so
04-04 15:41:34.179: I/DEBUG(28994):     #12 pc 000db8ad  /system/lib/libskia.so (SkCanvas::drawBitmap(SkBitmap const&, float, float, SkPaint const*)+116)
04-04 15:41:34.179: I/DEBUG(28994):     #13 pc 000f97bb  /system/lib/libskia.so (SkPicturePlayback::draw(SkCanvas&, SkDrawPictureCallback*)+1186)
04-04 15:41:34.179: I/DEBUG(28994):     #14 pc 000b54c7  /system/framework/arm/boot.oat
04-04 15:41:34.820: I/DEBUG(28994): Tombstone written to: /data/tombstones/tombstone_07
04-04 15:41:34.821: I/BootReceiver(1989): Copying /data/tombstones/tombstone_07 to DropBox (SYSTEM_TOMBSTONE)

同样在三星Galaxy S4上也发生过,墓碑可以在这里找到.

我如何加载图像

在我的CardAdapter内,我正在像这样加载图像(SVG部分取自

到目前为止我发现了什么

我在这里找到了一些关于SO的问题,但是没有一个问题对我的问题有真正的帮助.而且很难复制它.有时,即使在错误的屏幕上显示30分钟后,该应用程序也根本不会崩溃.另一方面,它是在显示图像后发生的.

我发现了一些问题:

还有许多其他人...

这是应用程序的屏幕截图,取自我的手机生成的错误报告:

我在某些地方看到此问题可能与内存不足有关.但是我认为这不太可能,因为我的手机有3GB或RAM,并且与本地图库应用程序相比(我的手机没有崩溃),我加载的图像更少.

另一方面,skia问题跟踪器上的线程表明它与SVG库有关.

更新:我发现了此链接(位于Android问题跟踪器上)和在Skia问题跟踪器上,这很可能与问题有关.

其他更新:我已经移除了滑块,并且该应用停止了崩溃.我想问题就在那里.

又一次更新:我已将滑块更改为在给定时间内仅加载PNG或仅加载SVG. 该应用仅在加载SVG图片时崩溃.因此,也许问题出在 SVG库上.

从文件加载SVG也会崩溃.

解决方案

我并没有真正的解决方案,但我相信我有一些有用的提示,可以帮助您进一步解决问题,但是发表评论的时间很长

您已经缩小了问题的范围.问题很可能是在部分或全部SVG上造成的.

因此,我将重点确定是否所有SVG或其中的一部分导致了该问题.

在"SVG库"上导航您提到的代码看起来没有任何本机组件,所以我不会怪它.

很清楚地检查您的回溯,表明崩溃发生在"Skia"上.本机库(libskia.so).

在回溯中张贴人类可读的部分:

/system/lib/libskia.so (S32_opaque_D32_nofilter_DX_neon(SkBitmapProcState const&, unsigned int const*, int, unsigned int*)+141)
/system/lib/libskia.so (SkBitmapProcShader::BitmapProcShaderContext::shadeSpan(int, int, unsigned int*, int)+86)
/system/lib/libskia.so (SkARGB32_Shader_Blitter::blitV(int, int, int, unsigned char)+528)

/system/lib/libskia.so (SkScan::AntiFillRect(SkRect const&, SkRegion const*, SkBlitter*)+178)
/system/lib/libskia.so (SkScan::AntiFillRect(SkRect const&, SkRasterClip const&, SkBlitter*)+14)
/system/lib/libskia.so (SkDraw::drawRect(SkRect const&, SkPaint const&) const+252)
/system/lib/libskia.so (SkDraw::drawBitmap(SkBitmap const&, SkMatrix const&, SkPaint const&) const+276)

/system/lib/libskia.so (SkCanvas::drawBitmap(SkBitmap const&, float, float, SkPaint const*)+116)
/system/lib/libskia.so (SkPicturePlayback::draw(SkCanvas&, SkDrawPictureCallback*)+1186)

从顶部到底部读取Backtrace,因此我发布的第一行是完全崩溃的.一些不透明的东西,没有在霓虹灯上过滤. ( NEON 位于处理器芯片上,并且设备支持该芯片或不是)

有关 Skia库的一些额外详细信息:

Skia是一个开源2D图形库,它提供可在各种硬件和软件平台上工作的通用API.它用作Google Chrome和Chrome OS,Android,Mozilla Firefox和Firefox OS以及许多其他产品的图形引擎.

Skia由Google赞助和管理,但根据BSD自由软件许可,任何人都可以使用.尽管核心组件的工程是由Skia开发团队完成的,但我们会考虑来自任何来源的贡献.

因此,问题很可能是由于"Android源代码"或测试设备使用的ROM.您是否在Vanila android上测试了该应用程序,以查看其是否仍然崩溃?或至少没有某种自定义ROM的东西,因为您可能会遇到一些限制.我在有关霓虹灯功能的自定义ROMS上遇到了一些限制,但从未在OEM/Stock ROM上遇到过.

最后但并非最不重要的一点是,将SVG加载到Android时存在一些限制,因此另一种可能性是击中其中一个.谷歌搜索周围,我发现了文章提到它,不确定是否只有它.

Android开发者参考建议将矢量图像限制为最大200 x 200 dpi,因为矢量图形的初始加载可能会相对昂贵,导致绘制时间长.

Context

I'm creating an app that's supposed to show some images on a Fragment, most of them downloaded from the internet.

I'm using Glide to handle that image loading for me on my CardViews and Fresco on my image slider (And this question on SO explains why I'm using two image libs).

The Fresco part of the lib is mostly based on this fork of the AndroidImageSlider.

Important: The images that I'm trying to load can either be PNG or SVG.

More info: I'm using a Moto Maxx (international version of the Droid Turbo) running Android 5.0.2. Also happened on a Samsung Galaxy S4 running Android 4.4.2 (cyanogen mod), but it happens a lot less often.

P.S.: I'm NOT using NDK.

The problem

Sometimes, my app just crashes, out of nowhere, and even without any user interaction. And when it does, I'm getting the following error message on the logcat:

Fatal signal 7 (SIGBUS), code 2, fault addr 0x9a74c060 in tid 21894

Full stack:

04-07 07:59:08.110 21894 21894 F libc    : Fatal signal 7 (SIGBUS), code 2, fault addr 0x9a74c060 in tid 21894 (asus.saitestore)
04-07 07:59:08.161 21946 21946 E Diag_Lib:  Diag_LSM_Init: Failed to open handle to diag driver, error = 2
04-07 07:59:08.263   333   333 I DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-07 07:59:08.263   333   333 I DEBUG   : Build fingerprint: 'motorola/quark_retbr/quark_umts:5.0.2/LXG22.33-12.16/16:user/release-keys'
04-07 07:59:08.263   333   333 I DEBUG   : Revision: 'p4a0'
04-07 07:59:08.263   333   333 I DEBUG   : ABI: 'arm'
04-07 07:59:08.263   333   333 I DEBUG   : pid: 21894, tid: 21894, name: asus.saitestore  >>> org.unasus.saitestore <<<
04-07 07:59:08.264   333   333 I DEBUG   : signal 7 (SIGBUS), code 2 (BUS_ADRERR), fault addr 0x9a74c060
04-07 07:59:08.446   333   333 I DEBUG   :     r0 00000000  r1 bead50cc  r2 00000000  r3 9dae4000
04-07 07:59:08.446   333   333 I DEBUG   :     r4 9dae4000  r5 9a74c060  r6 bead50d4  r7 00000001
04-07 07:59:08.446   333   333 I DEBUG   :     r8 00063054  r9 00000000  sl 000000fe  fp 00000000
04-07 07:59:08.446   333   333 I DEBUG   :     ip 00000000  sp bead5094  lr b5952d63  pc b5a38426  cpsr 800b0030
04-07 07:59:08.447   333   333 I DEBUG   : 
04-07 07:59:08.447   333   333 I DEBUG   : backtrace:
04-07 07:59:08.447   333   333 I DEBUG   :     #00 pc 001b2426  /system/lib/libskia.so (S32_opaque_D32_nofilter_DX_neon(SkBitmapProcState const&, unsigned int const*, int, unsigned int*)+141)
04-07 07:59:08.447   333   333 I DEBUG   :     #01 pc 000ccd61  /system/lib/libskia.so (SkBitmapProcShader::BitmapProcShaderContext::shadeSpan(int, int, unsigned int*, int)+86)
04-07 07:59:08.447   333   333 I DEBUG   :     #02 pc 000d6cff  /system/lib/libskia.so (SkARGB32_Shader_Blitter::blitV(int, int, int, unsigned char)+528)
04-07 07:59:08.447   333   333 I DEBUG   :     #03 pc 001076c1  /system/lib/libskia.so
04-07 07:59:08.447   333   333 I DEBUG   :     #04 pc 0010782d  /system/lib/libskia.so
04-07 07:59:08.447   333   333 I DEBUG   :     #05 pc 001078b9  /system/lib/libskia.so
04-07 07:59:08.447   333   333 I DEBUG   :     #06 pc 00107cf3  /system/lib/libskia.so (SkScan::AntiFillRect(SkRect const&, SkRegion const*, SkBlitter*)+178)
04-07 07:59:08.447   333   333 I DEBUG   :     #07 pc 0010804b  /system/lib/libskia.so (SkScan::AntiFillRect(SkRect const&, SkRasterClip const&, SkBlitter*)+14)
04-07 07:59:08.447   333   333 I DEBUG   :     #08 pc 000e2031  /system/lib/libskia.so (SkDraw::drawRect(SkRect const&, SkPaint const&) const+252)
04-07 07:59:08.447   333   333 I DEBUG   :     #09 pc 000e3513  /system/lib/libskia.so (SkDraw::drawBitmap(SkBitmap const&, SkMatrix const&, SkPaint const&) const+276)
04-07 07:59:08.447   333   333 I DEBUG   :     #10 pc 000db7c5  /system/lib/libskia.so
04-07 07:59:08.447   333   333 I DEBUG   :     #11 pc 000db8ad  /system/lib/libskia.so (SkCanvas::drawBitmap(SkBitmap const&, float, float, SkPaint const*)+116)
04-07 07:59:08.447   333   333 I DEBUG   :     #12 pc 000f97bb  /system/lib/libskia.so (SkPicturePlayback::draw(SkCanvas&, SkDrawPictureCallback*)+1186)
04-07 07:59:08.447   333   333 I DEBUG   :     #13 pc 000b54c7  /system/framework/arm/boot.oat
04-07 07:59:09.190   333   333 I DEBUG   : Tombstone written to: /data/tombstones/tombstone_08
04-07 07:59:09.205   806   828 I BootReceiver: Copying /data/tombstones/tombstone_08 to DropBox (SYSTEM_TOMBSTONE)

Once, it also gave me a different error message:

Fatal signal 11 (SIGSEGV), code 1, fault addr 0x9abe300c in tid 30052

And the full stack:

04-04 15:41:34.059: A/libc(30052): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x9abe300c in tid 30052 (asus.saitestore)
04-04 15:41:34.161: I/DEBUG(28994): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-04 15:41:34.161: I/DEBUG(28994): Build fingerprint: 'motorola/quark_retbr/quark_umts:5.0.2/LXG22.33-12.16/16:user/release-keys'
04-04 15:41:34.161: I/DEBUG(28994): Revision: 'p4a0'
04-04 15:41:34.161: I/DEBUG(28994): ABI: 'arm'
04-04 15:41:34.161: I/DEBUG(28994): pid: 30052, tid: 30052, name: asus.saitestore  >>> org.unasus.saitestore <<<
04-04 15:41:34.161: I/DEBUG(28994): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x9abe300c
04-04 15:41:34.177: I/DEBUG(28994):     r0 00000000  r1 bede70a4  r2 00000000  r3 9ce89000
04-04 15:41:34.178: I/DEBUG(28994):     r4 9ce89000  r5 9abe300c  r6 bede70ac  r7 00000001
04-04 15:41:34.178: I/DEBUG(28994):     r8 00000000  r9 00000000  sl 000000fe  fp 00000000
04-04 15:41:34.178: I/DEBUG(28994):     ip 00000000  sp bede706c  lr b5992d63  pc b5a78426  cpsr 800b0030
04-04 15:41:34.178: I/DEBUG(28994): backtrace:
04-04 15:41:34.178: I/DEBUG(28994):     #00 pc 001b2426  /system/lib/libskia.so (S32_opaque_D32_nofilter_DX_neon(SkBitmapProcState const&, unsigned int const*, int, unsigned int*)+141)
04-04 15:41:34.178: I/DEBUG(28994):     #01 pc 000ccd61  /system/lib/libskia.so (SkBitmapProcShader::BitmapProcShaderContext::shadeSpan(int, int, unsigned int*, int)+86)
04-04 15:41:34.178: I/DEBUG(28994):     #02 pc 000d6cff  /system/lib/libskia.so (SkARGB32_Shader_Blitter::blitV(int, int, int, unsigned char)+528)
04-04 15:41:34.178: I/DEBUG(28994):     #03 pc 0010721d  /system/lib/libskia.so
04-04 15:41:34.178: I/DEBUG(28994):     #04 pc 00107669  /system/lib/libskia.so
04-04 15:41:34.178: I/DEBUG(28994):     #05 pc 0010782d  /system/lib/libskia.so
04-04 15:41:34.178: I/DEBUG(28994):     #06 pc 001078b9  /system/lib/libskia.so
04-04 15:41:34.178: I/DEBUG(28994):     #07 pc 00107cf3  /system/lib/libskia.so (SkScan::AntiFillRect(SkRect const&, SkRegion const*, SkBlitter*)+178)
04-04 15:41:34.179: I/DEBUG(28994):     #08 pc 0010804b  /system/lib/libskia.so (SkScan::AntiFillRect(SkRect const&, SkRasterClip const&, SkBlitter*)+14)
04-04 15:41:34.179: I/DEBUG(28994):     #09 pc 000e2031  /system/lib/libskia.so (SkDraw::drawRect(SkRect const&, SkPaint const&) const+252)
04-04 15:41:34.179: I/DEBUG(28994):     #10 pc 000e3513  /system/lib/libskia.so (SkDraw::drawBitmap(SkBitmap const&, SkMatrix const&, SkPaint const&) const+276)
04-04 15:41:34.179: I/DEBUG(28994):     #11 pc 000db7c5  /system/lib/libskia.so
04-04 15:41:34.179: I/DEBUG(28994):     #12 pc 000db8ad  /system/lib/libskia.so (SkCanvas::drawBitmap(SkBitmap const&, float, float, SkPaint const*)+116)
04-04 15:41:34.179: I/DEBUG(28994):     #13 pc 000f97bb  /system/lib/libskia.so (SkPicturePlayback::draw(SkCanvas&, SkDrawPictureCallback*)+1186)
04-04 15:41:34.179: I/DEBUG(28994):     #14 pc 000b54c7  /system/framework/arm/boot.oat
04-04 15:41:34.820: I/DEBUG(28994): Tombstone written to: /data/tombstones/tombstone_07
04-04 15:41:34.821: I/BootReceiver(1989): Copying /data/tombstones/tombstone_07 to DropBox (SYSTEM_TOMBSTONE)

EDIT: Also happened on a Samsung Galaxy S4, tombstone can be found here.

How I'm loading the images

Inside my CardAdapter, I'm loading the images like this (The SVG part was taken from here):

if (mod.getImg_type() == ImageTypes.SVG) {
    GenericRequestBuilder<Uri, InputStream, SVG, PictureDrawable> requestBuilder;

    SVGDecoder decoder = new SVGDecoder(PreserveAspectRatio.STRETCH);

    requestBuilder = Glide.with(mContext)
            .using(Glide.buildStreamModelLoader(Uri.class, mContext), InputStream.class)
            .from(Uri.class)
            .as(SVG.class)
            .transcode(new SvgDrawableTranscoder(), PictureDrawable.class)
            .sourceEncoder(new StreamEncoder())
            .cacheDecoder(new FileToStreamDecoder<>(decoder))
            .decoder(decoder)
            .placeholder(R.drawable.modulo)
            .error(R.drawable.banner_error)
            .animate(android.R.anim.fade_in)
            .listener(new SvgSoftwareLayerSetter<Uri>());

    requestBuilder
            .diskCacheStrategy(DiskCacheStrategy.SOURCE)
            .load(Uri.parse(mod.getUrl_icon()))
            .into(cardHolder.iv_card);
}
else {
    Glide.with(mContext)
            .load(mod.getUrl_icon())
            .placeholder(R.drawable.modulo)
            .error(R.drawable.banner_error)
            .centerCrop()
            .crossFade()
            .into(cardHolder.iv_card);
}

And the XML file looks like this:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/card_view"
    android:layout_width="@dimen/card_w"
    android:layout_height="@dimen/card_h"
    android:layout_margin="5dp"
    android:stateListAnimator="@anim/raise"
    card_view:cardCornerRadius="0dp"
    android:foreground="?android:attr/selectableItemBackground">

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/rl_card">


        <ImageView
            android:layout_width="@dimen/card_image_w"
            android:layout_height="@dimen/card_image_h"
            android:layout_centerHorizontal="true"
            android:scaleType="fitXY"
            android:id="@+id/iv_card"
            android:src="@drawable/modulo"
            android:layout_margin="@dimen/spacing_medium" />

        <TextView
            android:id="@+id/tv_card"
            android:layout_width="@dimen/card_text_w"
            android:layout_height="@dimen/card_text_h"
            android:maxHeight="@dimen/card_text_h"
            android:maxWidth="@dimen/card_text_w"
            android:layout_below="@+id/iv_card"
            android:layout_centerHorizontal="true"
            android:ellipsize="end"
            android:maxLines="1"
            android:singleLine="true"
            android:text="Bacon ipsum dolor amet duis short ribs nostrud esse tempor."
            android:textSize="12sp"
            android:gravity="center_horizontal"
            android:layout_marginLeft="@dimen/spacing_medium"
            android:layout_marginRight="@dimen/spacing_medium" />

        <View
            android:id="@+id/card_check"
            android:layout_width="match_parent"
            android:layout_height="@dimen/card_check_h"
            android:maxHeight="@dimen/card_check_h"
            android:layout_below="@+id/tv_card"
            android:background="@color/primary_light"
            android:layout_alignParentBottom="true" />
    </RelativeLayout>

</android.support.v7.widget.CardView>

What have I found so far

I've found a few questions here on SO, but none of them really helped with my problem. And it's a bit hard to reproduce it. Sometimes the app doesn't crash at all, even after 30 minutes on the faulty screen. On the other hand, it happened just after the images were shown.

Some questions I've found:

And many others...

And here's a screenshot from the app, taken from the bug report generated by my phone:

I have seen in some places that this problem might be related to low memory. But I think that's unlikely, since my phone got 3GB or RAM, and I'm loading fewer images comparing to the native gallery app (which is not crashing on my phone).

On the other hand, the thread on the skia issue tracker suggests it's related to the SVG lib.

Update: I've found this link on the Android issue tracker, and this one on the skia issue tracker, which is most likely related to the problem.

Other update: I've removed the slider, and the app stopped crashing. I guess the problem is in there.

Yet another update: I've changed the slider to load only PNG or only SVG in a given time. The app only crashed while loading the SVG images. So perhaps the problem is on the SVG lib.

Loading the SVG from a file also crashes.

解决方案

I wouldn't really have a solution but I believe that I have some useful tips in order to help you digging further on the problem, but it was quite long for a comment

You already have narrow down the issue. The problem is most probably on some or all the SVG's.

So I would focus to identify if all the SVG's or some of them are causing that problem.

Navigating on the "SVG lib" code you mentioned it doesn't look that it has any native components, so I wouldn't blame it.

Checking your backtrace its quite clear that the crash is on "Skia" native library (libskia.so).

Posting bellow the human readable part of your backtrace:

/system/lib/libskia.so (S32_opaque_D32_nofilter_DX_neon(SkBitmapProcState const&, unsigned int const*, int, unsigned int*)+141)
/system/lib/libskia.so (SkBitmapProcShader::BitmapProcShaderContext::shadeSpan(int, int, unsigned int*, int)+86)
/system/lib/libskia.so (SkARGB32_Shader_Blitter::blitV(int, int, int, unsigned char)+528)

/system/lib/libskia.so (SkScan::AntiFillRect(SkRect const&, SkRegion const*, SkBlitter*)+178)
/system/lib/libskia.so (SkScan::AntiFillRect(SkRect const&, SkRasterClip const&, SkBlitter*)+14)
/system/lib/libskia.so (SkDraw::drawRect(SkRect const&, SkPaint const&) const+252)
/system/lib/libskia.so (SkDraw::drawBitmap(SkBitmap const&, SkMatrix const&, SkPaint const&) const+276)

/system/lib/libskia.so (SkCanvas::drawBitmap(SkBitmap const&, float, float, SkPaint const*)+116)
/system/lib/libskia.so (SkPicturePlayback::draw(SkCanvas&, SkDrawPictureCallback*)+1186)

Backtrace is read from top to bottom so the 1st line I posted is what exactly crashed. Some opaque thing without filter on something neon. (NEON is on the processor chip and either the device support it or not)

Some extra details about the Skia library:

Skia is an open source 2D graphics library which provides common APIs that work across a variety of hardware and software platforms. It serves as the graphics engine for Google Chrome and Chrome OS, Android, Mozilla Firefox and Firefox OS, and many other products.

Skia is sponsored and managed by Google, but is available for use by anyone under the BSD Free Software License. While engineering of the core components is done by the Skia development team, we consider contributions from any source.

So, the problem is most probably to the "Android Source Code" or the ROMs that your testing devices use. Have you tested the application on a vanila android to see if it still crashes? Or at least something that does not have some custom ROM as you may hit some limitation there. I have faced some limitations myself on custom ROMS regarding neon features but never on an OEM/Stock ROM.

Last but not least, there are some limitation when loading SVGs to Android, so another probability is to hit one of them. Googling arround I've found an article mentioning it, not sure if it the only one though.

The Android Developer reference recommends that a vector image be limited to a maximum of 200 x 200 dpi, as the initial loading of a vector graphic can be relatively expensive, leading to long draw times.

这篇关于应用程序出现致命信号7(SIGBUS),代码2或致命信号11(SIGSEGV),代码1的随机崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆