koral--/android-gif-drawable

SIGSEGV(SEGV_MAPERR)

sangsais opened this issue · 7 comments

The program crashes after running for a while

Android 9

api 'pl.droidsonroids.gif:android-gif-drawable:1.2.25'

Captured logs

#00 pc 71adf108717625f0
2
#1 pc 00000000004c8a64 /system/lib64/libhwui.so [arm64-v8a::3f32335e03db2845fa99f0a8c60f1d16]
3
#2 pc 00000000004e2544 /system/lib64/libhwui.so [arm64-v8a::3f32335e03db2845fa99f0a8c60f1d16]
4
#3 pc 00000000004e6124 /system/lib64/libhwui.so [arm64-v8a::3f32335e03db2845fa99f0a8c60f1d16]
5
#4 pc 000000000046983c /system/lib64/libhwui.so [arm64-v8a::3f32335e03db2845fa99f0a8c60f1d16]
6
#5 pc 00000000004ad8e4 /system/lib64/libhwui.so (SkPixelRef::callGenIDChangeListeners()+80) [arm64-v8a::3f32335e03db2845fa99f0a8c60f1d16]
7
#6 pc 00000000004ad9a4 /system/lib64/libhwui.so (SkPixelRef::notifyPixelsChanged()+16) [arm64-v8a::3f32335e03db2845fa99f0a8c60f1d16]
8
#7 pc 000000000013a568 /system/lib64/libandroid_runtime.so (android::bitmap::unlockPixels(_JNIEnv*, _jobject*)+44) [arm64-v8a::f18ddbec2414d55ac7655af2f5bc7c41]
9
#8 pc 0000000000000774 /system/lib64/libjnigraphics.so (AndroidBitmap_unlockPixels+28) [arm64-v8a::71e90bf84606c4b18b420a3f9d9b3f8a]
10
#9 pc 0000000000003e70 /data/app/com.xxx.xxx-ccLvPyBpCw3XZHRN8I7JJA==/lib/arm64/libpl_droidsonroids_gif.so (Java_pl_droidsonroids_gif_GifInfoHandle_renderFrame+292) [arm64-v8a::1abe88b75908a21f96024058d789978a]
11
#10 pc 00000000000b89a4 /data/app/com.xxx.xxx-ccLvPyBpCw3XZHRN8I7JJA==/oat/arm64/base.odex [arm64-v8a::d10d8ea51e2e14f6c05b94cdb5e01a79]
12
java:
13
pl.droidsonroids.gif.GifInfoHandle.B(GifInfoHandle.java:1)
14
pl.droidsonroids.gif.s.doWork(RenderTask.java:1)
15
pl.droidsonroids.gif.t.run(SafeRunnable.java:2)
16
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
17
java.util.concurrent.FutureTask.run(FutureTask.java:266)
18
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
19
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
20
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
21
java.lang.Thread.run(Thread.java:764)

My usage example

<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_ffffff"
app:srlEnableLoadMoreWhenContentNotFull="false">

        <pl.droidsonroids.gif.GifImageView
            android:id="@+id/gifView"
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:src="@mipmap/iv_loading_gif"
            app:layout_srlBackgroundColor="@android:color/transparent"
            app:layout_srlSpinnerStyle="Scale" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rvView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginHorizontal="@dimen/dp_10"
            android:overScrollMode="never" />

</com.scwang.smart.refresh.layout.SmartRefreshLayout>

Is there some suggestion, thanks

Please attach (or send via email) the affected GIF file.

I could not reproduce that.
It looks similar to https://github.com/koral--/android-gif-drawable/issues/644

Is it reproducible for you on distinct devices or it happens only on a particular device?

After using this version (api 'pl.droidsonroids.gif:android-gif-drawable:1.2.17'), the probability of crashing is much lower, but it still exists.
The cell phone information that occurred is as follows:
Use time 10 minutes 2 seconds
MI 8 SE
Android 9, level 28
ROM XiaoMi/MIUI
arm64-v8a

I deliberately run it on three different mobile phones, and temporarily found that it will only flash back from time to time on the MI 8 SE, other mobile phones are normal.

The way to load GIF resources has also changed,
it was before

<pl.droidsonroids.gif.GifImageView
android:id="@+id/gifView"
android:layout_width="match_parent"
android:layout_height="40dp"
android:src="@mipmap/iv_loading_gif"
app:layout_srlBackgroundColor="https://github.com/android:color/transparent"
app:layout_srlSpinnerStyle="Scale" />

Now replace it with this

<pl.droidsonroids.gif.GifImageView
android:id="@+id/gifView"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_lib_30"
android:src="@drawable/iv_loading_gif"
app:layout_srlBackgroundColor="https://github.com/android:color/transparent"
app:layout_srlSpinnerStyle="Scale" />

Thanks, I'll try to get a MI 8 with Android 9.

I don't have access to that specific device and I was not able to reproduce that on the most similar ones available (eg. Mi 9).

Anyway thanks again