Monday, June 14, 2010

[android-developers] Re: Process.setProcessGroup() "Unknown error"?

Forget it. I think I have the issue. Too many open files.

Maybe of interest to others: I frequently saved a "preference" (current article) in the preferences, but this took ages as a whole XML tree needs to be created and written to flash. To speed things up I changed the implementation to a randome access file where I kept the handle(?) (java.io.File) around. I always closed the file after reading/writing, but never closed the File handle. What's new to me is that this produces lots of open files. I would have expected that this is not the case as I always close the actual RandomAccessFile. I was wrong it seems.

To find out about the files you need to know the pid of your app's process and then I ran this:

adb -s emulator-5556 shell ls -l /proc/1160/fd

Which then produces something like this:

lrwx------ root     root              2010-06-14 20:09 0 -> /dev/null
lrwx------ root     root              2010-06-14 20:09 1 -> /dev/null
lrwx------ root     root              2010-06-14 20:09 2 -> /dev/null
l-wx------ root     root              2010-06-14 20:09 3 -> /dev/log/main
l-wx------ root     root              2010-06-14 20:09 4 -> /dev/log/radio
l-wx------ root     root              2010-06-14 20:09 5 -> /dev/log/events
lr-x------ root     root              2010-06-14 20:09 6 -> /system/framework/core.jar
lr-x------ root     root              2010-06-14 20:09 7 -> /system/framework/ext.jar
lr-x------ root     root              2010-06-14 20:09 8 -> /system/framework/framework.jar
lrwx------ root     root              2010-06-14 20:09 9 -> /dev/ashmem
lrwx------ root     root              2010-06-14 20:09 10 -> socket:[41904]
lr-x------ root     root              2010-06-14 20:09 11 -> /system/framework/android.policy.jar
lr-x------ root     root              2010-06-14 20:09 12 -> /system/framework/services.jar
lr-x------ root     root              2010-06-14 20:09 13 -> /system/framework/framework.jar
lr-x------ root     root              2010-06-14 20:09 14 -> /system/fonts/DroidSans.ttf
lr-x------ root     root              2010-06-14 20:09 15 -> /system/framework/core.jar
lr-x------ root     root              2010-06-14 20:09 16 -> /dev/urandom
lr-x------ root     root              2010-06-14 20:09 17 -> /system/framework/framework-res.apk
lr-x------ root     root              2010-06-14 20:09 18 -> pipe:[41905]
l-wx------ root     root              2010-06-14 20:09 19 -> pipe:[41905]
lrwx------ root     root              2010-06-14 20:09 20 -> socket:[41908]
lrwx------ root     root              2010-06-14 20:09 21 -> /dev/binder
lrwx------ root     root              2010-06-14 20:09 22 -> /dev/ashmem
lrwx------ root     root              2010-06-14 20:09 23 -> /dev/ashmem
lr-x------ root     root              2010-06-14 20:09 24 -> /data/app/com.newsrob.apk
lr-x------ root     root              2010-06-14 20:09 25 -> /data/app/com.newsrob.apk
lr-x------ root     root              2010-06-14 20:09 26 -> /data/app/com.newsrob.apk
lrwx------ root     root              2010-06-14 20:09 27 -> /data/data/com.newsrob/databases/newsrob.db
lrwx------ root     root              2010-06-14 20:09 28 -> /system/fonts/DroidSansFallback.ttf
lrwx------ root     root              2010-06-14 20:09 29 -> /dev/ashmem
lrwx------ root     root              2010-06-14 20:09 30 -> /dev/ashmem
lrwx------ root     root              2010-06-14 20:10 31 -> /dev/ashmem
lrwx------ root     root              2010-06-14 20:09 33 -> /data/data/com.newsrob/databases/webview.db
lr-x------ root     root              2010-06-14 20:10 34 -> /system/fonts/DroidSans-Bold.ttf
lrwx------ root     root              2010-06-14 20:10 35 -> /dev/ashmem
lrwx------ root     root              2010-06-14 20:10 36 -> /dev/ashmem
lrwx------ root     root              2010-06-14 20:10 37 -> /data/data/com.newsrob/databases/webviewCache.db
lrwx------ root     root              2010-06-14 20:10 38 -> /dev/ashmem
lrwx------ root     root              2010-06-14 20:10 40 -> /dev/ashmem
lrwx------ root     root              2010-06-14 20:10 41 -> /dev/ashmem
lrwx------ root     root              2010-06-14 20:11 42 -> /dev/ashmem
lrwx------ root     root              2010-06-14 20:11 43 -> /dev/ashmem
lrwx------ root     root              2010-06-14 20:10 45 -> /dev/ashmem

(The version with the bug had a couple of more lines pointing to my currentArticle file).

Hope this helps somebody else also.

No idea why this only happened to Desire/Incredibles.

On Mon, Jun 14, 2010 at 6:37 PM, Mariano Kamp <mariano.kamp@gmail.com> wrote:

I checked 20 error reports and 100% were from either the HTC Desire or the HTC Incredible.

On Mon, Jun 14, 2010 at 9:29 AM, Mariano Kamp <mariano.kamp@gmail.com> wrote:

Hi,

did anybody encounter the RuntimeException with the message "Unknown error"?

Cheers,

Mariano

java.lang.RuntimeException: Unknown error
at android.os.Process.setProcessGroup(Native Method)
at android.app.ActivityThread.handleChangeTopApp(ActivityThread.java:3663)
at android.app.ActivityThread.access$4100(ActivityThread.java:126)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2039)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4595)
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)

http://www.netmite.com/android/mydroid/frameworks/base/core/jni/android_util_Binder.cpp


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment