0

strong textenter image description hereI got stuck in a problem in my project. I am playing audio when app is in background mode using AVAudioplayer but after 2 mins app is terminated by IOS giving debugger message : "terminated due to signal 9". I have searched for the issue and got to know that if the CPU usage is too high iOS kills the app with "Terminated due to signal 9". The memory usage is about 12 MB in my application while playing audio. I do not understand how to solve this problem.Please help me out!!

UPDATE 1 CPU usage is around 90% on both foreground and background!! I have used time Profiler instrument to check which method is consuming more cpu usage, then i got to know that its main thread and the method through which i am updating the value of UISlider and a label for audio time!! But still i do not have solution for how to minimize cpu usage!!!!

UPDATE 2 - I did a mistake, i was calling timer with an interval of 0.0 sec!! Now i am calling it with an interval of one second and problem is solved.

Kirti
  • 573
  • 2
  • 8
  • 18
  • check http://stackoverflow.com/questions/29583277/ios-bluetooth-app-terminated-due-to-signal-9-only-in-background-mode – Nitin Gohel May 09 '16 at 11:59
  • I have seen this answer already, not using any graphics!! – Kirti May 09 '16 at 12:09
  • I assume you have set up your app for background audio? (https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH4-SW4) If you have, what does your crash log look like when you get the signal? – Phillip Mills May 09 '16 at 12:18
  • Yes, i have set the app for background audio. There is a message on crash log "Message from debugger : terminated app due to signal 9" – Kirti May 09 '16 at 12:28
  • That doesn't sound like a crash log entry. Open the devices window in Xcode, select the device that has crashed, click "View Device Logs". Do you see files there with more details? – Phillip Mills May 09 '16 at 12:43
  • yes i can see a file there – Kirti May 09 '16 at 12:58
  • I have added a snapshot of it. – Kirti May 09 '16 at 13:05
  • That's more interesting than "signal 9". :) What's odd is the idea that you're using too much CPU when the message also says 0% in 60 seconds. I wonder if thread 0 is stuck. Maybe if you symbolicate the crash, that thread 0 stack trace will give better clues. – Phillip Mills May 09 '16 at 13:15
  • Can you please tell me what can be reason for it? I am newb to ios development. – Kirti May 09 '16 at 13:19
  • I don't know...at least, not yet. Look up "symbolicatecrash" as a way of turning the list of numbers in the stack trace into actual program function names. Those might lead to an answer. – Phillip Mills May 09 '16 at 13:25
  • That crash log is useless. Symbolicate it. – trojanfoe May 10 '16 at 10:26

0 Answers0