Skip to content

java.io.IOException: canceled due to java.lang.ArrayIndexOutOfBoundsException: length=8192; index=-6 at okio.Buffer.indexOf #8080

@odbol

Description

@odbol

Similar to #3938 and #6280:

I don't even understand how index could be negative at that point. There seems to be tons of bounds checking happening at all the entrypoints, so perhaps there's some check that is wrong, or the long overflowing into an int or something?

Error retreiving location (Ask Studio Bot)
                                                                                                    java.io.IOException: canceled due to java.lang.ArrayIndexOutOfBoundsException: length=8192; index=-6
                                                                                                    	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:185)
                                                                                                    	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
                                                                                                    	Suppressed: java.lang.ArrayIndexOutOfBoundsException: length=8192; index=-6
                                                                                                    		at okio.Buffer.indexOf(Buffer.java:1466)
                                                                                                    		at okio.RealBufferedSource.indexOf(RealBufferedSource.java:352)
                                                                                                    		at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:230)
                                                                                                    		at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:224)
                                                                                                    		at okhttp3.internal.cache.DiskLruCache.readJournal(DiskLruCache.java:294)
                                                                                                    		at okhttp3.internal.cache.DiskLruCache.initialize(DiskLruCache.java:228)
                                                                                                    		at okhttp3.internal.cache.DiskLruCache.get(DiskLruCache.java:430)
                                                                                                    		at okhttp3.Cache.get(Cache.java:198)
                                                                                                    		at okhttp3.Cache$1.get(Cache.java:145)
                                                                                                    		at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:55)
                                                                                                    		at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
                                                                                                    		at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
                                                                                                    		at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
                                                                                                    		at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
                                                                                                    		at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
                                                                                                    		at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
                                                                                                    		at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
                                                                                                    		at com.odbol.wear.airquality.purpleair.CachingClient.createClient$lambda$1(CachingClient.kt:61)
                                                                                                    		at com.odbol.wear.airquality.purpleair.CachingClient.$r8$lambda$dieXNzrD9l4hvF6JQkAhyOPAbjE(Unknown Source:0)
                                                                                                    		at com.odbol.wear.airquality.purpleair.CachingClient$$ExternalSyntheticLambda1.intercept(Unknown Source:0)

Source code is here: https://github.com/odbol/air-quality-complication/blob/master/app/src/main/java/com/odbol/wear/airquality/purpleair/CachingClient.kt#L61

Happens running on a Pixel Watch 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug in existing code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions