FATAL EXCEPTION IN SYSTEM PROCESS: android.bg in Kitkat

2,073 views
Skip to first unread message

ms...@codeaurora.org

unread,
Nov 20, 2013, 4:47:26 AM11/20/13
to android-...@googlegroups.com
Hello Android Developers,

Could you please help out here to avoid the below FATAL exception in system_server process and android.bg thread? This issue was seen in general monkey testing.
Could you please also give somewhat brief idea, what this android.bg does?


12-31 15:56:00.019   854   870 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: android.bg

12-31 15:56:00.019   854   870 E AndroidRuntime: java.lang.IndexOutOfBoundsException: Invalid index 1, size is 1

12-31 15:56:00.019   854   870 E AndroidRuntime: at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)

12-31 15:56:00.019   854   870 E AndroidRuntime: at java.util.ArrayList.get(ArrayList.java:308)

12-31 15:56:00.019   854   870 E AndroidRuntime: at com.android.internal.app.ProcessStats$ProcessState.addPss(ProcessStats.java:2660)

12-31 15:56:00.019   854   870 E AndroidRuntime: at com.android.internal.app.ProcessStats$ProcessState.addPss(ProcessStats.java:2631)

12-31 15:56:00.019   854   870 E AndroidRuntime: at com.android.server.am.ActivityManagerService$3.handleMessage(ActivityManagerService.java:1701)

12-31 15:56:00.019   854   870 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)

12-31 15:56:00.019   854   870 E AndroidRuntime: at android.os.Looper.loop(Looper.java:137)

12-31 15:56:00.019   854   870 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:61)


Thanks,
Maunik

shridutt kothari

unread,
Nov 22, 2013, 5:04:51 AM11/22/13
to android-...@googlegroups.com
Hi ms...,

"android.bg" is the name of a BackgroundThread class, which is a shared singleton background thread for each process. (/frameworks/base/core/java/com/android/internal/os/BackgroundThread.java)
which is used as a part of the framework for all processes, for work that is purely background (no timing constraint).

And by lokking in your logs i can just guess that in /frameworks/base/services/java/com/android/server/am/ActivityManagerService.java at line 1701 where 
proc.baseProcessTracker.addPss(pss, tmp[0], true, proc.pkgList); is being called, and here proc.pkgList is an ArrayList of packages running in the process (see /frameworks/base/services/java/com/android/server/am/ProcessRecord.java) which is making an IndexOutOfBoundsException as there's only single packages running in the process (may be due to some other issue) i.e at oth index and somehow index 1 is beeing tried to access.

So in your case you need to figure out why ProcessRecord.pkgList only containing one packages?? why there's no entry of other packages running in the system processes???

I hope it gives you some pointers.

Thanks,
Shridutt Kothari
impetus Infotech Ltd
Reply all
Reply to author
Forward
0 new messages