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

Native Crash on Android P #2266

Open
emile2013 opened this issue Dec 24, 2018 · 21 comments
Open

Native Crash on Android P #2266

emile2013 opened this issue Dec 24, 2018 · 21 comments
Labels

Comments

@emile2013
Copy link

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
Copy link

stale bot commented Dec 31, 2018

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.

@stale stale bot added the stale label Dec 31, 2018
@oprisnik
Copy link
Contributor

oprisnik commented Jan 8, 2019

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

@oprisnik oprisnik closed this as completed Jan 8, 2019
@emile2013
Copy link
Author

emile2013 commented Feb 18, 2019

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
Copy link
Contributor

defHLT commented Mar 28, 2019

@emile2013 Is there a way to repro?

@MurcyRampage
Copy link

@emile2013 Hi,Do you have any solutions?

@conncui
Copy link
Contributor

conncui commented May 31, 2019

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 : #1 pc 00431158 /system/lib/libhwui.so (EmitFancyRGB+180)
05-30 14:58:01.204 31528 31528 F DEBUG : #2 pc 0042f530 /system/lib/libhwui.so (CustomPut.llvm.1255430924+52)
05-30 14:58:01.204 31528 31528 F DEBUG : #3 pc 00460d34 /system/lib/libhwui.so (FinishRow.llvm.1366891015+2072)
05-30 14:58:01.204 31528 31528 F DEBUG : #4 pc 0042e910 /system/lib/libhwui.so (IDecode.llvm.4256924377+1112)
05-30 14:58:01.204 31528 31528 F DEBUG : #5 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 : #6 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 : #7 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 : #8 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 : #9 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

@oprisnik oprisnik reopened this May 31, 2019
@stale stale bot removed the stale label May 31, 2019
@oprisnik oprisnik added the bug label May 31, 2019
@s1rius
Copy link
Contributor

s1rius commented Jun 17, 2019

same here

@fw1088
Copy link

fw1088 commented Jul 22, 2019

I also meet this question

@MurcyRampage
Copy link

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

@ace0527
Copy link

ace0527 commented Aug 23, 2019

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

@fw1088
Copy link

fw1088 commented Sep 2, 2019

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
Copy link

ace0527 commented Sep 2, 2019

@fw1088 大佬给个邮箱?

@conncui
Copy link
Contributor

conncui commented Sep 30, 2019

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
Copy link

teffy commented Oct 18, 2019

same issue,any solution?

We can modify the system framework.

@fw1088
Copy link

fw1088 commented Nov 29, 2019

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
Copy link

fw1088 commented Nov 29, 2019

same issue,any solution?

We can modify the system framework.

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

@thirtyyuan
Copy link

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
Copy link

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
Copy link

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

  • HUAWEI Y5 2019 (HWAMN-M): Android 9
  • LG K40S (mmh55lm): Android 9
  • Redmi 8A (olivelite): Android 9
  • moto g(6) (ali): Android 9
  • Galaxy J8 (j8y18lte): Android 9
  • moto g(7) play (channel): Android 9 & 10

@kaitian521
Copy link

met same crash in Glide

@kaitian521
Copy link

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)

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

13 participants