facebook / facebook/fresco

[CRASH] a JNI crash recycle Bitmap on Android 4.4.4 rarely.

Open
#1,362 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
17.2k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

A JNI Crash recycle Bitmap which allocated on ashmem by pinBitmap.
It was just Found on Android 4.4.4 rarely.

**Crash on Android 4.4.4**

**JNI Crash log as follow**

```
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000013
r0 ffffffff r1 88d6f788 r2 ffffffff r3 00007020
r4 88d69270 r5 7c8d9450 r6 401839dc r7 7e0976f8
r8 84b95af0 r9 7e0976f0 10 00000000 fp 84b95b04
ip 890f60fc sp 84b95a18 lr 890f60fc pc 401315fc cpsr a0000010
#00 pc 000155fc /system/lib/libc.so (dlfree)
#01 pc 000ce798 /system/lib/libskia.so (_ZN6SkDataD0Ev)
#02 pc 00118fd8 /system/lib/libskia.so (_ZN14SkMemoryStreamD0Ev)
#03 pc 00174b7c /system/lib/libskia.so (_ZN10SkImageRefD2Ev)
#04 pc 001754fc /system/lib/libskia.so (_ZN17SkImageRef_ashmemD2Ev)
#05 pc 00175528 /system/lib/libskia.so (_ZN17SkImageRef_ashmemD0Ev)
#06 pc 000aa094 /system/lib/libskia.so (_ZN8SkBitmap10freePixelsEv)
#07 pc 000aa328 /system/lib/libskia.so (_ZN8SkBitmap11setPixelRefEP10SkPixelRefj)
#08 pc 000aa3e4 /system/lib/libskia.so (_ZN8SkBitmap9setPixelsEPvP12SkColorTable)
#09 pc 0002cf2c /system/lib/libhwui.so (_ZN7android10uirenderer13ResourceCache13recycleLockedEP8SkBitmap)
#10 pc 0002cf6e /system/lib/libhwui.so (_ZN7android10uirenderer13ResourceCache7recycleEP8SkBitmap)
#11 pc 0001ee8c /system/lib/libdvm.so (dvmPlatformInvoke)
#12 pc 000503b6 /system/lib/libdvm.so (_Z16dvmCallJNIMethodPKjP6JValuePK6MethodP6Thread)
#13 pc 00028268 /system/lib/libdvm.so
#14 pc 0002f738 /system/lib/libdvm.so (_Z11dvmMterpStdP6Thread)
#15 pc 0002cda8 /system/lib/libdvm.so (_Z12dvmInterpretP6ThreadPK6MethodP6JValue)
#16 pc 000643d8 /system/lib/libdvm.so (_Z14dvmCallMethodVP6ThreadPK6MethodP6ObjectbP6JValueSt9__va_list)
#17 pc 000643fc /system/lib/libdvm.so (_Z13dvmCallMethodP6ThreadPK6MethodP6ObjectP6JValuez)
#18 pc 00058878 /system/lib/libdvm.so
#19 pc 0000d8b8 /system/lib/libc.so (__thread_entry)
--- --- ---
```

**Java backtrace**

```
at android.graphics.Bitmap.nativeRecycle
at android.graphics.Bitmap.recycle
at com.facebook.imagepipeline.memory.BitmapCounter$1.release
at com.facebook.common.references.SharedReference.deleteReference
at com.facebook.common.references.CloseableReference.close
at com.facebook.imagepipeline.image.CloseableStaticBitmap.close
at com.facebook.common.internal.Closeables.close
at com.facebook.common.references.CloseableReference$1.release
at com.facebook.common.references.SharedReference.deleteReference
at com.facebook.common.references.CloseableReference.close
at com.facebook.common.references.CloseableReference.closeSafely
at com.facebook.imagepipeline.cache.CountingMemoryCache.maybeClose
at com.facebook.imagepipeline.cache.CountingMemoryCache.maybeEvictEntries
at com.facebook.imagepipeline.cache.CountingMemoryCache.cache
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.