ArrayIndexOutOfBoundsException on call instance. #1506

Closed
Ncl8 opened this Issue Jan 21, 2016 · 7 comments

Comments

8 participants
@Ncl8

Ncl8 commented Jan 21, 2016

I started to get this error message after upgrading to retrofit:2.0.0-beta3. Not sure if that's the culprit or what since reverting to previous version doesn't seem to make a difference. Just in case the fault was in my retrofit code, i copied the sample code and ran it with the same result.

I only get it on marshmallow devices.

Line 94 refers to Call<List> call = github.contributors("square", "retrofit");

That line is called inside an GenericAsyncTaskLoader (https://gist.github.com/HenokT/7873979)

Calling it in a normal AsyncTask doesn't produce an error.

A/art: art/runtime/thread.cc:1329] Throwing new exception 'length=176; index=1283' with unexpected pending exception: java.lang.ArrayIndexOutOfBoundsException: length=176; index=1283
A/art: art/runtime/thread.cc:1329]   at void com.app.test.loader.SearchLoader.search(com.app.test.loader.SearchLoader$Result) (SearchLoader.java:94)
A/art: art/runtime/thread.cc:1329]   at com.app.test.loader.SearchLoader$Result com.app.test.loader.SearchLoader.loadInBackground() (SearchLoader.java:67)
A/art: art/runtime/thread.cc:1329]   at java.lang.Object com.app.test.loader.SearchLoader.loadInBackground() (SearchLoader.java:29)
A/art: art/runtime/thread.cc:1329]   at java.lang.Object android.support.v4.content.AsyncTaskLoader.onLoadInBackground() (AsyncTaskLoader.java:296)
A/art: art/runtime/thread.cc:1329]   at java.lang.Object android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(java.lang.Void[]) (AsyncTaskLoader.java:54)
A/art: art/runtime/thread.cc:1329]   at java.lang.Object android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(java.lang.Object[]) (AsyncTaskLoader.java:42)
A/art: art/runtime/thread.cc:1329]   at java.lang.Object android.support.v4.content.ModernAsyncTask$2.call() (ModernAsyncTask.java:128)
A/art: art/runtime/thread.cc:1329]   at void java.util.concurrent.FutureTask.run() (FutureTask.java:237)
A/art: art/runtime/thread.cc:1329]   at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1113)
A/art: art/runtime/thread.cc:1329]   at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:588)
A/art: art/runtime/thread.cc:1329]   at void java.lang.Thread.run() (Thread.java:818)
@JakeWharton

This comment has been minimized.

Show comment
Hide comment
@JakeWharton

JakeWharton Jan 21, 2016

Collaborator

This is a bug in the Android Gradle plugin 2.0.0-alpha6. Reverting to alpha3 will fix it. See #1486 for more info and a link to the bug filed on b.android.com.

Collaborator

JakeWharton commented Jan 21, 2016

This is a bug in the Android Gradle plugin 2.0.0-alpha6. Reverting to alpha3 will fix it. See #1486 for more info and a link to the bug filed on b.android.com.

@lemadane

This comment has been minimized.

Show comment
Hide comment
@lemadane

lemadane Aug 9, 2016

I encountered this issue, when I am using Mars-mallow. I do not have an issue using Lollipop. I disabled the Instant Run from Android Studio and the problem is gone.

lemadane commented Aug 9, 2016

I encountered this issue, when I am using Mars-mallow. I do not have an issue using Lollipop. I disabled the Instant Run from Android Studio and the problem is gone.

@iaubain

This comment has been minimized.

Show comment
Hide comment
@iaubain

iaubain Oct 10, 2016

Guys, this issue does have any relation with Retrofit I think.
For me I had same issue but what was causing this was the erroneous processes inside onResponse

@override
public void onResponse(Call call, Response response) {
//Error was happening inside here
//I was calling an other Object instance and passing them wrong parameters
}

Still my instant code running is enabled and everything is as by default.

Hope this will help someone.
a funny thing is that, its my first time to comment on something on Github.... Jejejejeje
Happy coding Day

iaubain commented Oct 10, 2016

Guys, this issue does have any relation with Retrofit I think.
For me I had same issue but what was causing this was the erroneous processes inside onResponse

@override
public void onResponse(Call call, Response response) {
//Error was happening inside here
//I was calling an other Object instance and passing them wrong parameters
}

Still my instant code running is enabled and everything is as by default.

Hope this will help someone.
a funny thing is that, its my first time to comment on something on Github.... Jejejejeje
Happy coding Day

@green130181

This comment has been minimized.

Show comment
Hide comment
@green130181

green130181 May 2, 2017

I also have this issue
pid: 17023, tid: 17107, name: Thread-4 >>> com.android.mms <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'art/runtime/thread.cc:1665] Throwing new exception 'length=3260; index=56452' with unexpected pending exception: java.lang.ArrayIndexOutOfBoundsException: length=3260; index=7360'
x0 0000000000000000 x1 00000000000042d3 x2 0000000000000006 x3 0000000000000008
x4 0000000000000113 x5 0000000000000000 x6 0000000000000000 x7 feff666e6b61686b
x8 0000000000000083 x9 ffffffffffffffdf x10 0000000000000000 x11 0000000000000001
x12 ffffffffffffffff x13 ffffffffffffffff x14 ff00000000000000 x15 ffffffffffffffff
x16 0000007f79d03ed0 x17 0000007f79cad510 x18 0000000000000000 x19 0000007f5da8b4f8
x20 0000000000000006 x21 0000007f5da8b450 x22 000000000000000b x23 0000000000000836
x24 ffffffffffffffff x25 0000007f795fc730 x26 0000007f79587080 x27 0000007f5da88ab1
x28 0000007f7954d29b x29 0000007f5da889e0 x30 0000007f79caa9a0
sp 0000007f5da889c0 pc 0000007f79cad518 pstate 0000000060000000
v0 2e6761742e676f6c2e74736973726570 v1 0000007f5da885400000007f5da889c0
v2 00000000000a00002931363a6176616a v3 00000000000000000000000000000000
v4 00000000001000000000000000000000 v5 40100401401004014010040140100401
v6 00100000000000000010000000000000 v7 000000000000000000000000ebad8077
v8 00000000000000000000000000000000 v9 00000000000000000000000000000000
v10 00000000000000000000000000000000 v11 00000000000000000000000000000000
v12 00000000000000000000000000000000 v13 00000000000000000000000000000000
v14 00000000000000000000000000000000 v15 00000000000000000000000000000000
v16 5a8279995a8279995a8279995a827999 v17 6ed9eba16ed9eba16ed9eba16ed9eba1
v18 8f1bbcdc8f1bbcdc8f1bbcdc8f1bbcdc v19 ca62c1d6ca62c1d6ca62c1d6ca62c1d6
v20 1a4072a0aaed015679f619a02f5afaf0 v21 c1e7b07074b7d89a41d61a2d693230a4
v22 1032547698badcfeefcdab8967452301 v23 000000000000000000000000ebad8087
v24 000000000000000000000000ebad8088 v25 000000000000000000000000ebad8089
v26 000000000000000000000000ebad808a v27 000000000000000000000000ebad808b
v28 000000000000000000000000ebad808c v29 000000000000000000000000ebad808d
v30 000000000000000000000000ebad808e v31 00000000000000000000000000000001
fpsr 00000013 fpcr 00000000
backtrace:
#00 pc 000000000006b518 /system/lib64/libc.so (tgkill+8)
#1 pc 000000000006899c /system/lib64/libc.so (pthread_kill+64)
#2 pc 0000000000023ee8 /system/lib64/libc.so (raise+24)
#3 pc 000000000001c96c /system/lib64/libc.so (abort+52)
#4 pc 00000000002d1b9c /system/lib64/libart.so (offset 0x138000)

