facebook / fresco

An Android library for managing images and the memory they use.
https://frescolib.org/
MIT License
17.07k stars 3.75k forks source link

Native Crash on Android P #2266

Open emile2013 opened 5 years ago

emile2013 commented 5 years ago

Hi, we found some native crash on android P with fresco 1.9.0 . crash stack show below:

00 lr 00411fb4 /system/lib/libhwui.so [armeabi-v7a]

java: android.graphics.BitmapFactory.nativeDecodeStream(Native Method) android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:961) android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:908) com.facebook.imagepipeline.platform.ArtDecoder.com.facebook.common.references.CloseableReference decodeStaticImageFromStream(java.io.InputStream,android.graphics.BitmapFactory$Options,android.graphics.Rect)(SourceFile:175) com.facebook.imagepipeline.platform.ArtDecoder.com.facebook.common.references.CloseableReference decodeFromEncodedImage(com.facebook.imagepipeline.image.EncodedImage,android.graphics.Bitmap$Config,android.graphics.Rect)(SourceFile:85) com.facebook.imagepipeline.decoder.DefaultImageDecoder.com.facebook.imagepipeline.image.CloseableStaticBitmap decodeStaticImage(com.facebook.imagepipeline.image.EncodedImage,com.facebook.imagepipeline.common.ImageDecodeOptions)(SourceFile:147) com.facebook.imagepipeline.decoder.DefaultImageDecoder$1.com.facebook.imagepipeline.image.CloseableImage decode(com.facebook.imagepipeline.image.EncodedImage,int,com.facebook.imagepipeline.image.QualityInfo,com.facebook.imagepipeline.common.ImageDecodeOptions)(SourceFile:64) com.facebook.imagepipeline.decoder.DefaultImageDecoder.com.facebook.imagepipeline.image.CloseableImage decode(com.facebook.imagepipeline.image.EncodedImage,int,com.facebook.imagepipeline.image.QualityInfo,com.facebook.imagepipeline.common.ImageDecodeOptions)(SourceFile:119) com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.void doDecode(com.facebook.imagepipeline.image.EncodedImage,int)(SourceFile:254) com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.access$300(SourceFile:113) com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder$1.void run(com.facebook.imagepipeline.image.EncodedImage,int)(SourceFile:152) com.facebook.imagepipeline.producers.JobScheduler.void doJob()(SourceFile:202) com.facebook.imagepipeline.producers.JobScheduler.access$000(SourceFile:22) com.facebook.imagepipeline.producers.JobScheduler$1.void run()(SourceFile:73) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) java.lang.Thread.run(Thread.java:784)

stale[bot] commented 5 years ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug" or "enhancement" and I will leave it open. Thank you for your contributions.

oprisnik commented 5 years ago

Hi. Please fill out the issue template since posting just the stack trace is not enough information to know what's going on.

emile2013 commented 5 years ago

Hi. Please fill out the issue template since posting just the stack trace is not enough information to know what's going on.

Hi,oprisnik. It is just a SIGSEGV(SEGV_MAPERR) crash, happen at first image render in huawei android P devices. It is also exist in fresco 1.11.0.

defHLT commented 5 years ago

@emile2013 Is there a way to repro?

MurcyRampage commented 5 years ago

@emile2013 Hi,Do you have any solutions?

conncui commented 5 years ago

similar issue, Android 9 ,Huawei P20, Fresco 1.10

