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 playing some Animated webp. #1954

Closed
duxxz opened this issue Oct 27, 2017 · 7 comments
Closed

Crash when playing some Animated webp. #1954

duxxz opened this issue Oct 27, 2017 · 7 comments
Assignees
Labels

Comments

@duxxz
Copy link

duxxz commented Oct 27, 2017

We use GitHub Issues for bugs.

If you have a non-bug question, please ask on Stack Overflow: http://stackoverflow.com/questions/tagged/fresco

--- Please use this template, and delete everything above this line before submitting your issue ---

Description

it can render a few frames , but crash later.

Reproduction
Play the webp -> https://github.com/KeepLearningKeepGoing/LearningNotes/blob/master/10002802_broken.webp

Solution

Additional Information
i got some log output for help.

10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: JNI MonitorEnter called with pending exception java.lang.IllegalStateException: Failed to decode frame
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at void com.facebook.animated.webp.WebPFrame.nativeRenderFrame(int, int, android.graphics.Bitmap) (WebPFrame.java:-2)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at void com.facebook.animated.webp.WebPFrame.renderFrame(int, int, android.graphics.Bitmap) (WebPFrame.java:50)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at void com.facebook.imagepipeline.animated.impl.AnimatedDrawableBackendImpl.renderImageSupportsScaling(android.graphics.Canvas, com.facebook.imagepipeline.animated.base.AnimatedImageFrame) (AnimatedDrawableBackendImpl.java:203)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at void com.facebook.imagepipeline.animated.impl.AnimatedDrawableBackendImpl.renderFrame(int, android.graphics.Canvas) (AnimatedDrawableBackendImpl.java:177)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at void com.facebook.imagepipeline.animated.impl.AnimatedImageCompositor.renderFrame(int, android.graphics.Bitmap) (AnimatedImageCompositor.java:120)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at boolean com.facebook.fresco.animation.bitmap.wrapper.AnimatedDrawableBackendFrameRenderer.renderFrame(int, android.graphics.Bitmap) (AnimatedDrawableBackendFrameRenderer.java:74)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at boolean com.facebook.fresco.animation.bitmap.preparation.DefaultBitmapFramePreparer$FrameDecodeRunnable.renderFrameAndCache(int, com.facebook.common.references.CloseableReference, int) (DefaultBitmapFramePreparer.java:175)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at boolean com.facebook.fresco.animation.bitmap.preparation.DefaultBitmapFramePreparer$FrameDecodeRunnable.prepareFrameAndCache(int, int) (DefaultBitmapFramePreparer.java:154)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at boolean com.facebook.fresco.animation.bitmap.preparation.DefaultBitmapFramePreparer$FrameDecodeRunnable.prepareFrameAndCache(int, int) (DefaultBitmapFramePreparer.java:162)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at void com.facebook.fresco.animation.bitmap.preparation.DefaultBitmapFramePreparer$FrameDecodeRunnable.run() (DefaultBitmapFramePreparer.java:112)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at void com.facebook.common.executors.ConstrainedExecutorService$Worker.run() (ConstrainedExecutorService.java:177)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1113)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:588)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at void com.facebook.imagepipeline.core.PriorityThreadFactory$1.run() (PriorityThreadFactory.java:42)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at void java.lang.Thread.run() (Thread.java:818)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410]
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] in call to MonitorEnter
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] from void com.facebook.animated.webp.WebPFrame.nativeRenderFrame(int, int, android.graphics.Bitmap)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] "Thread-7809" prio=5 tid=86 Runnable
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] | group="main" sCount=0 dsCount=0 obj=0x33d2c100 self=0xd7724e00
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] | sysTid=31483 nice=10 cgrp=bg_non_interactive sched=0/0 handle=0xc7f7f930
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] | state=R schedstat=( 118803164 71801828 135 ) utm=11 stm=0 core=0 HZ=100
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] | stack=0xc7e7d000-0xc7e7f000 stackSize=1038KB
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] | held mutexes= "mutator lock"(shared held)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] native: #00 pc 0035cd85 /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiPKcPNS_9ArtMethodEPv+116)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] native: #1 pc 0033d753 /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+138)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] native: #2 pc 0024f8f9 /system/lib/libart.so (ZN3art9JavaVMExt8JniAbortEPKcS2+760)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] native: #3 pc 0024ff97 /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+54)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] native: #4 pc 000fc033 /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+30)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] native: #5 pc 00100f0f /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE.constprop.95+5054)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] native: #6 pc 0010cac3 /system/lib/libart.so (_ZN3art8CheckJNI12MonitorEnterEP7_JNIEnvP8_jobject+370)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] native: #7 pc 000089cb /data/app/com.sohu.qianfan-1/lib/arm/libstatic-webp.so (???)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] native: #8 pc 00008b91 /data/app/com.sohu.qianfan-1/lib/arm/libstatic-webp.so (???)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] native: #9 pc 000ea8c9 /system/lib/libart.so (art_quick_generic_jni_trampoline+40)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] native: #10 pc 000e61d1 /system/lib/libart.so (art_quick_invoke_stub_internal+64)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] native: #11 pc 003eb9e3 /system/lib/libart.so (art_quick_invoke_stub+170)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] native: #12 pc 000ff3a4 [stack:31483] (???)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at com.facebook.animated.webp.WebPFrame.nativeRenderFrame(Native method)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at com.facebook.animated.webp.WebPFrame.renderFrame(WebPFrame.java:50)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at com.facebook.imagepipeline.animated.impl.AnimatedDrawableBackendImpl.renderImageSupportsScaling(AnimatedDrawableBackendImpl.java:203)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] - locked <0x09d071be> (a com.facebook.imagepipeline.animated.impl.AnimatedDrawableBackendImpl)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at com.facebook.imagepipeline.animated.impl.AnimatedDrawableBackendImpl.renderFrame(AnimatedDrawableBackendImpl.java:177)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at com.facebook.imagepipeline.animated.impl.AnimatedImageCompositor.renderFrame(AnimatedImageCompositor.java:120)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at com.facebook.fresco.animation.bitmap.wrapper.AnimatedDrawableBackendFrameRenderer.renderFrame(AnimatedDrawableBackendFrameRenderer.java:74)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at com.facebook.fresco.animation.bitmap.preparation.DefaultBitmapFramePreparer$FrameDecodeRunnable.renderFrameAndCache(DefaultBitmapFramePreparer.java:175)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at com.facebook.fresco.animation.bitmap.preparation.DefaultBitmapFramePreparer$FrameDecodeRunnable.prepareFrameAndCache(DefaultBitmapFramePreparer.java:154)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at com.facebook.fresco.animation.bitmap.preparation.DefaultBitmapFramePreparer$FrameDecodeRunnable.prepareFrameAndCache(DefaultBitmapFramePreparer.java:162)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at com.facebook.fresco.animation.bitmap.preparation.DefaultBitmapFramePreparer$FrameDecodeRunnable.run(DefaultBitmapFramePreparer.java:112)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at com.facebook.common.executors.ConstrainedExecutorService$Worker.run(ConstrainedExecutorService.java:177)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:42)
10-27 16:05:41.425 29538-31483/xx A/art: art/runtime/java_vm_ext.cc:410] at java.lang.Thread.run(Thread.java:818)

  • Fresco version: [1.5.0]
  • Platform version: [ALL Device]
@lambdapioneer
Copy link
Contributor

Can reproduce using the URI override in the sample app and then going to the WebP fragment: https://github.com/KeepLearningKeepGoing/LearningNotes/blob/master/10002802_broken.webp?raw=true

11-01 14:19:03.530  1281  1281 F DEBUG   : Build fingerprint: 'Android/sdk_google_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys'
11-01 14:19:03.530  1281  1281 F DEBUG   : Revision: '0'
11-01 14:19:03.530  1281  1281 F DEBUG   : ABI: 'x86'
11-01 14:19:03.530  1281  1281 F DEBUG   : pid: 3229, tid: 3229, name: amples.showcase  >>> com.facebook.fresco.samples.showcase <<<
11-01 14:19:03.530  1281  1281 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
11-01 14:19:03.533  1281  1281 F DEBUG   : Abort message: 'art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: JNI MonitorEnter called with pending exception java.lang.IllegalStateException: Failed to decode frame'
11-01 14:19:03.533  1281  1281 F DEBUG   :     eax 00000000  ebx 00000c9d  ecx 00000c9d  edx 00000006
11-01 14:19:03.533  1281  1281 F DEBUG   :     esi b7754c50  edi 0000000b
11-01 14:19:03.533  1281  1281 F DEBUG   :     xcs 00000073  xds 0000007b  xes 0000007b  xfs 00000007  xss 0000007b
11-01 14:19:03.533  1281  1281 F DEBUG   :     eip b731d656  ebp 00000c9d  esp bfe4ca30  flags 00200202
11-01 14:19:03.537  1281  1281 F DEBUG   :
11-01 14:19:03.537  1281  1281 F DEBUG   : backtrace:
11-01 14:19:03.537  1281  1281 F DEBUG   :     #00 pc 00083656  /system/lib/libc.so (tgkill+22)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #01 pc 000815f8  /system/lib/libc.so (pthread_kill+70)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #02 pc 00027205  /system/lib/libc.so (raise+36)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #03 pc 000209e4  /system/lib/libc.so (abort+80)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #04 pc 005173cb  /system/lib/libart.so (art::Runtime::Abort()+377)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #05 pc 0014d9f3  /system/lib/libart.so (art::LogMessage::~LogMessage()+1343)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #06 pc 003a5252  /system/lib/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+3842)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #07 pc 003a5eac  /system/lib/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, char*)+116)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #08 pc 00163a10  /system/lib/libart.so (art::ScopedCheck::AbortF(char const*, ...)+62)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #09 pc 0016d9d2  /system/lib/libart.so (art::ScopedCheck::CheckThread(_JNIEnv*)+1890)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #10 pc 0016e4e1  /system/lib/libart.so (art::ScopedCheck::Check(art::ScopedObjectAccess&, bool, char const*, art::JniValueType*) (.constprop.114)+1489)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #11 pc 00183743  /system/lib/libart.so (art::CheckJNI::MonitorEnter(_JNIEnv*, _jobject*)+601)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #12 pc 0000a76f  /data/app/com.facebook.fresco.samples.showcase-1/lib/x86/libstatic-webp.so
11-01 14:19:03.537  1281  1281 F DEBUG   :     #13 pc 0000ab85  /data/app/com.facebook.fresco.samples.showcase-1/lib/x86/libstatic-webp.so
11-01 14:19:03.537  1281  1281 F DEBUG   :     #14 pc 00d27298  /data/app/com.facebook.fresco.samples.showcase-1/oat/x86/base.odex (offset 0x664000) (void com.facebook.animated.webp.WebPFrame.nativeRenderFrame(int, int, android.graphics.Bitmap)+156)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #15 pc 00d277a0  /data/app/com.facebook.fresco.samples.showcase-1/oat/x86/base.odex (offset 0x664000) (void com.facebook.animated.webp.WebPFrame.renderFrame(int, int, android.graphics.Bitmap)+84)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #16 pc 00d65a54  /data/app/com.facebook.fresco.samples.showcase-1/oat/x86/base.odex (offset 0x664000) (void com.facebook.imagepipeline.animated.impl.AnimatedDrawableBackendImpl.renderImageSupportsScaling(android.graphics.Canvas, com.facebook.imagepipeline.animated.base.AnimatedImageFrame)+1064)
11-01 14:19:03.537  1281  1281 F DEBUG   :     #17 pc 00d6694a  /data/app/com.facebook.fresco.samples.showcase-1/oat/x86/base.odex (offset 0x664000) (void com.facebook.imagepipeline.animated.impl.AnimatedDrawableBackendImpl.renderFrame(int, android.graphics.Canvas)+206)

@oprisnik is this something that looks familiar to you? We'll most likely need to check for pendingExceptions in libstatic-webp.so

@oprisnik
Copy link
Contributor

oprisnik commented Nov 1, 2017

I don't think I've seen this before, should we show nothing instead for broken WebPs?

@lambdapioneer
Copy link
Contributor

At least it should not crash the app. I think the best is to propagate as a imagepipeline failure to the listeners

@duxxz
Copy link
Author

duxxz commented Nov 3, 2017

@lambdapioneer yes, it should not crash the app. What is more serious is that it can't be catched.

@oprisnik oprisnik self-assigned this Jan 18, 2018
@BryceLee
Copy link

BryceLee commented Apr 8, 2018

I also meet this problem .How to resolve it Please?
Fresco version: [1.8.0]
Device:SM-N9208

@angelkjos
Copy link

We fixed the crash. It will be handled correctly now.
The fix will be available in the next release.

@oprisnik oprisnik closed this as completed Jun 4, 2018
@BUPT-LXP
Copy link

We fixed the crash. It will be handled correctly now.
The fix will be available in the next release.

Hi, has this been fixed in the latest release? I didn't see it in neither v1.10.0 nor v1.11.0.

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

No branches or pull requests

6 participants