I also have this issue
pid: 17023, tid: 17107, name: Thread-4 >>> com.android.mms <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'art/runtime/thread.cc:1665] Throwing new exception 'length=3260; index=56452' with unexpected pending exception: java.lang.ArrayIndexOutOfBoundsException: length=3260; index=7360'
x0 0000000000000000 x1 00000000000042d3 x2 0000000000000006 x3 0000000000000008
x4 0000000000000113 x5 0000000000000000 x6 0000000000000000 x7 feff666e6b61686b
x8 0000000000000083 x9 ffffffffffffffdf x10 0000000000000000 x11 0000000000000001
x12 ffffffffffffffff x13 ffffffffffffffff x14 ff00000000000000 x15 ffffffffffffffff
x16 0000007f79d03ed0 x17 0000007f79cad510 x18 0000000000000000 x19 0000007f5da8b4f8
x20 0000000000000006 x21 0000007f5da8b450 x22 000000000000000b x23 0000000000000836
x24 ffffffffffffffff x25 0000007f795fc730 x26 0000007f79587080 x27 0000007f5da88ab1
x28 0000007f7954d29b x29 0000007f5da889e0 x30 0000007f79caa9a0
sp 0000007f5da889c0 pc 0000007f79cad518 pstate 0000000060000000
v0 2e6761742e676f6c2e74736973726570 v1 0000007f5da885400000007f5da889c0
v2 00000000000a00002931363a6176616a v3 00000000000000000000000000000000
v4 00000000001000000000000000000000 v5 40100401401004014010040140100401
v6 00100000000000000010000000000000 v7 000000000000000000000000ebad8077
v8 00000000000000000000000000000000 v9 00000000000000000000000000000000
v10 00000000000000000000000000000000 v11 00000000000000000000000000000000
v12 00000000000000000000000000000000 v13 00000000000000000000000000000000
v14 00000000000000000000000000000000 v15 00000000000000000000000000000000
v16 5a8279995a8279995a8279995a827999 v17 6ed9eba16ed9eba16ed9eba16ed9eba1
v18 8f1bbcdc8f1bbcdc8f1bbcdc8f1bbcdc v19 ca62c1d6ca62c1d6ca62c1d6ca62c1d6
v20 1a4072a0aaed015679f619a02f5afaf0 v21 c1e7b07074b7d89a41d61a2d693230a4
v22 1032547698badcfeefcdab8967452301 v23 000000000000000000000000ebad8087
v24 000000000000000000000000ebad8088 v25 000000000000000000000000ebad8089
v26 000000000000000000000000ebad808a v27 000000000000000000000000ebad808b
v28 000000000000000000000000ebad808c v29 000000000000000000000000ebad808d
v30 000000000000000000000000ebad808e v31 00000000000000000000000000000001
fpsr 00000013 fpcr 00000000
backtrace:
#00 pc 000000000006b518 /system/lib64/libc.so (tgkill+8)
#1 pc 000000000006899c /system/lib64/libc.so (pthread_kill+64)
#2 pc 0000000000023ee8 /system/lib64/libc.so (raise+24)
#3 pc 000000000001c96c /system/lib64/libc.so (abort+52)
#4 pc 00000000002d1b9c /system/lib64/libart.so (offset 0x138000)

@Antonkog

This comment has been minimized.

Show comment
Hide comment
@Antonkog

Antonkog Dec 7, 2017

I have same issue with 'com.android.tools.build:gradle:3.0.1'
when call with retrofit:
Throwing new exception 'length=668; index=1366' with unexpected pending exception: java.lang.ArrayIndexOutOfBoundsException: length=668; index=1366
I have this only when launch on real device 6.0.1 and on emulator with api 23 everything works fine.

Antonkog commented Dec 7, 2017

I have same issue with 'com.android.tools.build:gradle:3.0.1'
when call with retrofit:
Throwing new exception 'length=668; index=1366' with unexpected pending exception: java.lang.ArrayIndexOutOfBoundsException: length=668; index=1366
I have this only when launch on real device 6.0.1 and on emulator with api 23 everything works fine.

@turkovsky

This comment has been minimized.

Show comment
Hide comment
@turkovsky

turkovsky Dec 19, 2017

I have the same issue, gradle is 3.0.1
Disabling of instant run became helpful

I have the same issue, gradle is 3.0.1
Disabling of instant run became helpful

@myJarvis

This comment has been minimized.

Show comment
Hide comment
@myJarvis

myJarvis Jun 22, 2018

Disabling of instant run solves this error

I faced the same while running app on Emulator with API 23.

just Disable Instant Run and this error disappear and app works fine.

myJarvis commented Jun 22, 2018

Disabling of instant run solves this error

I faced the same while running app on Emulator with API 23.

just Disable Instant Run and this error disappear and app works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment