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(Thread.java:812)
at net.dinglisch.android.taskerm.ExecuteService.onStart(Unknown
Source)
at android.app.Service.onStartCommand(Service.java:420)

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.

Pent

--------------------------------------------------------------------------------
Full version:

java.lang.RuntimeException: Unable to start service
net.dinglisch.android.taskerm.ExecuteService@45d59050 with Intent
{ cmp=net.dinglisch.android.taskerm/.ExecuteService (has extras) }:
java.lang.ArrayIndexOutOfBoundsException
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:
3153)
at android.app.ActivityThread.access$3800(ActivityThread.java:129)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
2180)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4717)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ArrayIndexOutOfBoundsException
at java.lang.Thread.getState(Thread.java:812)
at net.dinglisch.android.taskerm.ExecuteService.onStart(Unknown
Source)
at android.app.Service.onStartCommand(Service.java:420)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:
3143)

-- 



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. Looking for ListAdaptor pattern

I have a custom layout with a lot of Views. Currently, I build the
entire view hierarchy in the onCreate, though I stream the actual work
in small batches. This works OK up to about 1000 Views and then
performance degrades a little. Obviously, I'd like to use the
ListAdapter pattern and only generate the parts of the View hierarchy
that are visible on the screen.

My parent View, however, is not (and cannot be) any of the existing
ListView types. My question, then, is how do the ListView types
interact with a ListAdapter to limit the number of Views necessary to
represent a big list? More broadly, is there a pattern out there for
extending a LinearLayout to create special ListViews?

-- 

2. how do i call a make file inside Android.mk

I am working on GTV which is basically android.

the Android.mk file gets picked from the build system that does the
needful.

My problem:
I have a application player which is running as a service and another
application discplayer which connects to it and plays the movie.

the player is built differently and it is copied to the appropriate
system/bin folder. It is huge and we intend to only use it as a
external library

android/vendor/videon/player/tools/gtv-discplayer is the structure of
my directory.

now i have the following Android.mk file in the player directory
=============================
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/Makefile

.PHONY: libvideonplayer
libvideonplayer:
        cd $(LOCAL_PATH)/../../../videon/player &&      $(MAKE) dib-config 
install-
bdj all

LOCAL_MODULE := libvideonplayer
include $(call all-subdir-makefiles)
============================

and the following Android.mk is present in the player/tools/gtv-
discplayer
=============================

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

############################################################
LOCAL_STATIC_JAVA_LIBRARIES := videon-lib
LOCAL_MODULE_TAGS := eng user
############################################################

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_REQUIRED_MODULES := libvideonplayer

LOCAL_PACKAGE_NAME := Videon

include $(BUILD_PACKAGE)

############################################################
include $(CLEAR_VARS)

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \
videon-lib:libs/disc_player_service.jar

include $(BUILD_MULTI_PREBUILT)
====================================

now if I do a 'make libvideonplayer' everything goes fine

but if i do a simple make from the topmost android directory the
dicsplayer app gets built but the player does not. Somehow the
libvideonplayer is not being picked up.
I realize that 'ALL_MODULES' is responsible for getting the
LOCAL_MODULES.

Am I missing something here?

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Camera image lost when mobile turn to landscape

4. Javascript

5. ViewFlipper jump to 'page'

6. Paging Om Dolly Pro XL

7. College Android Resources?