Android ANR in process: com.android.inputmethod.latin Exception - android

I have got this type of memory exception some times on my apps, any body have idea about why this exception is occurred ?
E/ActivityThread( 390): Failed to find provider info for com.google.settings
E/ActivityThread( 390): Failed to find provider info for com.google.settings
I/ActivityThread( 390): Publishing provider com.android.globalsearch.SuggestionProvider: com.android.globalsearch.SuggestionProvider
W/ActivityManager( 51): Timeout executing service: ServiceRecord{439b4c30 com.android.inputmethod.latin/.LatinIME}
I/ActivityManager( 51): ANR in process: com.android.inputmethod.latin
I/ActivityManager( 51): Annotation: Executing service ComponentInfo{com.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME}
I/ActivityManager( 51): CPU usage:
I/ActivityManager( 51): Load: 2.07 / 0.89 / 0.35
I/ActivityManager( 51): CPU usage from 27357ms to 1782ms ago:
I/ActivityManager( 51): system_server: 10% = 3% user + 6% kernel / faults: 8566 minor 447 major
I/ActivityManager( 51): com.babbleville: 6% = 1% user + 4% kernel / faults: 3031 minor 188 major
I/ActivityManager( 51): com.android.inputmethod.latin: 5% = 0% user + 4% kernel / faults: 6296 minor 473 major
I/ActivityManager( 51): com.android.phone: 2% = 0% user + 2% kernel / faults: 3052 minor 101 major
I/ActivityManager( 51): adbd: 0% = 0% user + 0% kernel
I/ActivityManager( 51): logcat: 0% = 0% user + 0% kernel / faults: 291 minor 6 major
I/ActivityManager( 51): zygote: 0% = 0% user + 0% kernel / faults: 70 minor 3 major
I/ActivityManager( 51): pdflush: 0% = 0% user + 0% kernel
I/ActivityManager( 51): servicemanager: 0% = 0% user + 0% kernel / faults: 16 minor 4 major
I/ActivityManager( 51): logcat: 0% = 0% user + 0% kernel / faults: 290 minor 7 major
I/ActivityManager( 51): qemud: 0% = 0% user + 0% kernel / faults: 272 minor 3 major
I/ActivityManager( 51): +android.process.acore: 0% = 0% user + 0% kernel
I/ActivityManager( 51): TOTAL: 100% = 9% user + 30% kernel + 59% iowait + 0% irq + 0% softirq
I/ActivityManager( 51): Removing old ANR trace file from /data/anr/traces.txt
I/Process ( 51): Sending signal. PID: 384 SIG: 3
I/dalvikvm( 384): threadid=7: reacting to signal 3
I/Process ( 51): Sending signal. PID: 51 SIG: 3
I/dalvikvm( 51): threadid=7: reacting to signal 3
I/dalvikvm( 384): Wrote stack trace to '/data/anr/traces.txt'
I/ActivityThread( 390): Publishing provider com.android.globalsearch.stats: com.android.globalsearch.StatsProvider
I/ActivityThread( 390): Publishing provider contacts;call_log: com.android.providers.contacts.ContactsProvider
I/dalvikvm( 51): Wrote stack trace to '/data/anr/traces.txt'
I/Process ( 51): Sending signal. PID: 390 SIG: 3
I/dalvikvm( 390): threadid=7: reacting to signal 3
I/Process ( 51): Sending signal. PID: 358 SIG: 3
I/dalvikvm( 358): threadid=7: reacting to signal 3
I/dalvikvm( 390): Wrote stack trace to '/data/anr/traces.txt'
I/dalvikvm( 358): Wrote stack trace to '/data/anr/traces.txt'
I/Process ( 51): Sending signal. PID: 92 SIG: 3
I/dalvikvm( 92): threadid=7: reacting to signal 3
I/dalvikvm( 92): Wrote stack trace to '/data/anr/traces.txt'

==> ANR in process: com.android.inputmethod.latin
latin ime maybe blocked, find "message history" in your log or get /data/anr/traces.txt to know which process/thread is busy?
And from:
TOTAL: 100% = 9% user + 30% kernel + 59% iowait + 0% irq + 0% softirq
iowait is hight: maybe file read/write in busy status

Related

Android Cocos2dx Crash

