ANR on NativeActivity sample App provided by Google on JB

1,468 views
Skip to first unread message

Maunik Shah

unread,
Dec 28, 2012, 2:16:10 AM12/28/12
to android-...@googlegroups.com
HI Framework Developers,

I am having an ANR issue with an application built using NativeActivity. I could not get any clues based on traces. Further, the application was roughly deriived from the Sample NativeActivity application provided by Google. So I tried to build the sample NativeActivity app provided with android. [<platform_root>/development/ndk/platforms/android-9/samples/native-activity]
When I run monkey on that sample App on JB, it gives me ANR on that application within 10-20 seconds. where as I'm not seeing this issue on GB/ICS with the same App. The ANR traces shows main thread was waiting in looper and not doing any CPU intensive processing.

Monkey command: adb shell monkey -p com.example.native_activity -v -v -v --throttle 500 1000000

Here I'm attaching the log file and top logs

12-28 11:25:03.574   258   296 E ActivityManager: ANR in com.example.native_activity (com.example.native_activity/android.app.NativeActivity)
12-28 11:25:03.574   258   296 E ActivityManager: Reason: keyDispatchingTimedOut
12-28 11:25:03.574   258   296 E ActivityManager: Load: 6.4 / 2.28 / 0.81
12-28 11:25:03.574   258   296 E ActivityManager: CPU usage from 5183ms to 0ms ago:
12-28 11:25:03.574   258   296 E ActivityManager:   16% 86/surfaceflinger: 10% user + 6.1% kernel / faults: 1 minor
12-28 11:25:03.574   258   296 E ActivityManager:   16% 258/system_server: 10% user + 5.9% kernel / faults: 181 minor 1 major
12-28 11:25:03.574   258   296 E ActivityManager:   10% 1245/top: 3% user + 6.9% kernel / faults: 6583 minor
12-28 11:25:03.574   258   296 E ActivityManager:   6.5% 1266/com.example.native_activity: 3.4% user + 3% kernel / faults: 8 minor
12-28 11:25:03.574   258   296 E ActivityManager:   3.2% 95/adbd: 0.7% user + 2.5% kernel
...

The main thread stack is like this at the time of  ANR:

#00  pc 0000da40  /system/lib/libc.so (epoll_wait+12)
  #01  pc 00014791  /system/lib/libutils.so (android::Looper::pollInner(int)+96)
  #02  pc 000149f9  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+104)
  #03  pc 0005d11b  /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22)
  #04  pc 0001de30  /system/lib/libdvm.so (dvmPlatformInvoke+112)
  #05  pc 0004ce73  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+390)
  #06  pc 00027260  /system/lib/libdvm.so
  #07  pc 0002bb38  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+180)
  #08  pc 0005f877  /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+374)
  #09  pc 00066d4d  /system/lib/libdvm.so
  #10  pc 00027260  /system/lib/libdvm.so


I'm suspecting, there is something wrong in InputDispatcher.cpp as the reason behind this ANR is keyDispatchingTimedOut.

What would be the reason behind this ANR issue as it was not there on ICS & GB?

Thanks,
Maunik
NativeActivity-debug.apk
adbLogs.txt
TopLogs.txt
traces.txt

saminath sanjai

unread,
Dec 28, 2012, 4:14:34 AM12/28/12
to android-...@googlegroups.com
Hi

>>>>>>>>>>>>>>>>>>>>>>
12-28 11:25:02.050   258   296 I InputDispatcher: Application is not responding: Window{428b8cf8 com.example.native_activity/android.app.NativeActivity paused=false}.  It has been 5009.6ms since event, 5002.9ms since wait started.  Reason: Waiting because the touched window has not finished processing the input events that were previously delivered to it.
12-28 11:25:02.050   258   296 I WindowManager: Input event dispatching timed out sending to com.example.native_activity/android.app.NativeActivity
>>>>>>>>>>>>>>>>>>>>>>>>>
Also Error Message in Alog.

12-28 11:24:55.859   657   657 W Finsky  : [1] 2.onErrorResponse: Update check failed: com.android.volley.NoConnectionError: java.net.UnknownHostException: Unable to resolve host "android.clients.google.com": No address associated with hostname
12-28 11:24:55.863  1266  1279 I native-activity: accelerometer: x=-0.172383 y=-0.421380 z=9.576807
12-28 11:24:55.867   657   657 D Finsky  : [1] DailyHygiene.reschedule: Scheduling new run in 10 minutes (failures=1)


Can you enable the Wifi and Run the Monkey Test?


sami




--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/wRm07Mz6AhEJ.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.

Maunik Shah

unread,
Dec 31, 2012, 2:33:18 AM12/31/12
to android-...@googlegroups.com
Hi Sami,

I checked with the enabled wi-fi. but same issue is there.

Thanks,
Maunik

Rupali Gaikwad-Morbale

unread,
Jun 19, 2013, 6:52:24 AM6/19/13
to android-...@googlegroups.com
Hi All.
 
Any update on this ANR?
 
I'm also facing the same,
 
ANR stack trace -

DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0)
"main" prio=5 tid=1 NATIVE
  | group="main" sCount=1 dsCount=0 obj=0x41942b38 self=0x41871b90
  | sysTid=3413 nice=0 sched=0/0 cgrp=apps handle=1074759132
  | state=S schedstat=( 0 0 0 ) utm=24212 stm=4578 core=0
  #00  pc 00018044  /system/lib/libc.so (epoll_wait+12)
  #01  pc 00014d21  /system/lib/libutils.so (android::Looper::pollInner(int)+96)
  #02  pc 00014f89  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+104)
  #03  pc 00068d27  /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22)
  #04  pc 00020210  /system/lib/libdvm.so (dvmPlatformInvoke+112)
  #05  pc 0004f875  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+396)
  #06  pc 000296a0  /system/lib/libdvm.so
  #07  pc 0002d7ec  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
  #08  pc 00062537  /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+374)
  #09  pc 00069f79  /system/lib/libdvm.so
  #10  pc 000296a0  /system/lib/libdvm.so
  #11  pc 0002d7ec  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
  #12  pc 00062261  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)
  #13  pc 0004be53  /system/lib/libdvm.so
  #14  pc 0004fd8f  /system/lib/libandroid_runtime.so
  #15  pc 0005112b  /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, char const*)+390)
  #16  pc 00000db7  /system/bin/app_process
  #17  pc 0001287f  /system/lib/libc.so (__libc_init+38)
  #18  pc 00000ae8  /system/bin/app_process
  at android.os.MessageQueue.nativePollOnce(Native Method)
  at android.os.MessageQueue.next(MessageQueue.java:125)
  at android.os.Looper.loop(Looper.java:124)
  at android.app.ActivityThread.main(ActivityThread.java:5293)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:511)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
  at dalvik.system.NativeStart.main(Native Method)
 
Thanks,
Rupali

Nitz Malikarjun

unread,
Jun 20, 2013, 6:34:21 AM6/20/13
to android-...@googlegroups.com
Hey Suresh,
                  HOW did you come to know its JB issue.Please share the links.
Thanks in Advance

Jeffrey Brown

unread,
Jun 21, 2013, 3:05:24 PM6/21/13
to android-...@googlegroups.com
This issue has been fixed in a future release.  The fix is available in AOSP.  Please refer to the bug for details:


Jeff.
Reply all
Reply to author
Forward
0 new messages