Debug app freezes when (re)activated

I need some help debugging a very strange error in my application, that happens outside the "normal" app lifecycle.

I'm working on an internal iOS VoIP app. Pretty straight forward. It uses a VoIP stack and I programmed the whole UI / stack handling / user settings on top of it. The app works smooth 99% of the time.


However, about every 10th time the app is activated (and by this I mean either started or reopened by a user tapping the icon or after it dispatched a local notification), the app will freeze. This behaviour rarely ever occurs while debugging, plus when I added some NSLog() outputs, in order to see the app timings, everything from didFinishLaunchingWithOptions (for example) to viewDidAppear on the main view is done no-problem in a few ms.

This is the weird behaviour when this actually happens:

The app is not running, you tap the app icon

-> App Icon is in pushed state, freezes for 3-5s, then shows splash screen and starts normally (no crash)


The app is already running, you tap the app icon

-> App icon is in pushed state, freezes for 3-5s, then opens normally (no crash)


The device is locked, it gets some traffic and triggers a local notification

-> I can swipe the notification but when I click an option, it hangs. Works after 3-5s


So, my question is, how do I debug app freezes that seem to happen outside of the app lifecycle?

Thanks in advance for any answers.

So, my question is, how do I debug app freezes that seem to happen outside of the app lifecycle?

There’s two obvious steps here:

  • look in the device’s system log to see if there’s any obvious errors showing up there

  • take a sysdiagnose during the hang

bug

Instructions for the latter can be found on our Bug Reporting page.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks for your reply.


I did check the device's system log but I can't find much information to track down the actual problem. According to the error log, the app was killed with code 0x8badf00d, which means, it was terminated by the WDT. I do know that it hangs and gets revived when the WDT kicks in, but that gives me no indication to what was actually haning that caused the app to run into the WDT timeout.


The other odd thing is, that according to the crash log, the only binary image that is loaded at the time of the crash is the dyld library that gives me the exception, not even the application binary itself.

How is that even possible?


Thread 0 Crashed:

0 dyld 0x00278000 _dyld_start + 0


Thread 0 crashed with ARM Thread State (32-bit):

r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x00000000

r4: 0x00000000 r5: 0x00000000 r6: 0x00000000 r7: 0x00000000

r8: 0x00000000 r9: 0x00000000 r10: 0x00000000 r11: 0x00000000

ip: 0x00000000 sp: 0x003e2b30 lr: 0x00000000 pc: 0x00278000

cpsr: 0x00000010


Binary Images:

0x277000 - 0x2a2fff dyld armv7s <b8e1800c61ee3b7bad6039896fa47351> /usr/lib/dyld

Oh, I didn’t realise you were getting a crash log. Please post the whole thing.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Debug app freezes when (re)activated
 
 
Q