I have made game in cocos2dx for ios device. Now I want to port it for android but, the code which works fine for ios is crashing for android. The eclipse shows 3 types of logCat outputs which are as follows.
///////////////////////////////////////////////////////////////////////////////////////////////////////
1) 11-27 10:41:05.168: W/SharedBufferStack(4417): waitForCondition(LockCondition) timed out (identity=302, status=0). CPU may be pegged. trying again.
///////////////////////////////////////////////////////////////////////////////////////////////////////
2) 11-27 10:41:36.448: D/lights(248): set_light_backlight: brightness=255
11-27 10:41:41.518: I/InputDispatcher(248): Application is not responding: Window{2b452080 org.cocos2dx.Saburbia_android/org.cocos2dx.Saburbia_android.Saburbia_android paused=false}. 5000.4ms since event, 5000.4ms since wait started
11-27 10:41:41.518: I/WindowManager(248): Input event dispatching timed out sending to org.cocos2dx.Saburbia_android/org.cocos2dx.Saburbia_android.Saburbia_android
11-27 10:41:41.528: I/Process(248): Sending signal. PID: 4417 SIG: 3
11-27 10:41:41.528: I/dalvikvm(4417): threadid=4: reacting to signal 3
11-27 10:41:41.728: I/Process(248): Sending signal. PID: 248 SIG: 3
11-27 10:41:41.728: I/dalvikvm(248): threadid=4: reacting to signal 3
11-27 10:41:41.748: I/dalvikvm(248): Wrote stack traces to '/data/anr/traces.txt'
11-27 10:41:41.748: I/Process(248): Sending signal. PID: 355 SIG: 3
11-27 10:41:41.748: I/dalvikvm(355): threadid=4: reacting to signal 3
11-27 10:41:41.758: I/dalvikvm(355): Wrote stack traces to '/data/anr/traces.txt'
11-27 10:41:41.758: I/Process(248): Sending signal. PID: 320 SIG: 3
11-27 10:41:41.758: I/dalvikvm(320): threadid=4: reacting to signal 3
11-27 10:41:41.758: I/dalvikvm(320): Wrote stack traces to '/data/anr/traces.txt'
11-27 10:41:41.968: D/dalvikvm(248): GC_EXPLICIT freed 952K, 49% free 6943K/13447K, external 3286K/4888K, paused 78ms
11-27 10:41:42.518: E/ActivityManager(248): ANR in org.cocos2dx.Saburbia_android (org.cocos2dx.Saburbia_android/.Saburbia_android)
11-27 10:41:42.518: E/ActivityManager(248): Reason: keyDispatchingTimedOut
11-27 10:41:42.518: E/ActivityManager(248): Load: 7.93 / 7.92 / 7.79
11-27 10:41:42.518: E/ActivityManager(248): CPU usage from 27270ms to 0ms ago:
11-27 10:41:42.518: E/ActivityManager(248): 99% 4417/org.cocos2dx.Saburbia_android: 99% user + 0% kernel / faults: 2 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 3877/com.google.android.apps.maps: 0% user + 0% kernel / faults: 418 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 3957/com.svox.pico: 0% user + 0% kernel / faults: 678 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 248/system_server: 0% user + 0% kernel / faults: 8 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 1679/com.sonyericsson.customization: 0% user + 0% kernel / faults: 283 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 3647/com.sonyericsson.devicemonitor: 0% user + 0% kernel / faults: 179 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 121/rild: 0% user + 0% kernel / faults: 1 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 320/com.android.systemui: 0% user + 0% kernel / faults: 3 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 3731/com.sonyericsson.android.datamonitor: 0% user + 0% kernel / faults: 25 minor
11-27 10:41:42.518: E/ActivityManager(248): 100% TOTAL: 100% user + 0% kernel
11-27 10:41:42.518: E/ActivityManager(248): CPU usage from 461ms to 976ms later:
11-27 10:41:42.518: E/ActivityManager(248): 98% 4417/org.cocos2dx.Saburbia_android: 98% user + 0% kernel
11-27 10:41:42.518: E/ActivityManager(248): 96% 4418/HeapWorker: 96% user + 0% kernel
11-27 10:41:42.518: E/ActivityManager(248): 3.8% 248/system_server: 1.9% user + 1.9% kernel
11-27 10:41:42.518: E/ActivityManager(248): 1.9% 291/InputDispatcher: 0% user + 1.9% kernel
11-27 10:41:42.518: E/ActivityManager(248): 1.9% 442/er$SensorThread: 1.9% user + 0% kernel
11-27 10:41:42.518: E/ActivityManager(248): 100% TOTAL: 98% user + 1.9% kernel
11-27 10:41:42.518: I/InputDispatcher(248): Dropping event because the pointer is not down.
////////////////////////////////////////////////////////////////////////////////////////////////
3) and third reason is unknows as it shows meny memory address in logCat.
////////////////////////////////////////////////////////////////////////////////////////////////
I am using libcurl for web calls and pThread for threading. This game also have Facebook Integration which is done using Facebook API for mobile (Hackbook).
After facebook login, the native code connects to the server using libcurl and makes about 30 http calls using pThread so that rendering thread should not be paused for getting the response from server. Still while this loading is going on the logcat shows any of these 3 logs and restarts loading from the start. There are http request present in game also which are executed using pThreads but in game also it shows any of this 3 log and crashes randomely.
The same code works fine for the ios build. I am not able to find why its not running properly for Android. Please suggest if any rules have to be followed for android porting.
I am using versions as follows.
Android NDK : r8b
Cocos2dx : 2.0.3
Eclipse : 3.6.2
Android version : 2.2
System : Ubuntu 10.0.4
Devices : SonyEricsson NeoV (android2.3.4), Samsung Galaxy SII (android4.0.3).
Thanks in advance..
Try to find memory issue in iPhone,because auto-release code might not working correctly.
Also use the NDK stack for more detail error.
Update:Another way to track ndk stack on remote use the https://www.crittercism.com
Thank you.

Camera not responding

I am using the built in camera app in android using intents like this:
final Button Capture=(Button)findViewById(sankalp.jain.sky.R.id.capture);
Capture.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Uri fileUri;
final Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
Log.w("intent","for camera");//displayed
fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create a file to save the image
Log.w("getoutput","getit");//displayed
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the image file name
Log.w("hello","hello the 2nd step");//displayed
startActivityForResult(intent,CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
}
I have implemented the relevant getOutputMediafile() method and the image gets saved in /mnt/sdcard/Pictures/Samarth/chart.png
The sdcard is 40MB and there are only 2 files presently totaling some 100KB.
The problem is that the camera works perfectly for some random number of snaps and then randomly hangs and then gives an ANR.
Its totally random,restarting the emulator doesnt work and sometimes it does.
Here is the logcat output
LOGCAT:
I/ActivityManager( 70): Displayed sankalp.jain.sky/.Tabinit: +1s364ms
W/intent ( 596): for camera
D/path ( 596): /mnt/sdcard/Pictures/Samarth
W/getoutput( 596): getit
W/hello ( 596): hello the 2nd step
I/ActivityManager( 70): Starting: Intent { act=android.media.action.IMAGE_CAPT
URE cmp=com.android.camera/.Camera (has extras) } from pid 596
D/PhoneWindow( 596): couldn't save which view has focus because the focused vie
w com.android.internal.policy.impl.PhoneWindow$DecorView#4056d7e0 has no id.
I/WindowManager( 70): Setting rotation to 1, animFlags=1
I/ActivityManager( 70): Config changed: { scale=1.0 imsi=310/260 loc=en_US tou
ch=3 keys=2/1/2 nav=3/1 orien=2 layout=34 uiMode=17 seq=13}
V/CameraHolder( 411): open camera 0
D/CameraHardwareStub( 34): initHeapLocked: preview size=320x240
I/StagefrightPlayer( 34): setDataSource('/system/media/audio/ui/camera_click.o
gg')
I/StagefrightPlayer( 34): setDataSource('/system/media/audio/ui/VideoRecord.og
g')
D/Camera ( 411): app passed NULL surface
D/CameraHardwareStub( 34): initHeapLocked: preview size=320x240
V/camera ( 411): startPreview
I/ActivityManager( 70): Displayed com.android.camera/.Camera: +1s198ms
W/OrientationEventListener( 411): Cannot detect sensors. Not enabled
E/SurfaceFlinger( 70): texture=10, using format 17, which is not supported by
the GL
V/GLRootView( 411): onSurfaceChanged: 627x470, gl10: com.google.android.gles_jn
i.GLImpl#40511140
V/GLRootView( 411): layout content pane 627x470
W/IInputConnectionWrapper( 596): showStatusIcon on inactive InputConnection
D/dalvikvm( 70): GC_EXPLICIT freed 130K, 47% free 4929K/9159K, external 3511K/
4385K, paused 795ms
V/camera ( 411): Start autofocus.
D/dalvikvm( 411): GC_EXTERNAL_ALLOC freed 34K, 51% free 2932K/5895K, external 2
480K/2565K, paused 697ms
V/camera ( 411): mAutoFocusTime = 1622ms
V/camera ( 411): doSnap: mFocusState=3
D/CameraHardwareStub( 34): initHeapLocked: preview size=320x240
D/dalvikvm( 596): GC_EXPLICIT freed 209K, 49% free 2870K/5575K, external 3065K/
3507K, paused 650ms
D/SntpClient( 70): request time failed: java.net.SocketException: Address fami
ly not supported by protocol
I/InputDispatcher( 70): Application is not responding: Window{40751af8 com.and
roid.camera/com.android.camera.Camera paused=false}. 5014.6ms since event, 5014
.0ms since wait started
I/WindowManager( 70): Input event dispatching timed out sending to com.android
.camera/com.android.camera.Camera
I/Process ( 70): Sending signal. PID: 411 SIG: 3
I/dalvikvm( 411): threadid=4: reacting to signal 3
I/dalvikvm( 411): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 70): Sending signal. PID: 70 SIG: 3
I/dalvikvm( 70): threadid=4: reacting to signal 3
I/dalvikvm( 70): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 70): Sending signal. PID: 340 SIG: 3
I/dalvikvm( 340): threadid=4: reacting to signal 3
I/dalvikvm( 340): Wrote stack traces to '/data/anr/traces.txt'
I/Process ( 70): Sending signal. PID: 115 SIG: 3
I/dalvikvm( 115): threadid=4: reacting to signal 3
I/dalvikvm( 115): Wrote stack traces to '/data/anr/traces.txt'
D/dalvikvm( 70): GC_EXPLICIT freed 354K, 45% free 5052K/9159K, external 3511K/
4385K, paused 157ms
E/ActivityManager( 70): ANR in com.android.camera (com.android.camera/.Camera)
E/ActivityManager( 70): Reason: keyDispatchingTimedOut
E/ActivityManager( 70): Load: 0.12 / 0.23 / 0.25
E/ActivityManager( 70): CPU usage from 42677ms to 0ms ago:
E/ActivityManager( 70): 0.3% 70/system_server: 0.1% user + 0.1% kernel / fau
lts: 5 minor
E/ActivityManager( 70): 0.3% 115/com.android.systemui: 0.2% user + 0% kernel
/ faults: 4 minor
E/ActivityManager( 70): 0.1% 340/com.android.phone: 0% user + 0% kernel / fa
ults: 4 minor
E/ActivityManager( 70): 0% 34/mediaserver: 0% user + 0% kernel
E/ActivityManager( 70): 0% 32/rild: 0% user + 0% kernel
E/ActivityManager( 70): 0% 41/adbd: 0% user + 0% kernel
E/ActivityManager( 70): 1.1% TOTAL: 0.7% user + 0.4% kernel
E/ActivityManager( 70): CPU usage from 1031ms to 1675ms later:
E/ActivityManager( 70): 10% 70/system_server: 6.2% user + 4.6% kernel
E/ActivityManager( 70): 10% 100/InputDispatcher: 7.8% user + 3.1% kernel
E/ActivityManager( 70): 34% TOTAL: 17% user + 17% kernel
I/InputDispatcher( 70): Dropping event because the pointer is not down.
D/dalvikvm( 115): GC_CONCURRENT freed 365K, 49% free 2977K/5831K, external 2169
K/2674K, paused 9ms+6ms
D/SntpClient( 70): request time failed: java.net.SocketException: Address fami
ly not supported by protocol
W/ProcessStats( 70): Skipping unknown process pid 734
W/ProcessStats( 70): Skipping unknown process pid 735
V/BackupManagerService( 70): Backup requested but nothing pending
D/SntpClient( 70): request time failed: java.net.SocketException: Address fami
ly not supported by protocol
I/EventLogService( 266): Aggregate from 1332336498594 (log), 1332336498594 (dat
a)
D/dalvikvm( 266): GC_EXPLICIT freed 61K, 55% free 3085K/6727K, external 1625K/2
137K, paused 296ms
I could never figure out the reason myself but due to some problems when I decided to upgrade the emulator to Google API15(from API10) the camera doesn't hang anymore.
Upgrading also rectified some weird problems like
Force portrait mode in camera
Hope that helps someone.

ANR when launching service from AppWidgetProvider

I'm developping a simple widget which update by downloading a big image file.
To do so I'm just launching a service which retrieve the image. I launch it from the onUpdate method of AppWidgetProvider.
Like that :
public void onUpdate(Context context, AppWidgetManager appWidgetManager,
int[] appWidgetIds)
{
Intent intent = new Intent(context, UpdateService.class);
context.startService(intent);
}
In wifi everything is working well.
But in 3G network is slow, the downloading take too much time. As a result my service is killed by android system.
Here the trace:
03-04 15:19:02.698: INFO/ActivityManager(166): Start proc com.testpic for broadcast
com.testpic/com.testpic.TestPicActivity: pid=1994 uid=10087 gids={1015, 3003}
03-04 15:19:22.889: WARN/ActivityManager(166): Timeout executing service:
ServiceRecord{41851230 com.testpic/com.testpic.service.UpdateService}
03-04 15:19:22.944: INFO/dalvikvm(166): Jit: resizing JitTable from 8192 to 16384
03-04 15:19:22.967: INFO/Process(166): Sending signal. PID: 1994 SIG: 3
03-04 15:19:22.967: INFO/dalvikvm(1994): threadid=3: reacting to signal 3
03-04 15:19:22.994: INFO/dalvikvm(1994): Wrote stack traces to '/data/anr/traces.txt'
03-04 15:19:22.994: INFO/Process(166): Sending signal. PID: 166 SIG: 3
03-04 15:19:22.994: INFO/dalvikvm(166): threadid=3: reacting to signal 3
03-04 15:19:23.053: INFO/dalvikvm(166): Wrote stack traces to '/data/anr/traces.txt'
03-04 15:19:23.053: INFO/Process(166): Sending signal. PID: 232 SIG: 3
03-04 15:19:23.053: INFO/dalvikvm(232): threadid=3: reacting to signal 3
03-04 15:19:23.061: INFO/dalvikvm(232): Wrote stack traces to '/data/anr/traces.txt'
03-04 15:19:23.061: INFO/Process(166): Sending signal. PID: 342 SIG: 3
03-04 15:19:23.061: INFO/dalvikvm(342): threadid=3: reacting to signal 3
03-04 15:19:23.084: INFO/dalvikvm(342): Wrote stack traces to '/data/anr/traces.txt'
03-04 15:19:23.084: INFO/Process(166): Sending signal. PID: 359 SIG: 3
03-04 15:19:23.084: INFO/dalvikvm(359): threadid=3: reacting to signal 3
03-04 15:19:23.096: INFO/dalvikvm(359): Wrote stack traces to '/data/anr/traces.txt'
03-04 15:19:23.272: DEBUG/dalvikvm(166): GC_CONCURRENT freed 914K, 16% free
13371K/15879K, paused 3ms+5ms
03-04 15:19:23.467: DEBUG/dalvikvm(166): GC_EXPLICIT freed 459K, 16% free 13475K/15879K,
paused 3ms+5ms
03-04 15:19:24.065: ERROR/ActivityManager(166): ANR in com.testpic
Reason: Executing service com.testpic/com.testpic.service.UpdateService
Load: 1.58 / 1.52 / 0.84
CPU usage from 12327ms to 0ms ago with 99% awake:
16% 166/system_server: 7.3% user + 9.4% kernel / faults: 8 minor
9.1% 1994/com.testpic: 7.1% user + 2% kernel / faults: 249 minor
0.7% 374/com.android.launcher: 0.6% user + 0% kernel / faults: 15 minor
0.6% 342/com.android.phone: 0.4% user + 0.2% kernel / faults: 15 minor
0.4% 5/kworker/u:0: 0% user + 0.4% kernel
0.4% 1343/kworker/0:1: 0% user + 0.4% kernel
0.4% 66/yaffs-bg-1: 0% user + 0.4% kernel
0.4% 77/rild: 0% user + 0.3% kernel
0.2% 897/de.devmil.minimaltext: 0.2% user + 0% kernel / faults: 63 minor
0.1% 293/com.google.process.gapps: 0% user + 0% kernel / faults: 4 minor
0% 159/logcat: 0% user + 0% kernel
0% 160/flush-179:0: 0% user + 0% kernel
0% 232/com.android.systemui: 0% user + 0% kernel / faults: 1 minor
0% 835/com.google.android.apps.maps:NetworkLocationService: 0% user + 0% kernel /
faults: 15 minor
25% TOTAL: 14% user + 11% kernel + 0.2% softirq
CPU usage from 577ms to 1090ms later with 99% awake:
22% 166/system_server: 8.7% user + 14% kernel
10% 182/ActivityManager: 3.5% user + 7% kernel
7% 179/system_server: 0% user + 7% kernel
3.5% 199/er$SensorThread: 0% user + 3.5% kernel
1.7% 181/er.ServerThread: 1.7% user + 0% kernel
4.5% 1994/com.testpic: 4.5% user + 0% kernel / faults: 4 minor
4.5% 1994/com.testpic: 4.5% user + 0% kernel
19% TOTAL: 7.6% user + 11% kernel
03-04 15:19:24.065: WARN/ActivityManager(166): Killing ProcessRecord{416316c0
1994:com.testpic/10087}: background ANR
03-04 15:19:24.073: INFO/ActivityManager(166): Process com.testpic (pid 1994) has died.
03-04 15:19:24.073: WARN/ActivityManager(166): Scheduling restart of crashed service
com.testpic/com.testpic.service.UpdateService in 42380ms
So my questions are :
- How can I do to avoid this ANR ?
- Is it correct to use a service in this kind of situation ?
- If not what should I use to perform that kind of treatment ?
Thank you in advance for your help :)
A regular Service still runs on the UI thread unless you tell it to spawn another one. Consider using an IntentService instead which handles that for you.

