I encounter a \"failed to resume in time\" crash (which I assume to be watchdog related) on a very specific scenario: Only when resuming from background, and only when doing it
Yes, this is watchdog related.
Is it possible that your writing process takes too much time on the main thread and is blocking that one? That would explain why no log data is shown when coming back from background and that this only happens when resuming very shortly after going to background.
I would recommend doing the following:
Writing your data when going into background not in the main thread, but using a background task via:
[[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{...
Biggest rule: never block the main thread with anything might take longer than a fraction of a second. Move that all into background threads or in this scenario into a background task.
find in which thread you app is crashing put that thread in
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch_async(dispatch_get_main_queue(), ^{ // run that crashing thread here. }); });