com.facebook.imagepipeline.j.a.a is com.facebook.imagepipeline.platform.ArtDecoder . log : 05-30 14:58:00.894 31298 31520 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 31520 (Fresco_DecodeEx), pid 31298 (com.xxxxxx) 05-30 14:58:00.971 31528 31528 F DEBUG : 05-30 14:58:00.971 31528 31528 F DEBUG : Build fingerprint: 'HUAWEI/EML-AL00/HWEML:9/HUAWEIEML-AL00/187C00R1:user/release-keys' 05-30 14:58:00.971 31528 31528 F DEBUG : Revision: '0' 05-30 14:58:00.971 31528 31528 F DEBUG : ABI: 'arm' 05-30 14:58:00.971 31528 31528 F DEBUG : pid: 31298, tid: 31520, name: Fresco_DecodeEx >>> com.aaaa.bbbbb <<< 05-30 14:58:00.971 31528 31528 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 05-30 14:58:00.971 31528 31528 F DEBUG : Cause: null pointer dereference 05-30 14:58:00.971 31528 31528 F DEBUG : r0 b365c520 r1 00000000 r2 b365d4e0 r3 b365da20 05-30 14:58:00.971 31528 31528 F DEBUG : r4 b365c520 r5 b365da20 r6 e84b1e88 r7 00000000 05-30 14:58:00.971 31528 31528 F DEBUG : r8 00000008 r9 00000000 r10 b3632a40 r11 b365d4e0 05-30 14:58:00.971 31528 31528 F DEBUG : ip 00000368 sp b3b5f998 lr e835a15c pc 00000000 05-30 14:58:01.174 31298 31565 I chatty : uid=10195(com.aaaa.bbbbb) expire 1 line 05-30 14:58:01.204 31528 31528 F DEBUG : 05-30 14:58:01.204 31528 31528 F DEBUG : backtrace: 05-30 14:58:01.204 31528 31528 F DEBUG : #00 pc 00000000 05-30 14:58:01.204 31528 31528 F DEBUG : #01 pc 00431158 /system/lib/libhwui.so (EmitFancyRGB+180) 05-30 14:58:01.204 31528 31528 F DEBUG : #02 pc 0042f530 /system/lib/libhwui.so (CustomPut.llvm.1255430924+52) 05-30 14:58:01.204 31528 31528 F DEBUG : #03 pc 00460d34 /system/lib/libhwui.so (FinishRow.llvm.1366891015+2072) 05-30 14:58:01.204 31528 31528 F DEBUG : #04 pc 0042e910 /system/lib/libhwui.so (IDecode.llvm.4256924377+1112) 05-30 14:58:01.204 31528 31528 F DEBUG : #05 pc 000fa2b5 /system/lib/libhwui.so (SkWebpCodec::onGetPixels(SkImageInfo const&, void, unsigned int, SkCodec::Options const&, int)+1980) 05-30 14:58:01.204 31528 31528 F DEBUG : #06 pc 000eae09 /system/lib/libhwui.so (SkCodec::getPixels(SkImageInfo const&, void, unsigned int, SkCodec::Options const)+424) 05-30 14:58:01.204 31528 31528 F DEBUG : #07 pc 000f9261 /system/lib/libhwui.so (SkWebpAdapterCodec::onGetAndroidPixels(SkImageInfo const&, void, unsigned int, SkAndroidCodec::AndroidOptions const&)+72) 05-30 14:58:01.204 31528 31528 F DEBUG : #08 pc 000e70b3 /system/lib/libhwui.so (SkAndroidCodec::getAndroidPixels(SkImageInfo const&, void, unsigned int, SkAndroidCodec::AndroidOptions const)+498) 05-30 14:58:01.204 31528 31528 F DEBUG : #09 pc 000d7ccd /system/lib/libandroid_runtime.so (doDecode(_JNIEnv, std::1::unique_ptr<SkStreamRewindable, std::__1::default_delete>, _jobject, _jobject, bool)+3460) 05-30 14:58:01.204 31528 31528 F DEBUG : #10 pc 000d8fa1 /system/lib/libandroid_runtime.so (nativeDecodeStream(_JNIEnv, _jobject, _jobject, _jbyteArray, _jobject, _jobject)+80) 05-30 14:58:01.204 31528 31528 F DEBUG : #11 pc 003f3cd3 /system/framework/arm/boot-framework.oat (offset 0x3ee000) (android.graphics.BitmapFactory.nativeDecodeStream [DEDUPED]+186) 05-30 14:58:01.204 31528 31528 F DEBUG : #12 pc 007898b9 /system/framework/arm/boot-framework.oat (offset 0x3ee000) (android.graphics.BitmapFactory.decodeStream+632) 05-30 14:58:01.204 31528 31528 F DEBUG : #13 pc 0098bfdb /data/app/com.aaaa.bbbbb-NUBonrtX-torunySnOhXTw==/oat/arm/base.odex (offset 0x2e6000) (com.facebook.imagepipeline.j.a.a+1250) 05-30 14:58:01.204 31528 31528 F DEBUG : #14 pc 0098b6af /data/app/com.aaaa.bbbbb-NUBonrtX-torunySnOhXTw==/oat/arm/base.odex (offset 0x2e6000) (com.facebook.imagepipeline.j.a.a+310) 05-30 14:58:01.204 31528 31528 F DEBUG : #15 pc 0098585d /data/app/com.aaaa.bbbbb-NUBonrtX-torunySnOhXTw==/oat/arm/base.odex (offset 0x2e6000) (com.facebook.imagepipeline.f.b.a+252) 05-30 14:58:01.204 31528 31528 F DEBUG : #16 pc 0098515f /data/app/com.aaaa.bbbbb-NUBonrtX-torunySnOhXTw==/oat/arm/base.odex (offset 0x2e6000) (com.facebook.imagepipeline.f.b$1.a+678) 05-30 14:58:01.204 31528 31528 F DEBUG : #17 pc 009856d5 /data/app/com.aaaa.bbbbb-NUBonrtX-torunySnOhXTw==/oat/arm/base.odex (offset 0x2e6000) (com.facebook.imagepipeline.f.b.a+596) 05-30 14:58:01.204 31528 31528 F DEBUG : #18 pc 009a6afd /data/app/com.aaaa.bbbbb-NUBonrtX-torunySnOhXTw==/oat/arm/base.odex (offset 0x2e6000) (com.facebook.imagepipeline.producers.m$c.c+1764) 05-30 14:58:01.204 31528 31528 F DEBUG : #19 pc 009a8677 /data/app/com.aaaa.bbbbb-NUBonrtX-torunySnOhXTw==/oat/arm/base.odex (offset 0x2e6000) (com.facebook.imagepipeline.producers.m$c$1.d+598) 05-30 14:58:01.204 31528 31528 F DEBUG : #20 pc 009995d9 /data/app/com.aaaa.bbbbb-NUBonrtX-torunySnOhXTw==/oat/arm/base.odex (offset 0x2e6000) (com.facebook.imagepipeline.producers.JobScheduler.fcF+352) 05-30 14:58:01.204 31528 31528 F DEBUG : #21 pc 00998a5f /data/app/com.aaaa.bbbbb-NUBonrtX-torunySnOhXTw==/oat/arm/base.odex (offset 0x2e6000) (com.facebook.imagepipeline.producers.JobScheduler$1.run+182) 05-30 14:58:01.204 31528 31528 F DEBUG : #22 pc 003d7bd9 /system/framework/arm/boot.oat (offset 0x132000) (java.util.concurrent.ThreadPoolExecutor.runWorker+1048) 05-30 14:58:01.204 31528 31528 F DEBUG : #23 pc 003d4c2f /system/framework/arm/boot.oat (offset 0x132000) (java.util.concurrent.ThreadPoolExecutor$Worker.run+54) 05-30 14:58:01.204 31528 31528 F DEBUG : #24 pc 0097fad3 /data/app/com.aaaa.bbbbb-NUBonrtX-torunySnOhXTw==/oat/arm/base.odex (offset 0x2e6000) (com.facebook.imagepipeline.d.k$1.run+226) 05-30 14:58:01.204 31528 31528 F DEBUG : #25 pc 00270911 /system/framework/arm/boot.oat (offset 0x132000) (java.lang.Thread.run+64) 05-30 14:58:01.204 31528 31528 F DEBUG : #26 pc 00430375 /system/lib/libart.so (art_quick_invoke_stub_internal+68) 05-30 14:58:01.204 31528 31528 F DEBUG : #27 pc 004091a1 /system/lib/libart.so (art_quick_invoke_stub+224) 05-30 14:58:01.204 31528 31528 F DEBUG : #28 pc 000a4901 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread, unsigned int, unsigned int, art::JValue, char const)+136) 05-30 14:58:01.204 31528 31528 F DEBUG : #29 pc 00365029 /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod, art::(anonymous namespace)::ArgArray, art::JValue, char const)+52) 05-30 14:58:01.204 31528 31528 F DEBUG : #30 pc 00365dbd /system/lib/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject, _jmethodID, jvalue)+316) 05-30 14:58:01.204 31528 31528 F DEBUG : #31 pc 00387d19 /system/lib/libart.so (art::Thread::CreateCallback(void)+900) 05-30 14:58:01.204 31528 31528 F DEBUG : #32 pc 00065413 /system/lib/libc.so (pthread_start(void*)+22) 05-30 14:58:01.204 31528 31528 F DEBUG : #33 pc 0001e819 /system/lib/libc.so (__start_thread+32) 05-30 14:58:01.509 1148 1524 I chatty : uid=1000(system) NetdConnector expire 16 lines

