Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when rendering some GIF images #2009

Closed
jyh149129 opened this issue Dec 26, 2017 · 2 comments
Closed

Crash when rendering some GIF images #2009

jyh149129 opened this issue Dec 26, 2017 · 2 comments

Comments

@jyh149129
Copy link

jyh149129 commented Dec 26, 2017

gif image:
images.zip

javacode:

ImageRequest request = ImageRequestBuilder
.newBuilderWithSource(Uri.parse(url)
.setResizeOptions(new ResizeOptions(180,120))
.build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setAutoPlayAnimations(true)// 自动播放gif
.setOldController(pic.getController())
.setImageRequest(request)
.build();
pic.setController(controller);

  • Fresco version: 1.5.0
  • Platform version: xiaomi 1s android 5.0.2

Info:

JNI DETECTED ERROR IN APPLICATION: JNI MonitorEnter called with pending exception 'java.lang.IllegalStateException' thrown in void com.facebook.animated.gif.GifFrame.nativeRenderFrame(int, int, android.graphics.Bitmap):-2
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] in call to MonitorEnter
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] from void com.facebook.animated.gif.GifFrame.nativeRenderFrame(int, int, android.graphics.Bitmap)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] "Thread-4313" prio=5 tid=41 Runnable
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] | group="main" sCount=0 dsCount=0 obj=0x12c07da0 self=0xb037e800
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] | sysTid=5674 nice=10 cgrp=apps/bg_non_interactive sched=0/0 handle=0xb039d300
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] | state=R schedstat=( 0 0 0 ) utm=1 stm=0 core=0 HZ=100
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] | stack=0x9edf2000-0x9edf4000 stackSize=1036KB
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] | held mutexes= "mutator lock"(shared held)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] native: #00 pc 000045d4 /system/lib/libbacktrace_libc++.so (_ZN13UnwindCurrent6UnwindEjP8ucontext+23)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] native: #1 pc 00002e55 /system/lib/libbacktrace_libc++.so (_ZN9Backtrace6UnwindEjP8ucontext+8)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] native: #2 pc 0023f0e5 /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiPKcPNS_6mirror9ArtMethodE+68)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] native: #3 pc 00224637 /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+146)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] native: #4 pc 000af9d3 /system/lib/libart.so (ZN3artL8JniAbortEPKcS1+582)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] native: #5 pc 000b010d /system/lib/libart.so (_ZN3art9JniAbortFEPKcS1_z+60)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] native: #6 pc 000b321d /system/lib/libart.so (_ZN3art11ScopedCheckC2EP7_JNIEnviPKc+1284)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] native: #7 pc 000bcaed /system/lib/libart.so (_ZN3art8CheckJNI12MonitorEnterEP7_JNIEnvP8_jobject+40)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] native: #8 pc 000034c3 /data/app/xxx-1/lib/arm/libgifimage.so (???)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] native: #9 pc 0000369f /data/app/xxx-1/lib/arm/libgifimage.so (???)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] native: #10 pc 000a2351 /system/lib/libart.so (art_quick_generic_jni_trampoline+32)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] native: #11 pc 0007e880 (???)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at com.facebook.animated.gif.GifFrame.nativeRenderFrame(Native method)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at com.facebook.animated.gif.GifFrame.renderFrame(GifFrame.java:50)
12-26 15:25:56.003 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at com.facebook.imagepipeline.animated.impl.AnimatedDrawableBackendImpl.renderImageDoesNotSupportScaling(AnimatedDrawableBackendImpl.java:221)
12-26 15:25:56.013 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] - locked <0x0975a311> (a com.facebook.imagepipeline.animated.impl.AnimatedDrawableBackendImpl)
12-26 15:25:56.013 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at com.facebook.imagepipeline.animated.impl.AnimatedDrawableBackendImpl.renderFrame(AnimatedDrawableBackendImpl.java:179)
12-26 15:25:56.013 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at com.facebook.imagepipeline.animated.impl.AnimatedImageCompositor.renderFrame(AnimatedImageCompositor.java:120)
12-26 15:25:56.013 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at com.facebook.fresco.animation.bitmap.wrapper.AnimatedDrawableBackendFrameRenderer.renderFrame(AnimatedDrawableBackendFrameRenderer.java:74)
12-26 15:25:56.013 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at com.facebook.fresco.animation.bitmap.preparation.DefaultBitmapFramePreparer$FrameDecodeRunnable.renderFrameAndCache(DefaultBitmapFramePreparer.java:175)
12-26 15:25:56.013 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at com.facebook.fresco.animation.bitmap.preparation.DefaultBitmapFramePreparer$FrameDecodeRunnable.prepareFrameAndCache(DefaultBitmapFramePreparer.java:154)
12-26 15:25:56.013 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at com.facebook.fresco.animation.bitmap.preparation.DefaultBitmapFramePreparer$FrameDecodeRunnable.prepareFrameAndCache(DefaultBitmapFramePreparer.java:162)
12-26 15:25:56.013 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at com.facebook.fresco.animation.bitmap.preparation.DefaultBitmapFramePreparer$FrameDecodeRunnable.run(DefaultBitmapFramePreparer.java:112)
12-26 15:25:56.013 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at com.facebook.common.executors.ConstrainedExecutorService$Worker.run(ConstrainedExecutorService.java:177)
12-26 15:25:56.013 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
12-26 15:25:56.013 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
12-26 15:25:56.013 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:42)
12-26 15:25:56.013 5553-5674/xxx A/art: art/runtime/check_jni.cc:65] at java.lang.Thread.run(Thread.java:818)

@foghina
Copy link
Contributor

foghina commented Jan 8, 2018

@oprisnik probably a malformed gif?

@oprisnik
Copy link
Contributor

The GIF plays correctly for me in the Showcase sample app media picker example when I auto play animations: mSimpleDraweeView.setController(Fresco.newDraweeControllerBuilder().setAutoPlayAnimations(true).setUri(data.getData()).build());

I recently fixed partial frame rendering, which might have fixed this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants