Timeout executing service error

melamoud

Active Member
Licensed User
Longtime User
I get this error , anyone know why ?
its an operation I do for many files, at some point I get this error, (every run on different file - and if I run this on small amount of files it works ok, the operation run in a service scheduled using startServiceAt

am I not allowed to run a long operation (happen after no more than 20 seconds) in a service ?

thanks

B4X:
Timeout executing service: ServiceRecord{40c6c560 appsright.musicnotifier/.scheduler}


Unable to prepare ANR traces file: /data/anr/traces.txt


java.io.IOException: Permission denied
   at java.io.File.createNewFileImpl(Native Method)
   at java.io.File.createNewFile(File.java:1257)
   at com.android.server.am.ActivityManagerService.dumpStackTraces(ActivityManagerService.java:3062)
   at com.android.server.am.ActivityManagerService.appNotResponding(ActivityManagerService.java:3258)
   at com.android.server.am.ActivityManagerService.serviceTimeout(ActivityManagerService.java:10336)
   at com.android.server.am.ActivityManagerService$2.handleMessage(ActivityManagerService.java:1241)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loop(Looper.java:130)
   at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1570)
threadid=10: thread exiting with uncaught exception (group=0x40018560)


*** FATAL EXCEPTION IN SYSTEM PROCESS: ActivityManager
java.lang.ArithmeticException: divide by zero
   at com.android.server.ProcessStats.printCurrentState(ProcessStats.java:702)
   at com.android.server.am.ActivityManagerService.appNotResponding(ActivityManagerService.java:3270)
   at com.android.server.am.ActivityManagerService.serviceTimeout(ActivityManagerService.java:10336)
   at com.android.server.am.ActivityManagerService$2.handleMessage(ActivityManagerService.java:1241)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loop(Looper.java:130)
   at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1570)
Sending signal. PID: 3855 SIG: 9


service 'wifi' died


service 'connectivity' died
service 'throttle' died
service 'accessibility' died
service 'backup' died
service 'SurfaceFlinger' died
service 'checkin_mot' died
service 'sensorservice' died
service 'entropy' died
service 'telephony.registry' died
service 'power' died
 

melamoud

Active Member
Licensed User
Longtime User
Its pretty large and use other modules, I can send it to you privately ,
the lines that always get run before the boot, is reading the mp3tags using ID3 tag class, it did not happened before I added this,
but it only happen after going over few files, and never on the same one.
 
Upvote 0

melamoud

Active Member
Licensed User
Longtime User
I assume that this long operation happens in Service_Create or Service_Start (or a sub that is called from these methods). Service_Start must be completed in 20 seconds.

You should use CallSubDelayed from Service_Start (or Create) to call the long operation sub.

YOU ARE THE MAN!!!

I somehow missed that small detail - it is working great now - thanks!!!
I guessed it did not happened on my galaxy s4 because it is so much faster:sign0027:
 
Upvote 0
Top