s1rius commented 5 years ago

same here

fw1088 commented 5 years ago

I also meet this question

MurcyRampage commented 5 years ago

When are you going to solve this problem? HUAWEI and android P are more and more popular in China.😹

ace0527 commented 5 years ago

@conncui Do you have solutions about this crash ? I met the same problem and was strugling getting native stacktrace. 大佬有找到原因和解决方法吗

fw1088 commented 5 years ago

I find two ways to solve this issue. one,use third webp decode(libwebp) and don't use api such api like inBitmap,Bitmap.Compress(WEBP) in Android 9 decode webp two,convert webp to png/bitmap(libwebp),then use system decode,if your code have used api that like Bitmap.Compress(WEBP), you can add some code like this "if OSVERSION != 28 then Bitmap.Compress(WEBP) else ... ".

ace0527 commented 5 years ago

@fw1088 大佬给个邮箱?

conncui commented 4 years ago

I find two ways to solve this issue. one,use third webp decode(libwebp) and don't use api such api like inBitmap,Bitmap.Compress(WEBP) in Android 9 decode webp two,convert webp to png/bitmap(libwebp),then use system decode,if your code have used api that like Bitmap.Compress(WEBP), you can add some code like this "if OSVERSION != 28 then Bitmap.Compress(WEBP) else ... ".

Do you have scene to reproduce this bug?@fw1088

teffy commented 4 years ago

same issue,any solution?

We can modify the system framework.

fw1088 commented 4 years ago

I find two ways to solve this issue. one,use third webp decode(libwebp) and don't use api such api like inBitmap,Bitmap.Compress(WEBP) in Android 9 decode webp two,convert webp to png/bitmap(libwebp),then use system decode,if your code have used api that like Bitmap.Compress(WEBP), you can add some code like this "if OSVERSION != 28 then Bitmap.Compress(WEBP) else ... ".

Do you have scene to reproduce this bug?@fw1088

No,you can refer to this issue https://bugs.chromium.org/p/webp/issues/detail?id=419#c1

fw1088 commented 4 years ago

same issue,any solution?

We can modify the system framework.

https://bugs.chromium.org/p/webp/issues/detail?id=419#c1

thirtyyuan commented 4 years ago

same issue,any solution? We can modify the system framework.

https://bugs.chromium.org/p/webp/issues/detail?id=419#c1

Thx! But I didn't use Bitmap.Compress() with fresco, so if fresco use it inner, how can I solve it?

snepalnetflix commented 4 years ago

Hi, we're seeing this issue as well. This is with Fresco 2.2.0.

If this is device specific, should we switch to the Java only Fresco version?

snepalnetflix commented 4 years ago

Here are some devices where we're seeing this crash:

kaitian521 commented 3 years ago

met same crash in Glide

kaitian521 commented 3 years ago

Although it is from Glide, also useful for fresco

00 lr 004bb284 /system/lib/libhwui.so (WebPRescalerImport+132) [armeabi-v8]

-- 2 java: 3 android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:756) 4 android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:731) 5 com.bumptech.glide.load.resource.bitmap.Downsampler.decodeStream(Proguard:424) 6 com.bumptech.glide.load.resource.bitmap.Downsampler.decodeFromWrappedStreams(Proguard:243) 7 com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Proguard:176) 8 com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Proguard:134) 9 com.bumptech.glide.load.resource.bitmap.ByteBufferBitmapDecoder.decode(Proguard:31) 10 com.bumptech.glide.load.resource.bitmap.ByteBufferBitmapDecoder.decode(Proguard:15) 11 com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(Proguard:67) 12 com.bumptech.glide.load.engine.DecodePath.decodeResource(Proguard:52) 13 com.bumptech.glide.load.engine.DecodePath.decode(Proguard:43) 14 com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(Proguard:56) 15 com.bumptech.glide.load.engine.LoadPath.load(Proguard:42) 16 com.bumptech.glide.load.engine.DecodeJob.runLoadPath(Proguard:457) 17 com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(Proguard:450) 18 com.bumptech.glide.load.engine.DecodeJob.decodeFromData(Proguard:436) 19 com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(Proguard:390)