Android video crash

When I tried to slide on the screen during 10 sec. during video playing, I got an error ‘Activity MyActivity (in application MyActivity) is not responding’. That error showed on Android 3.2.1 (on Android 2.3.3 – all OK).
AppWindowToken{4171c010 token=ActivityRecord{40a4b008 com.MyActivity/.Home}}. 5018.0ms since event, 5004.9ms since wait started
01-10 14:08:31.280 I/WindowManager( 142): Input event dispatching timed out sending to application AppWindowToken{4171c010 token=ActivityRecord{40a4b008 com.MyActivity/.Home}}
01-10 14:08:31.310 I/Process ( 142): Sending signal. PID: 4027 SIG: 3
01-10 14:08:31.310 I/dalvikvm( 4027): threadid=4: reacting to signal 3
01-10 14:08:31.320 I/dalvikvm( 4027): Wrote stack traces to '/data/anr/traces.txt'
01-10 14:08:31.320 I/Process ( 142): Sending signal. PID: 142 SIG: 3
01-10 14:08:31.320 I/dalvikvm( 142): threadid=4: reacting to signal 3
01-10 14:08:31.350 I/dalvikvm( 142): Wrote stack traces to '/data/anr/traces.txt'
01-10 14:08:31.350 I/Process ( 142): Sending signal. PID: 224 SIG: 3
01-10 14:08:31.350 I/dalvikvm( 224): threadid=4: reacting to signal 3
01-10 14:08:31.360 I/dalvikvm( 224): Wrote stack traces to '/data/anr/traces.txt'
01-10 14:08:31.360 I/Process ( 142): Sending signal. PID: 200 SIG: 3
01-10 14:08:31.360 I/dalvikvm( 200): threadid=4: reacting to signal 3
01-10 14:08:31.370 I/dalvikvm( 200): Wrote stack traces to '/data/anr/traces.txt'
01-10 14:08:31.550 D/dalvikvm( 142): GC_CONCURRENT freed 2091K, 40% free 17467K/28679K, paused 5ms+8ms
01-10 14:08:31.690 D/dalvikvm( 142): GC_EXPLICIT freed 303K, 40% free 17465K/28679K, paused 3ms+5ms
01-10 14:08:32.280 E/ActivityManager( 142): ANR in com.MyActivity (com.MyActivity/.Home)
01-10 14:08:32.280 E/ActivityManager( 142): Reason: keyDispatchingTimedOut
01-10 14:08:32.280 E/ActivityManager( 142): Load: 0.41 / 0.3 / 0.18
01-10 14:08:32.280 E/ActivityManager( 142): CPU usage from 26289ms to 0ms ago with 99% awake:
01-10 14:08:32.280 E/ActivityManager( 142): 22% 89/mediaserver: 17% user + 4.6% kernel / faults: 2598 minor
01-10 14:08:32.280 E/ActivityManager( 142): 14% 4027/com.MyActivity: 11% user + 2.6% kernel / faults: 1460 minor
01-10 14:08:32.280 E/ActivityManager( 142): 8.1% 195/dhd_dpc: 0% user + 8.1% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 7.4% 142/system_server: 2.2% user + 5.1% kernel / faults: 96 minor
01-10 14:08:32.280 E/ActivityManager( 142): 2% 86/surfaceflinger: 0.7% user + 1.3% kernel / faults: 2 minor
01-10 14:08:32.280 E/ActivityManager( 142): 1.8% 4000/kworker/u:1: 0% user + 1.8% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 1.7% 2307/kworker/u:0: 0% user + 1.7% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 1.4% 1713/kworker/u:3: 0% user + 1.4% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 0.5% 62/kinteractiveup: 0% user + 0.5% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 0.5% 3541/kworker/u:2: 0% user + 0.5% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 0.4% 224/com.android.phone: 0% user + 0.4% kernel / faults: 1 minor
01-10 14:08:32.280 E/ActivityManager( 142): 0.3% 88/drmserver: 0% user + 0.3% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 0.3% 200/com.android.systemui: 0.2% user + 0% kernel / faults: 32 minor
01-10 14:08:32.280 E/ActivityManager( 142): 0% 222/com.android.launcher: 0% user + 0% kernel / faults: 197 minor
01-10 14:08:32.280 E/ActivityManager( 142): 0.2% 2954/kworker/0:0: 0% user + 0.2% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 0.2% 3584/kworker/1:1: 0.2% user + 0% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 0% 322/android.process.media: 0% user + 0% kernel / faults: 69 minor
01-10 14:08:32.280 E/ActivityManager( 142): 0.1% 128/irq/182-3d: 0% user + 0.1% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 0.1% 194/dhd_watchdog: 0% user + 0.1% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 0% 1583/avp_svc_thread: 0% user + 0% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 0% 209/wpa_supplicant: 0% user + 0% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 0% 2556/ksoftirqd/1: 0% user + 0% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 30% TOTAL: 16% user + 11% kernel + 0.4% iowait + 1.7% softirq
01-10 14:08:32.280 E/ActivityManager( 142): CPU usage from 417ms to 950ms later:
01-10 14:08:32.280 E/ActivityManager( 142): 20% 89/mediaserver: 20% user + 0% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 7.2% 4075/TimedEventQueue: 7.2% user + 0% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 7.2% 4081/AudioTrackThrea: 7.2% user + 0% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 3.6% 138/Playback Thread: 3.6% user + 0% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 1.8% 4071/TimedEventQueue: 1.8% user + 0% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 10% 142/system_server: 0% user + 10% kernel / faults: 1 minor
01-10 14:08:32.280 E/ActivityManager( 142): 7.2% 173/InputDispatcher: 0% user + 7.2% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 3.6% 174/InputReader: 1.8% user + 1.8% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 1.1% 86/surfaceflinger: 1.1% user + 0% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 1.1% 118/SurfaceFlinger: 1.1% user + 0% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 1.2% 195/dhd_dpc: 0% user + 1.2% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 1.8% 1713/kworker/u:3: 0% user + 1.8% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 1.8% 4027/com.MyActivity: 0% user + 1.8% kernel / faults: 5 minor
01-10 14:08:32.280 E/ActivityManager( 142): 1.8% 4027/com.MyActivity: 1.8% user + 0% kernel
01-10 14:08:32.280 E/ActivityManager( 142): 23% TOTAL: 12% user + 10% kernel
01-10 14:08:32.290 W/webview ( 4027): Got ACTION_DOWN but still waiting on stale event. Catching up.
01-10 14:08:32.360 D/dalvikvm( 4027): GC_CONCURRENT freed 412K, 7% free 7147K/7623K, paused 2ms+8ms
01-10 14:08:32.590 W/webview ( 4027): Stale touch event ACTION_DOWN received from webcore; ignoring
01-10 14:08:32.590 W/webview ( 4027): Stale touch event ACTION_POINTER_DOWN(0) received from webcore; ignoring
01-10 14:08:32.590 W/webview ( 4027): Stale touch event ACTION_POINTER_DOWN(0) received from webcore; ignoring
01-10 14:08:32.590 W/webview ( 4027): Stale touch event ACTION_MOVE received from webcore; ignoring
01-10 14:08:32.590 W/webview ( 4027): Stale touch event ACTION_POINTER_UP(0) received from webcore; ignoring
01-10 14:08:32.590 W/webview ( 4027): Stale touch event ACTION_POINTER_UP(0) received from webcore; ignoring
01-10 14:08:32.590 W/webview ( 4027): Stale touch event ACTION_POINTER_DOWN(0) received from webcore; ignoring
01-10 14:08:32.590 W/webview ( 4027): Stale touch event ACTION_MOVE received from webcore; ignoring
01-10 14:08:32.590 W/webview ( 4027): Stale touch event ACTION_POINTER_DOWN(0) received from webcore; ignoring
01-10 14:08:32.590 W/webview ( 4027): Stale touch event ACTION_MOVE received from webcore; ignoring
01-10 14:08:32.590 W/webview ( 4027): Stale touch event ACTION_POINTER_UP(0) received from webcore; ignoring
01-10 14:08:32.590 W/webview ( 4027): Stale touch event ACTION_POINTER_UP(0) received from webcore; ignoring
01-10 14:08:35.430 W/ActivityManager( 142): Force finishing activity com.MyActivity/.Home
01-10 14:08:35.470 I/Process ( 142): Sending signal. PID: 4027 SIG: 9
01-10 14:08:35.470 I/ActivityManager( 142): Killing com.MyActivity (pid=4027): user's request
01-10 14:08:35.490 I/AwesomePlayer( 89): reset
01-10 14:08:35.490 I/WindowManager( 142): WIN DEATH: Window{41363c38 com.MyActivity/com.MyActivity.Home paused=true}
01-10 14:08:35.490 I/ActivityManager( 142): Process com.MyActivity (pid 4027) has died.
01-10 14:08:35.500 I/AwesomePlayer( 89): cancel player events
Code:
private void showVideo(String url) {
if (videoView != null)
return;
videoView = (VideoView) findViewById(R.id.video_view);
findViewById(R.id.close_button).setVisibility(View.VISIBLE);
videoView.setVisibility(View.VISIBLE);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(findViewById(R.id.root_view));
Uri video = Uri.parse(url);
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
videoView.setOnCompletionListener(new OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
videoView.setVisibility(View.GONE);
videoView = null;
findViewById(R.id.close_button).setVisibility(View.GONE);
}
});
}
Any ideas?
The error "Activity MyActivity (in application MyActivity) is not responding" means that you are taking too much time on the main application thread. If you are trying to use the emulator, it may simply be that your PC is not fast enough to run the 3.2 emulator very well.
Otherwise, you will simply need to determine where you are spending your time on the main application thread, whether using logging to LogCat, Traceview, StrictMode, or other means.

