okio: ArrayIndexOutOfBoundsException at okio.Base64.encode(Base64.java:137)

OS:

Android 5.1 100%

Devices:

Archos 36% condor 27% Meizu 23% HUAWEI 14%

Stacktrace:

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=1840; index=320371712
       at okio.Base64.encode(Base64.java:137)
       at okio.Base64.encode(Base64.java:125)
       at okio.ByteString.base64(ByteString.java:131)
       at okhttp3.Cache$Entry.writeCertList(Cache.java:683)
       at okhttp3.Cache$Entry.writeTo(Cache.java:646)
       at okhttp3.Cache.put(Cache.java:250)
       at okhttp3.Cache$1.put(Cache.java:149)
       at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:131)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
       at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
       at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
       at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:143)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
       at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
       at okhttp3.RealCall$AsyncCall.execute(RealCall.java:147)
       at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
       at java.lang.Thread.run(Thread.java:818)

Many Picasso-related tasks in the other threads.

Can provide further info if needed

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 5
  • Comments: 46 (7 by maintainers)

Commits related to this issue

Most upvoted comments

ok, guys, AND SOLUTION IS…

wait for it…

… just disable D8…

gradle.properties > android.enableD8=false.

Now let’s go to pub and drink a lot of beers, because I spend on this shit all 2 DAYS 😕.

Tested for you on our big project and on some small demo project just with one library (okhttp3).

@pavlus @anupdey99 As far as we (the D8 team) knows, we have worked around all the VM bugs that were uncovered by D8 generated code for okio. So, yes, this issue has been worked around and should no longer happen. We were able to reproduce using 5.1 devices as well as 4.4 devices and our workarounds make our examples run without issues.

If anyone are still seeing issues with android studio 3.1.3 please do file bug reports at: https://issuetracker.google.com/issues/new?component=317603&template=1018721

Thanks! Mads

That is not a solution. D8 is becoming the default and the underlying cause must be found.

On Wed, Nov 15, 2017, 12:15 PM Matěj Trakal notifications@github.com wrote:

ok, guys, AND SOLUTION IS…

wait for it…

… just disable D8…

gradle.properties > android.enableD8=false.

Now let’s go to drink a lot of beers, because I spend on this shit all 2 DAYS 😕.

Tested for you on our big project and on some small demo project just with one library (okhtt3).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/square/okio/issues/325#issuecomment-344662797, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEEUMvd9iXDkh2pItNv6v7yEpe0gazks5s2xw2gaJpZM4QbaVP .

We see the same issue from 8 of November. Affecting many libraries using okhttp -> okio.

We have landed a workaround for this bug in the custom MediaTek Art version. That workaround is finally available in Android Studio 3.1 canary 6 which is available for download now. I hope this solves these issues for everyone. If you still see these issues after compiling with 3.1 canary 6, please do file another bug report so we can look into it.

Debug builds might disable AOT compilation for faster app installation times during development. Check if vmSafeMode is set to true in the generated manifest.

From what has been reported so far I believe it’s likely that dex2oat is either producing incorrect code or is producing code that triggers a bug in the CPU.

The next step should probably be to generate a minimal working example that triggers the bug. Then look at the dex2oat output.

Any update?

We are going to buy one, so after wi will try to reproduce it and try to check what’s happen. On AVD, Genymotion and Samsung virtual devices we can’t reproduce it. We will try to provide more info later