App random crashes with Fatal signal 7 (SIGBUS), code 2 or Fatal signal 11 (SIGSEGV), code 1

前端 未结 1 1594
粉色の甜心
粉色の甜心 2021-02-05 08:47

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

相关标签:
1条回答
  • 2021-02-05 09:01

    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.

    0 讨论(0)
提交回复
热议问题