Android finding a deadlock

I am getting an ANR sometimes when I run my Android service. I suspect it is happening because of a deadlock.
Is there an easy way to monitor deadlock in Android or Eclipse. Such as a utility to show which thread hold which lock etc.?
And is there a way to figure out a deadlock by looking at traces.txt file?
My ddms log looks like this at the time of crash
02-15 18:09:01.046: INFO/Process(90): Sending signal. PID: 450 SIG: 3
02-15 18:09:01.046: INFO/dalvikvm(450): threadid=3: reacting to signal 3
02-15 18:09:01.056: INFO/dalvikvm(450): Wrote stack traces to '/data/anr/traces.txt'
02-15 18:09:01.076: INFO/Process(90): Sending signal. PID: 10548 SIG: 9
02-15 18:09:01.076: ERROR/ActivityManager(90): ANR in com.abc.cm.core
02-15 18:09:01.076: ERROR/ActivityManager(90): Reason: Executing service com.abc.cm.core/.WorkOrderManager
02-15 18:09:01.076: ERROR/ActivityManager(90): Load: 1.46 / 1.16 / 1.05
02-15 18:09:01.076: ERROR/ActivityManager(90): CPU usage from 19462ms to 1067ms ago:
02-15 18:09:01.076: ERROR/ActivityManager(90): abc.cm.core: 13% = 12% user + 1% kernel / faults: 1360 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): mmcqd: 4% = 0% user + 4% kernel
02-15 18:09:01.076: ERROR/ActivityManager(90): system_server: 3% = 2% user + 1% kernel / faults: 473 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): zygote: 2% = 2% user + 0% kernel / faults: 90 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): adbd: 1% = 0% user + 1% kernel / faults: 1042 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): m.abc.unten: 0% = 0% user + 0% kernel / faults: 203 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): ndroid.launcher: 0% = 0% user + 0% kernel / faults: 802 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): droid.wallpaper: 0% = 0% user + 0% kernel / faults: 109 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): ndroid.settings: 0% = 0% user + 0% kernel / faults: 44 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): dhd_dpc: 0% = 0% user + 0% kernel
02-15 18:09:01.076: ERROR/ActivityManager(90): events/0: 0% = 0% user + 0% kernel
02-15 18:09:01.076: ERROR/ActivityManager(90): logcat: 0% = 0% user + 0% kernel
02-15 18:09:01.076: ERROR/ActivityManager(90): +andisk.api.test: 0% = 0% user + 0% kernel
02-15 18:09:01.076: ERROR/ActivityManager(90): +iTestFwService1: 0% = 0% user + 0% kernel
02-15 18:09:01.076: ERROR/ActivityManager(90): +sh: 0% = 0% user + 0% kernel
02-15 18:09:01.076: ERROR/ActivityManager(90): TOTAL: 40% = 23% user + 16% kernel + 0% iowait + 0% softirq
02-15 18:09:01.096: INFO/ActivityManager(90): Process com.abc.cm.core (pid 10548) has died.
fixing deadlocks on any platform is hard. the only way I know on android is to add some logging (eg using Log.d) before and after each lock/unlock/otherExpensiveFunctions

Categories

Resources