ArrayIndexOutOfBounds in Thread.getState() ...

by Pent » Thu, 19 May 2011 04:56:32 GMT

Sponsored Links
 I've had this sometimes in the console, wrote it off as sporadic
malign alien influence. A user just contacted me that it started
happening after an upgrade from 2.2 to 2.2.2.

Brief version:

Caused by: java.lang.ArrayIndexOutOfBoundsException
at java.lang.Thread.getState(

Looks like a bug in the library or ... ?

No idea if it happens with newer Android versions, it's not mentioned
by the console error reports.


Full version:

java.lang.RuntimeException: Unable to start service with Intent
{ (has extras) }:
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ArrayIndexOutOfBoundsException
at java.lang.Thread.getState(


Re: ArrayIndexOutOfBounds in Thread.getState() ...

by fadden » Fri, 20 May 2011 07:57:39 GMT


Weird.  That line is:

            int state = thread.getStatus();
            if(state != -1) {
                return VMThread.STATE_MAP[state]; // 812

The STATE_MAP array has Thread.State entries for all valid thread
states, suggesting that the thread is in some weird state.
Unfortunately the exception doesn't say what element it was trying to
access.  (Newer versions of the VM and core libs are more verbose on
these exceptions.)


Sponsored Links

Other Threads

1. Archos 5 porting group

For all those who showed interest in the Android port to the "old"  
Archos 5, there is now a google group you can join at;

2. Anyone with contacts at GetJar?

If anyone has any contacts at GetJar can they pass on the message that  
its' been discovered that AppsLib are using their download hosting  
service possibly without their knowledge or agreement (they're also  
doing it to us and AndAppStore and to SlideME, neither of which they  
have agreements with either).

If they want some proof, tell them to download 
  (the file AppsLib uses to hold release information), and search for  
getjar, they'll then see all the URLs of their that are being used.

I tried using their contact form and kept telling me my message was  
too long even when it was < 100 characters :(.



* Looking for Android Apps? - Try *

Funky Android Limited is registered in England & Wales with the  
company number  6741909.

The views expressed in this email are those of the author and not  
necessarily those of Funky Android Limited, it's associates, or it's  


3. OnCompletion video notification on MediaController and VideView usage?

4. Bug in dalvik? Application will not load on package change

5. Instant Refresh on CursorAdapter attached to a ListView

6. BufferedReader encoding and non-english chars

7. Why Surface postBuffers doesn't work fine sometimes, thanks your reply