Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Native Android Crash - Invalid Bitmap

I am getting crash reports in the Google Developer Console with the abort message: "Error, cannot access an invalid/free'd bitmap here!". The below stack-trace is all I've been able to get a hold of so far. The issue is only occurring on Android 6.0 devices (marshmallow). I'm not able to reproduce the issue on any of my devices. The users' that are seeing this are unable to even open the application; it crashes before they are even presented with any visual representation of the app. Since the error involves Bitmaps, I went through my entire project looking for corrupt image files but I did not find any. Any suggestions? Thanks!

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint:'google/ryu/dragon:6.0.1/MXC89L/3084571:user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 15550, tid: 15550, name: appname  >>> com.domain.appname <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'Error, cannot access an invalid/free'd bitmap here!'
    x0   0000000000000000  x1   0000000000003cbe  x2   0000000000000006  x3   0000000000000000
    x4   0000000000000000  x5   0000000000000001  x6   0000000000000000  x7   0000000000000000
    x8   0000000000000083  x9   000000000000003c  x10  0000007fcd9a8e2c  x11  0000007fcd9a8e68
   x12  0000007fcd9a8d40  x13  0000000000000034  x14  0000007fcd9a8f18  x15  0000000000000000
   x16  0000007b0b1996a8  x17  0000007b0b15caac  x18  0000007b0b51c418  x19  0000007b0b59c0a8
   x20  0000007b0b59bfe8  x21  000000000000000b  x22  0000000000000006  x23  0000007b0c3f9900
   x24  0000000000000000  x25  000000007081e970  x26  0000007fcd9a9928  x27  0000007fcd9a9950
   x28  0000007af426d340  x29  0000007fcd9a8dd0  x30  0000007b0b15a248
   sp   0000007fcd9a8dd0  pc   0000007b0b15cab4  pstate 0000000020000000

backtrace:
    #00 pc 000000000006aab4  /system/lib64/libc.so (tgkill+8)
    #01 pc 0000000000068244  /system/lib64/libc.so (pthread_kill+68)
    #02 pc 0000000000021238  /system/lib64/libc.so (raise+28)
    #03 pc 000000000001b9d8  /system/lib64/libc.so (abort+60)
    #04 pc 000000000000ceec  /system/lib64/libcutils.so (__android_log_assert+236)
    #05 pc 00000000000e8720  /system/lib64/libandroid_runtime.so (_ZNK7android6Bitmap11assertValidEv+40)
    #06 pc 00000000000e8804  /system/lib64/libandroid_runtime.so (_ZN7android6Bitmap11getSkBitmapEP8SkBitmap+20)
    #07 pc 00000000000fa2b8  /system/lib64/libandroid_runtime.so
    #08 pc 00000000730a6f84  /data/dalvik-cache/arm64/system@[email protected] (offset 0x1eda000)

I am also seeing this stack-trace, which I would gusss is related:

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/j3xlteuc/j3xlteatt:6.0.1/MMB29K/J320AUCU1APC9:user/release-keys'
Revision: '0'
ABI: 'arm'
pid: 29403, tid: 29403, name: appname  >>> com.domain.appname <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'Error, cannot access an invalid/free'd bitmap here!'
    r0 00000000  r1 000072db  r2 00000006  r3 b6fb2d9c
    r4 b6fb2da4  r5 b6fb2d54  r6 0000000b  r7 0000010c
    r8 00000000  r9 b4924500  sl 12e7a280  fp 70c321e8
    ip 00000006  sp bebb7540  lr b6d11501  pc b6d138f0  cpsr 400b0010

backtrace:
    #00 pc 000428f0  /system/lib/libc.so (tgkill+12)
    #01 pc 000404fd  /system/lib/libc.so (pthread_kill+32)
    #02 pc 0001cc4b  /system/lib/libc.so (raise+10)
    #03 pc 00019ec9  /system/lib/libc.so (__libc_android_abort+34)
    #04 pc 00017550  /system/lib/libc.so (abort+4)
    #05 pc 00008723  /system/lib/libcutils.so (__android_log_assert+86)
    #06 pc 00090523  /system/lib/libandroid_runtime.so (android::Bitmap::assertValid() const+18)
    #07 pc 0009059f  /system/lib/libandroid_runtime.so (android::Bitmap::getSkBitmap(SkBitmap*)+6)
    #08 pc 00099c35  /system/lib/libandroid_runtime.so
    #09 pc 033768df  /system/framework/arm/boot.oat (offset 0x2f4c000)
like image 307
uncle_tex Avatar asked Aug 31 '16 15:08

uncle_tex


1 Answers

It might crash if your bitmap calls recycle() method. try without using yourbitmap.recycle() method.

like image 182
Cutler Avatar answered Oct 15 '22 22:10

Cutler