App rejection - Crash report says: failed to scene-create in time (badf00d) What is wrong? - iphone

my app just got rejected by apple, and I could use some help to figure out what is wrong. The app works fine on all my devices and does not crash. The app synchronizes with iCloud right when it launches. This works fine on my devices, but maybe something is up with that.
Here is the first crash report (symbolicated):
Exception Type: 00000020
Exception Codes: 0x000000008badf00d
Highlighted Thread: 0
Application Specific Information:
com.Name.App failed to scene-create in time
Elapsed total CPU time (seconds): 9.250 (user 9.250, system 0.000), 23% CPU
Elapsed application CPU time (seconds): 0.298, 1% CPU
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x0000000192f7ceb8 semaphore_wait_trap + 8
1 libsystem_platform.dylib 0x00000001930299e0 _os_semaphore_wait + 20
2 libdispatch.dylib 0x0000000192e5e3e0 _dispatch_barrier_sync_f_slow + 516
3 Foundation 0x0000000182aedccc -[NSUbiquitousKeyValueStore _synchronizeForced:notificationQueue:] + 248
4 Foundation 0x0000000182aedb50 -[NSUbiquitousKeyValueStore synchronize] + 88
5 Cloud-Fryser 0x00000001000dab08 0x1000d0000 + 43784
6 UIKit 0x000000018645ce80 -[UIViewController loadViewIfRequired] + 688
7 UIKit 0x0000000186512374 -[UINavigationController _layoutViewController:] + 60
8 UIKit 0x0000000186512270 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 244
9 UIKit 0x000000018651170c -[UINavigationController _startTransition:fromViewController:toViewController:] + 108
10 UIKit 0x00000001865113b8 -[UINavigationController _startDeferredTransitionIfNeeded:] + 636
11 UIKit 0x00000001865110d8 -[UINavigationController __viewWillLayoutSubviews] + 52
12 UIKit 0x0000000186511058 -[UILayoutContainerView layoutSubviews] + 196
13 UIKit 0x0000000186459a28 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 568
14 QuartzCore 0x0000000185db1990 -[CALayer layoutSublayers] + 164
15 QuartzCore 0x0000000185dac560 CA::Layer::layout_if_needed(CA::Transaction*) + 316
16 QuartzCore 0x0000000185dac404 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 28
17 QuartzCore 0x0000000185dabc04 CA::Context::commit_transaction(CA::Transaction*) + 272
18 QuartzCore 0x0000000185dab988 CA::Transaction::commit() + 432
19 UIKit 0x00000001866e7014 -[UIApplication _reportMainSceneUpdateFinished:] + 56
20 UIKit 0x00000001866e7ec0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2776
21 UIKit 0x00000001866e6044 -[UIApplication workspaceDidEndTransaction:] + 180
22 FrontBoardServices 0x0000000189edd63c __31-[FBSSerialQueue performAsync:]_block_invoke + 24
23 CoreFoundation 0x0000000181c66120 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
24 CoreFoundation 0x0000000181c65228 __CFRunLoopDoBlocks + 308
25 CoreFoundation 0x0000000181c63428 __CFRunLoopRun + 692
26 CoreFoundation 0x0000000181b911f0 CFRunLoopRunSpecific + 392
27 UIKit 0x00000001864c7788 -[UIApplication _run] + 548
28 UIKit 0x00000001864c2780 UIApplicationMain + 1484
29 Cloud-Fryser 0x00000001000dc878 0x1000d0000 + 51320
30 libdyld.dylib 0x0000000192e7ea04 start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x0000000192f7cc94 kevent64 + 8
1 libdispatch.dylib 0x0000000192e6497c _dispatch_mgr_invoke + 272
2 libdispatch.dylib 0x0000000192e573b0 _dispatch_mgr_thread + 48
Thread 2 name: Dispatch queue: com.apple.sydprotection
Thread 2:
0 libsystem_kernel.dylib 0x0000000192f96e50 __open + 8
1 libsystem_kernel.dylib 0x0000000192f95dbc open + 12
2 Foundation 0x0000000182ab1ebc _NSReadBytesFromFileWithExtendedAttributes + 132
3 Foundation 0x0000000182ab1ddc -[NSData(NSData) initWithContentsOfFile:] + 76
4 Foundation 0x0000000182ad87fc -[NSData(NSData) initWithContentsOfURL:] + 384
5 Foundation 0x0000000182ab1cf0 +[NSDictionary(NSDictionary) newWithContentsOf:immutable:] + 112
6 SyncedDefaults 0x000000018dbab224 -[SYDRemotePreferencesSource _cachePlistFromDisk] + 104
7 SyncedDefaults 0x000000018dbabedc -[SYDRemotePreferencesSource _synchronizeForced:] + 160
8 SyncedDefaults 0x000000018dbabdac __48-[SYDRemotePreferencesSource synchronizeForced:]_block_invoke + 36
9 libdispatch.dylib 0x0000000192e55368 _dispatch_client_callout + 12
10 libdispatch.dylib 0x0000000192e5e6e4 _dispatch_barrier_sync_f_invoke + 72
11 SyncedDefaults 0x000000018dbabd5c -[SYDRemotePreferencesSource synchronizeForced:] + 116
12 Foundation 0x0000000182aecc74 -[NSUbiquitousKeyValueStore synchronizeWithSourceForced:] + 32
13 Foundation 0x0000000182aecbe0 __46-[NSUbiquitousKeyValueStore _registerToDaemon]_block_invoke + 72
14 libdispatch.dylib 0x0000000192e553a8 _dispatch_call_block_and_release + 20
15 libdispatch.dylib 0x0000000192e55368 _dispatch_client_callout + 12
16 libdispatch.dylib 0x0000000192e5f4bc _dispatch_queue_drain + 1212
17 libdispatch.dylib 0x0000000192e58470 _dispatch_queue_invoke + 128
18 libdispatch.dylib 0x0000000192e61220 _dispatch_root_queue_drain + 660
19 libdispatch.dylib 0x0000000192e62758 _dispatch_worker_thread3 + 104
20 libsystem_pthread.dylib 0x00000001930312e0 _pthread_wqthread + 812
21 libsystem_pthread.dylib 0x0000000193030fa4 start_wqthread + 0
Thread 3:
0 libsystem_kernel.dylib 0x0000000192f97c78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000193031390 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x0000000193030fa4 start_wqthread + 0
Thread 4:
0 libsystem_kernel.dylib 0x0000000192f97c78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000193031390 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x0000000193030fa4 start_wqthread + 0
Thread 5:
0 libsystem_kernel.dylib 0x0000000192f7ce7c mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000192f7ccf4 mach_msg + 68
2 CoreFoundation 0x0000000181c655c8 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x0000000181c6351c __CFRunLoopRun + 936
4 CoreFoundation 0x0000000181b911f0 CFRunLoopRunSpecific + 392
5 CoreFoundation 0x0000000181be32a8 CFRunLoopRun + 108
6 CoreMotion 0x000000018258a9d4 0x182548000 + 272852
7 libsystem_pthread.dylib 0x0000000193033e7c _pthread_body + 160
8 libsystem_pthread.dylib 0x0000000193033dd8 _pthread_start + 156
9 libsystem_pthread.dylib 0x0000000193030fac thread_start + 0
Here is the second crash report:
Application Specific Information:
com.Name.App failed to scene-create in time
Elapsed total CPU time (seconds): 20.300 (user 20.300, system 0.000), 49% CPU
Elapsed application CPU time (seconds): 0.207, 1% CPU
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x0000000192f7ceb8 semaphore_wait_trap + 8
1 libdispatch.dylib 0x0000000192e62d98 _dispatch_group_wait_slow + 244
2 CloudDocs 0x0000000188427818 -[BRXPCSyncProxy resultWithTimeout:] + 72
3 CloudDocs 0x0000000188418bc0 __BRIsProcessForcingUbiquity_block_invoke + 172
4 libdispatch.dylib 0x0000000192e55368 _dispatch_client_callout + 12
5 libdispatch.dylib 0x0000000192e56240 dispatch_once_f + 92
6 CloudDocs 0x0000000188418b0c BRIsProcessForcingUbiquity + 60
7 Foundation 0x0000000182b3ad6c ___BRIsCloudDocsUsed_block_invoke + 44
8 libdispatch.dylib 0x0000000192e55368 _dispatch_client_callout + 12
9 libdispatch.dylib 0x0000000192e56240 dispatch_once_f + 92
10 Foundation 0x0000000182b35044 ___NSFrameworkHandleForLibrarianSymbols_block_invoke + 96
11 libdispatch.dylib 0x0000000192e55368 _dispatch_client_callout + 12
12 libdispatch.dylib 0x0000000192e56240 dispatch_once_f + 92
13 Foundation 0x0000000182b3acec ___initializeLibrarianFunctions_block_invoke + 268
14 libdispatch.dylib 0x0000000192e55368 _dispatch_client_callout + 12
15 libdispatch.dylib 0x0000000192e56240 dispatch_once_f + 92
16 Foundation 0x0000000182b3a5b0 -[NSFileManager URLForUbiquityContainerIdentifier:] + 544
17 Cloud-Fryser 0x000000010003dc04 -[AppDelegate application:didFinishLaunchingWithOptions:] (AppDelegate.m:20)
18 UIKit 0x00000001864ce3cc -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 300
19 UIKit 0x00000001866e522c -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2280
20 UIKit 0x00000001866e79ac -[UIApplication _runWithMainScene:transitionContext:completion:] + 1476
21 UIKit 0x00000001866e6044 -[UIApplication workspaceDidEndTransaction:] + 180
22 FrontBoardServices 0x0000000189edd63c __31-[FBSSerialQueue performAsync:]_block_invoke + 24
23 CoreFoundation 0x0000000181c66120 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
24 CoreFoundation 0x0000000181c65228 __CFRunLoopDoBlocks + 308
25 CoreFoundation 0x0000000181c6384c __CFRunLoopRun + 1752
26 CoreFoundation 0x0000000181b911f0 CFRunLoopRunSpecific + 392
27 UIKit 0x00000001864c7788 -[UIApplication _run] + 548
28 UIKit 0x00000001864c2780 UIApplicationMain + 1484
29 Cloud-Fryser 0x0000000100044878 main (main.m:16)
30 libdyld.dylib 0x0000000192e7ea04 start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x0000000192f7cc94 kevent64 + 8
1 libdispatch.dylib 0x0000000192e6497c _dispatch_mgr_invoke + 272
2 libdispatch.dylib 0x0000000192e573b0 _dispatch_mgr_thread + 48
If you need additional information, just let me know.

The issue is very simple.
You just spend too much time loading your app on the splash screen and the iOS device stops your app.
The reason it only happens in the review and not when you test it is because you always run it from Xcode, and when running from Xcode it won't have this behavior.
If you will run your app directly from the device (by tapping its icon) you will see it will happen there as well. Assuming you spent too much time loading on that specific run.
Edit: Also I am seeing that you are stuck on a semaphore and don't use too much CPU, which might mean you have a deadlock which stalls the app on the reviewer's device and that is why it spends too much time loading and the device stops your app. Not sure...
Here is my devblog post if you are interested:
http://pompidev.net/2014/11/16/ios-app-works-on-xcode-but-crash-running-from-device/

Related

Invalid address

My app is crashing a lot lately and it's throwing this as an error:
NSOperationQueue 0x2806fd260 (QOS: UNSPECIFIED) EXC_BAD_ACCESS
KERN_INVALID_ADDRESS 0x0000000000000000.
I can't find the call that causes this problem. Can someone help me solve this problem please?
This is the crash stacktrace:
0 AlamofireNetworkLogger 0x10203c7b4 (Missing)
1 AlamofireNetworkLogger 0x10203d910 (Missing)
2 CoreFoundation 0x1829715bc __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
3 CoreFoundation 0x182971588 ___CFXRegistrationPost_block_invoke + 64
4 CoreFoundation 0x182970a7c _CFXRegistrationPost + 392
5 CoreFoundation 0x182970728 ___CFXNotificationPost_block_invoke + 96
6 CoreFoundation 0x1828ea524 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1496
7 CoreFoundation 0x1829701d8 _CFXNotificationPost + 696
8 Foundation 0x183358814 -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
9 Alamofire 0x101fd7a84 closure #1 in SessionDelegate.urlSession(_:task:didCompleteWithError:) (SessionDelegate.swift:451)
10 Alamofire 0x101fd7460 SessionDelegate.urlSession(_:task:didCompleteWithError:) (SessionDelegate.swift:495)
11 Alamofire 0x101fd83c0 #objc SessionDelegate.urlSession(_:task:didCompleteWithError:) (<compiler-generated>)
12 myApp 0x10157e9d4 __InstrumentURLSessionTaskDidCompleteWithError_block_invoke + 4311443924
13 CFNetwork 0x183183420 __51-[NSURLSession delegate_task:didCompleteWithError:]_block_invoke.182 + 252
14 Foundation 0x183464f68 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
15 Foundation 0x183371420 -[NSBlockOperation main] + 72
16 Foundation 0x183370908 -[__NSOperationInternal _start:] + 740
17 Foundation 0x183466cec __NSOQSchedule_f + 272
18 libdispatch.dylib 0x182440a38 _dispatch_call_block_and_release + 24
19 libdispatch.dylib 0x1824417d4 _dispatch_client_callout + 16
20 libdispatch.dylib 0x1823e6018 _dispatch_continuation_pop$VARIANT$mp + 412
21 libdispatch.dylib 0x1823e56dc _dispatch_async_redirect_invoke + 600
22 libdispatch.dylib 0x1823f202c _dispatch_root_queue_drain + 372
23 libdispatch.dylib 0x1823f28d0 _dispatch_worker_thread2 + 128
24 libsystem_pthread.dylib 0x1826211b4 _pthread_wqthread + 464
25 libsystem_pthread.dylib 0x182623cd4 start_wqthread + 4

Unable to understand Apple Crash Log with -[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:]

I'm unable to understand this crash log from Apple. I have been a few times rejected because of this. They are complaining it's occurred on ipad running latest software 10.3.1. When we double check with on ipad simulator, it's running without crashes.
Last Exception Backtrace:
0 CoreFoundation 0x1848b2fd8 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x183314538 objc_exception_throw + 56
2 CoreFoundation 0x1848b2eac +[NSException raise:format:arguments:] + 104
3 Foundation 0x18534a710 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
4 UIKit 0x18ac57454 -[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:] + 196
5 UIKit 0x18ac57514 -[UIApplication _systemAnimationFenceCreatingIfNecessary:] + 24
6 UIKit 0x18acb07a0 +[UIWindow _synchronizedDrawingFence] + 116
7 UIKit 0x18ae6e150 +[_UIKeyboardChangedInformation informationForKeyboardUp:withIAV:] + 104
8 UIKit 0x18b1678d4 -[_UIRemoteKeyboards prepareToMoveKeyboard:withIAV:showing:forScreen:] + 464
9 UIKit 0x18aa9fc04 -[UIPeripheralHost(UIKitInternal) setInputViews:animationStyle:] + 820
10 UIKit 0x18aabccf4 -[UIPeripheralHost(UIKitInternal) _restoreInputViewsWithId:animated:] + 584
11 UIKit 0x18ad4fd64 -[UIViewController _restoreInputViewsForPresentation] + 280
12 UIKit 0x18ad2ae3c -[UIPresentationController runTransitionForCurrentState] + 1560
13 UIKit 0x18ad290f8 -[UIPresentationController _dismissWithAnimationController:interactionController:target:didEndSelector:] + 764
14 UIKit 0x18ad4f8c0 -[UIViewController _dismissViewControllerWithAnimationController:interactionController:completion:] + 464
15 UIKit 0x18ab04cd4 -[UIViewController _dismissViewControllerWithTransition:from:completion:] + 600
16 UIKit 0x18aaacb6c -[UIViewController dismissViewControllerWithTransition:completion:] + 1144
17 UIKit 0x18aaac94c -[UIViewController dismissViewControllerWithTransition:completion:] + 600
18 UIKit 0x18ad4eb68 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 524
19 UIKit 0x18aaac6c0 -[UIViewController dismissViewControllerAnimated:completion:] + 152
20 newapp 0x100115628 0x1000b0000 + 415272
21 newapp 0x1001159e8 0x1000b0000 + 416232
22 CFNetwork 0x184ebc1fc __75-[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:]_block_invoke + 32
23 CFNetwork 0x184ed3ef8 __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 148
24 Foundation 0x185381804 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
25 Foundation 0x1852c6760 -[NSBlockOperation main] + 96
26 Foundation 0x1852b6b18 -[__NSOperationInternal _start:] + 612
27 Foundation 0x185383ba0 __NSOQSchedule_f + 228
28 libdispatch.dylib 0x18376a9a0 _dispatch_client_callout + 16
29 libdispatch.dylib 0x183778ad4 _dispatch_queue_serial_drain + 928
30 libdispatch.dylib 0x18376e2cc _dispatch_queue_invoke + 884
31 libdispatch.dylib 0x18377aa50 _dispatch_root_queue_drain + 540
32 libdispatch.dylib 0x18377a7d0 _dispatch_worker_thread3 + 124
33 libsystem_pthread.dylib 0x1839731d0 _pthread_wqthread + 1096
34 libsystem_pthread.dylib 0x183972d7c start_wqthread + 4
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x000000018388f224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018388f09c mach_msg + 72
2 CoreFoundation 0x0000000184860e88 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x000000018485eadc __CFRunLoopRun + 1060
4 CoreFoundation 0x000000018478ed94 CFRunLoopRunSpecific + 424
5 GraphicsServices 0x00000001861f8074 GSEventRunModal + 100
6 UIKit 0x000000018aa40130 UIApplicationMain + 208
7 newapp 0x000000010022f390 0x1000b0000 + 1569680
8 libdyld.dylib 0x000000018379d59c start + 4
Thread 1 name: com.apple.uikit.eventfetch-thread
Thread 1:
0 libsystem_kernel.dylib 0x000000018388f224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018388f09c mach_msg + 72
2 CoreFoundation 0x0000000184860e88 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x000000018485eadc __CFRunLoopRun + 1060
4 CoreFoundation 0x000000018478ed94 CFRunLoopRunSpecific + 424
5 Foundation 0x00000001852a8d64 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6 Foundation 0x00000001852c9b34 -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
7 UIKit 0x000000018b3ca5f8 -[UIEventFetcher threadMain] + 136
8 Foundation 0x00000001853a62c8 __NSThread__start__ + 996
9 libsystem_pthread.dylib 0x000000018397575c _pthread_body + 240
10 libsystem_pthread.dylib 0x000000018397566c _pthread_body + 0
11 libsystem_pthread.dylib 0x0000000183972d84 thread_start + 4
Thread 2:
0 libsystem_kernel.dylib 0x00000001838ada88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000183973274 _pthread_wqthread + 1260
2 libsystem_pthread.dylib 0x0000000183972d7c start_wqthread + 4
Thread 3 name: com.apple.CFStream.LegacyThread
Thread 3:
0 libsystem_kernel.dylib 0x000000018388f224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018388f09c mach_msg + 72
2 CoreFoundation 0x0000000184860e88 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x000000018485eadc __CFRunLoopRun + 1060
4 CoreFoundation 0x000000018478ed94 CFRunLoopRunSpecific + 424
5 CoreFoundation 0x000000018486e78c _legacyStreamRunLoop_workThread + 268
6 libsystem_pthread.dylib 0x000000018397575c _pthread_body + 240
7 libsystem_pthread.dylib 0x000000018397566c _pthread_body + 0
8 libsystem_pthread.dylib 0x0000000183972d84 thread_start + 4
Thread 4 name: com.apple.NSURLConnectionLoader
Thread 4:
0 libsystem_kernel.dylib 0x000000018388f224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018388f09c mach_msg + 72
2 CoreFoundation 0x0000000184860e88 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x000000018485eadc __CFRunLoopRun + 1060
4 CoreFoundation 0x000000018478ed94 CFRunLoopRunSpecific + 424
5 CFNetwork 0x0000000184f9aca4 +[NSURLConnection(Loader) _resourceLoadLoop:] + 404
6 Foundation 0x00000001853a62c8 __NSThread__start__ + 996
7 libsystem_pthread.dylib 0x000000018397575c _pthread_body + 240
8 libsystem_pthread.dylib 0x000000018397566c _pthread_body + 0
9 libsystem_pthread.dylib 0x0000000183972d84 thread_start + 4
Thread 5 name: Dispatch queue: NSOperationQueue 0x170031360 :: NSOperation 0x17024ab30 (QOS: DEFAULT)
Thread 5 Crashed:
0 libsystem_kernel.dylib 0x00000001838ad014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x0000000183977334 pthread_kill + 112
2 libsystem_c.dylib 0x00000001838219c4 abort + 140
3 libc++abi.dylib 0x00000001832ed1b0 __cxa_bad_cast + 0
4 libc++abi.dylib 0x0000000183306c04 default_unexpected_handler() + 0
5 libobjc.A.dylib 0x0000000183314820 _objc_terminate() + 124
6 libc++abi.dylib 0x00000001833035d4 std::__terminate(void (*)()) + 16
7 libc++abi.dylib 0x0000000183303640 std::terminate() + 60
8 libdispatch.dylib 0x000000018376a9b4 _dispatch_client_callout + 36
9 libdispatch.dylib 0x0000000183778ad4 _dispatch_queue_serial_drain + 928
10 libdispatch.dylib 0x000000018376e2cc _dispatch_queue_invoke + 884
11 libdispatch.dylib 0x000000018377aa50 _dispatch_root_queue_drain + 540
12 libdispatch.dylib 0x000000018377a7d0 _dispatch_worker_thread3 + 124
13 libsystem_pthread.dylib 0x00000001839731d0 _pthread_wqthread + 1096
14 libsystem_pthread.dylib 0x0000000183972d7c start_wqthread + 4
The log clearly shows the problem happens on a background thread. You need to perform UI actions on the main queue. Use DispatchQueue.main.async to dismiss the view controller.

iOS Xcode App crashes after release to App Store but not when testing

I've had an app on the app store for about a month and then I recently uploaded an updated binary to the App Store, version 2.0. It uses SpriteKit and ever since that update every person who downloaded it got a crash upon startup (this was apparent in the customer reviews). So I went back through my code and realized that I forgot to change one of the code signing options to Distribution instead of developer. After archiving that new binary, 2.1, and waiting ANOTHER week to have it released again, version 2.1 crashed as well. My app has been down for 2 weeks now and I'm fed up with this. I made very minor changes including a line of code in the AppDelegate.m that allows the user to play their own music in the background:
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];
return YES;
}
I am not super comfortable with Xcode and it is my first app. I get this crash report in iTunes Connect:
Incident Identifier: A0DB04E6-A62B-46AB-8896-CE77A91064EF
Hardware Model: iPhone5,3
Process: PokeJump [831]
Path: /var/mobile/Applications/BB765A31-6028-429B-9939- F69DB8B62E85/PokeJump.app/PokeJump
Identifier: PokeJump.PokeJump
Version: 2.0 (2.0)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2014-07-01 19:07:36.341 -0400
OS Version: iOS 7.1.1 (11D201)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x2fe61f06 __exceptionPreprocess + 126
1 libobjc.A.dylib 0x3a5f8ce2 objc_exception_throw + 34
2 CoreFoundation 0x2fe61e48 +[NSException raise:format:] + 108
3 SpriteKit 0x325a6c12 +[SKPlaySound playSoundFileNamed:atPosition:waitForCompletion:] + 578
4 SpriteKit 0x3255f8ec +[SKAction(SKActions) playSoundFileNamed:waitForCompletion:] + 60
5 PokeJump 0x000637de 0x0005a000 + 38878
6 PokeJump 0x0006177e 0x0005a000 + 30590
7 PokeJump 0x0006e080 0x0005a000 + 82048
8 UIKit 0x32695a4e -[UIViewController loadViewIfRequired] + 514
9 UIKit 0x3269580c -[UIViewController view] + 20
10 UIKit 0x327b5292 -[UIWindow handleStatusBarChangeFromHeight:toHeight:] + 690
11 UIKit 0x3271c432 +[UIWindow _noteStatusBarHeightChanged:oldHeight:forAutolayoutRootViewsOnly:] + 234
12 UIKit 0x3281cb2c __79-[UIApplication _setStatusBarHidden:animationParameters:changeApplicationFlag:]_block_invoke + 128
13 UIKit 0x326c6a36 +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 486
14 UIKit 0x327ff33a +[UIView(UIViewAnimationWithBlocks) animateWithDuration:animations:completion:] + 66
15 UIKit 0x32741de6 -[UIApplication _setStatusBarHidden:animationParameters:changeApplicationFlag:] + 458
16 UIKit 0x3269c8fc -[UIApplication _updateCurrentStatusBarViewControllerAppearance] + 244
17 UIKit 0x32699d8e -[UIWindow _setHidden:forced:] + 230
18 UIKit 0x32703a4c -[UIWindow makeKeyAndVisible] + 56
19 UIKit 0x327006e0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1816
20 UIKit 0x326facc4 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 716
21 UIKit 0x32696c92 -[UIApplication handleEvent:withNewEvent:] + 3546
22 UIKit 0x32695df4 -[UIApplication sendEvent:] + 68
23 UIKit 0x326fa400 _UIApplicationHandleEvent + 612
24 GraphicsServices 0x34d03b50 _PurpleEventCallback + 604
25 GraphicsServices 0x34d0373a PurpleEventCallback + 30
26 CoreFoundation 0x2fe2c842 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 30
27 CoreFoundation 0x2fe2c7de __CFRunLoopDoSource1 + 342
28 CoreFoundation 0x2fe2afaa __CFRunLoopRun + 1402
29 CoreFoundation 0x2fd95764 CFRunLoopRunSpecific + 520
30 CoreFoundation 0x2fd95546 CFRunLoopRunInMode + 102
31 UIKit 0x326f9626 -[UIApplication _run] + 758
32 UIKit 0x326f488c UIApplicationMain + 1132
33 PokeJump 0x0006e73e 0x0005a000 + 83774
34 libdyld.dylib 0x3aaf6ab2 tlv_initializer + 2
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3abad1f0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x3ac157b2 pthread_kill + 54
2 libsystem_c.dylib 0x3ab5dff4 abort + 72
3 libc++abi.dylib 0x39fac98a abort_message + 70
4 libc++abi.dylib 0x39fc56e2 default_terminate_handler() + 250
5 libobjc.A.dylib 0x3a5f8f7a _objc_terminate() + 190
6 libc++abi.dylib 0x39fc31b0 std::__terminate(void
7 libc++abi.dylib 0x39fc2d12 __cxa_rethrow + 98
8 libobjc.A.dylib 0x3a5f8e2a objc_exception_rethrow + 38
9 CoreFoundation 0x2fd957da CFRunLoopRunSpecific + 638
10 CoreFoundation 0x2fd95546 CFRunLoopRunInMode + 102
11 UIKit 0x326f9626 -[UIApplication _run] + 758
12 UIKit 0x326f488c UIApplicationMain + 1132
13 PokeJump 0x0006e73e 0x5a000 + 83774
14 libdyld.dylib 0x3aaf6ab4 start + 0
Thread 1:
0 libsystem_kernel.dylib 0x3ab9a804 kevent64 + 24
1 libdispatch.dylib 0x3aae9050 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x3aae32de _dispatch_mgr_thread + 34
Thread 2:
0 libsystem_kernel.dylib 0x3abadc70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x3ac12c1e _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x3ac12ad8 start_wqthread + 4
Thread 3:
0 libsystem_kernel.dylib 0x3abadc70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x3ac12c1e _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x3ac12ad8 start_wqthread + 4
Thread 4:
0 libsystem_kernel.dylib 0x3ab9aa50 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3ab9a848 mach_msg + 36
2 CoreFoundation 0x2fe2c624 __CFRunLoopServiceMachPort + 152
3 CoreFoundation 0x2fe2ad44 __CFRunLoopRun + 788
4 CoreFoundation 0x2fd95764 CFRunLoopRunSpecific + 520
5 CoreFoundation 0x2fd95546 CFRunLoopRunInMode + 102
6 libAVFAudio.dylib 0x2edfa45e GenericRunLoopThread::Entry(void*) + 126
7 libAVFAudio.dylib 0x2edee8fc CAPThread::Entry(CAPThread*) + 176
8 libsystem_pthread.dylib 0x3ac14956 _pthread_body + 138
9 libsystem_pthread.dylib 0x3ac148c6 _pthread_start + 98
10 libsystem_pthread.dylib 0x3ac12ae4 thread_start + 4
Thread 5:
0 AudioToolbox 0x2f74f7d4 CrashIfClientProvidedBogusAudioBufferList + 124
1 AudioToolbox 0x2f75e1d6 AudioConverterFillComplexBuffer + 250
2 AudioToolbox 0x2f81decc AUInputFormatConverter2::PullAndConvertInput(AudioTimeStamp const&, unsigned long&, AudioBufferList&, AudioStreamPacketDescription*, bool&) + 96
3 AudioToolbox 0x2f81da74 AUConverterBase::RenderBus(unsigned long&, AudioTimeStamp const&, unsigned long, unsigned long) + 212
4 AudioToolbox 0x2f7518f4 AUBase::DoRenderBus(unsigned long&, AudioTimeStamp const&, unsigned long, AUOutputElement*, unsigned long, AudioBufferList&) + 144
5 AudioToolbox 0x2f751744 AUBase::DoRender(unsigned long&, AudioTimeStamp const&, unsigned long, unsigned long, AudioBufferList&) + 528
6 AudioToolbox 0x2f80d96c AURemoteIO::PerformIO(unsigned long, unsigned int, unsigned int, AudioTimeStamp const&, AudioTimeStamp const&, AudioBufferList const*, AudioBufferList*, int&) + 484
7 AudioToolbox 0x2f80e9b8 AURIOCallbackReceiver_PerformIO + 392
8 AudioToolbox 0x2f8050b2 _XPerformIO + 174
9 AudioToolbox 0x2f77264a mshMIGPerform + 122
10 AudioToolbox 0x2f7e1b28 MSHMIGDispatchMessage + 28
11 AudioToolbox 0x2f80dbe4 AURemoteIO::IOThread::Run() + 116
12 AudioToolbox 0x2f810cc4 AURemoteIO::IOThread::Entry(void*) + 4
13 AudioToolbox 0x2f74db38 CAPThread::Entry(CAPThread*) + 208
14 libsystem_pthread.dylib 0x3ac14956 _pthread_body + 138
15 libsystem_pthread.dylib 0x3ac148c6 _pthread_start + 98
16 libsystem_pthread.dylib 0x3ac12ae4 thread_start + 4
Thread 0 crashed with ARM Thread State (32-bit):
I realize it says version 2.0 on this crash report but I am assuming both crashed for the same reason. I am desperate to find a fix for this and it frustrates me so much because it runs perfectly fine on all the simulators and on my iPad and iPhone when I run it when connected to my computer. Any help would mean a lot. Thanks

weird iPhone 0x8badf00d crash report

I got a iPhone crash report when my app is brought to foreground, before that, the app is deleting some files, and i press HOME button to bring it background.
the weird thing is in the crash report, the Highlighted Thread is not 0, in my memory, the code 0x8badf00d exception's highlighted thread is always 0.
the thread 5 is doing some database operation, i used FMDB's queue mechanism to avoid multi-threads competition.
i wander know why the highlighted thread is 5 ? is the thread 5 block the main thread ?
Thanks for any help you can offer.
here is the crash report:
Date/Time: 2013-10-30 15:37:24.620 +0800
OS Version: iOS 6.1.3 (10B329)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x000000008badf00d
Highlighted Thread: 5
Application Specific Information:
com.xxxx.xxxx failed to resume in time
Elapsed total CPU time (seconds): 10.010 (user 10.010, system 0.000), 100% CPU
Elapsed application CPU time (seconds): 7.631, 76% CPU
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x3b9bcc80 __unlink + 8
1 libsystem_kernel.dylib 0x3b9ae8bc unlink + 4
2 libremovefile.dylib 0x3b9027f8 __removefile_process_file + 236
3 libremovefile.dylib 0x3b90288a __removefile_tree_walker + 114
4 libremovefile.dylib 0x3b902a72 removefile + 118
5 Foundation 0x340cec4e -[NSFilesystemItemRemoveOperation main] + 170
6 Foundation 0x340cd5bc -[__NSOperationInternal start] + 836
7 Foundation 0x340cc4fc -[NSFileManager removeItemAtPath:error:] + 80
8 mCloud_iPhone 0x003037ae -[SDImageCache clearDisk] (SDImageCache.m:413)
9 mCloud_iPhone 0x0032a1d2 -[AppSettingViewController clearCachesEvent:] (AppSettingViewController.m:365)
10 UIKit 0x357330c0 -[UIApplication sendAction:to:from:forEvent:] + 68
11 UIKit 0x35733072 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26
12 UIKit 0x35733050 -[UIControl sendAction:to:forEvent:] + 40
13 UIKit 0x35732906 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 498
14 UIKit 0x35732dfc -[UIControl touchesEnded:withEvent:] + 484
15 UIKit 0x3565141c _UIGestureRecognizerUpdate + 5764
16 CoreFoundation 0x338156ca __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
17 CoreFoundation 0x338139bc __CFRunLoopDoObservers + 272
18 CoreFoundation 0x33813d12 __CFRunLoopRun + 738
19 CoreFoundation 0x33786eb8 CFRunLoopRunSpecific + 352
20 CoreFoundation 0x33786d44 CFRunLoopRunInMode + 100
21 GraphicsServices 0x373392e6 GSEventRunModal + 70
22 UIKit 0x3569c2fc UIApplicationMain + 1116
23 mCloud_iPhone 0x002d7c06 main (main.m:16)
24 mCloud_iPhone 0x002d7bc8 ___lldb_unnamed_function8568$$mCloud_iPhone + 36
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x3b9ac648 kevent64 + 24
1 libdispatch.dylib 0x3b8e54ec _dispatch_mgr_invoke + 792
2 libdispatch.dylib 0x3b8d7df4 _dispatch_mgr_thread$VARIANT$up + 32
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x3b9abeb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3b9ac048 mach_msg + 36
2 CoreFoundation 0x33815040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x33813d9e __CFRunLoopRun + 878
4 CoreFoundation 0x33786eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x33786d44 CFRunLoopRunInMode + 100
6 WebCore 0x39774500 RunWebThread(void*) + 440
7 libsystem_c.dylib 0x3b91530e _pthread_start + 306
8 libsystem_c.dylib 0x3b9151d4 thread_start + 4
Thread 3 name: com.crashlytics.MachExceptionServer
Thread 3:
0 libsystem_kernel.dylib 0x3b9abeb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3b9ac048 mach_msg + 36
2 mCloud_iPhone 0x00488940 ___lldb_unnamed_function16966$$mCloud_iPhone + 116
3 libsystem_c.dylib 0x3b91530e _pthread_start + 306
4 libsystem_c.dylib 0x3b9151d4 thread_start + 4
Thread 4:
0 libsystem_kernel.dylib 0x3b9abeb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3b9ac048 mach_msg + 36
2 CoreFoundation 0x33815040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x33813d9e __CFRunLoopRun + 878
4 CoreFoundation 0x33786eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x33786d44 CFRunLoopRunInMode + 100
6 mCloud_iPhone 0x003ec330 -[FXThreadManager threadFunc:] (FXThreadManager.m:263)
7 Foundation 0x34156e80 __NSThread__main__ + 968
8 libsystem_c.dylib 0x3b91530e _pthread_start + 306
9 libsystem_c.dylib 0x3b9151d4 thread_start + 4
Thread 5 name: Dispatch queue: fmdb.<FMDatabaseQueue: 0x1ede9bc0>
Thread 5:
0 libsqlite3.dylib 0x3b6e127c ___lldb_unnamed_function124$$libsqlite3.dylib + 35596
1 libsqlite3.dylib 0x3b6d8482 sqlite3_step + 2138
2 mCloud_iPhone 0x00429fca -[FMResultSet next] (FMResultSet.m:155)
3 mCloud_iPhone 0x00454930 +[FXDatabaseOperator query:withVAList:withDatabase:resultType:] (FXDatabaseOperator.m:182)
4 mCloud_iPhone 0x00454f54 __44+[FXDatabaseOperator queryWithDBFileID:sql:]_block_invoke (FXDatabaseOperator.m:236)
5 mCloud_iPhone 0x00453124 __30-[FMDatabaseQueue inDatabase:]_block_invoke (FMDatabaseQueue.m:101)
6 libdispatch.dylib 0x3b8d54b4 _dispatch_client_callout + 20
7 libdispatch.dylib 0x3b8e390a _dispatch_barrier_sync_f_invoke + 22
8 mCloud_iPhone 0x00453098 -[FMDatabaseQueue inDatabase:] (FMDatabaseQueue.m:98)
9 mCloud_iPhone 0x00454e16 +[FXDatabaseOperator queryWithDBFileID:sql:] (FXDatabaseOperator.m:235)
10 mCloud_iPhone 0x000c5804 -[DatabaseManager queryPhotoBackupByFileName:] (DatabaseManager.m:1233)
11 mCloud_iPhone 0x000dda50 -[CameraBackupManager queryBackUpDb:] (CameraBackupManager.m:2867)
12 mCloud_iPhone 0x000d3bc4 __43-[CameraBackupManager synSystemlibraryToDb]_block_invoke_2 (CameraBackupManager.m:514)
13 AssetsLibrary 0x330c7c5e __62-[ALAssetsGroup _enumerateAssetsAtIndexes:options:usingBlock:]_block_invoke_0125 + 102
14 CoreFoundation 0x3383499e __NSArrayEnumerate + 394
15 CoreFoundation 0x33796b66 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 58
16 AssetsLibrary 0x330c78be -[ALAssetsGroup _enumerateAssetsAtIndexes:options:usingBlock:] + 718
17 AssetsLibrary 0x330c7cd4 -[ALAssetsGroup enumerateAssetsUsingBlock:] + 24
18 AssetsLibrary 0x330c9a0a __block_global_1 + 26
19 CoreFoundation 0x3383499e __NSArrayEnumerate + 394
20 CoreFoundation 0x33796b66 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 58
21 AssetsLibrary 0x330c9866 __block_global_0 + 1014
22 libdispatch.dylib 0x3b8d611c _dispatch_call_block_and_release + 8
23 libdispatch.dylib 0x3b8e4254 _dispatch_root_queue_drain + 256
24 libdispatch.dylib 0x3b8e43b4 _dispatch_worker_thread2 + 80
25 libsystem_c.dylib 0x3b90aa0e _pthread_wqthread + 358
26 libsystem_c.dylib 0x3b90a8a0 start_wqthread + 4
Thread 6:
0 libsystem_kernel.dylib 0x3b9abeb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3b9ac048 mach_msg + 36
2 CoreFoundation 0x33815040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x33813d9e __CFRunLoopRun + 878
4 CoreFoundation 0x33786eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x33786d44 CFRunLoopRunInMode + 100
6 mCloud_iPhone 0x003ec330 -[FXThreadManager threadFunc:] (FXThreadManager.m:263)
7 Foundation 0x34156e80 __NSThread__main__ + 968
8 libsystem_c.dylib 0x3b91530e _pthread_start + 306
9 libsystem_c.dylib 0x3b9151d4 thread_start + 4
Thread 7:
0 libsystem_kernel.dylib 0x3b9abeb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3b9ac048 mach_msg + 36
2 CoreFoundation 0x33815040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x33813d9e __CFRunLoopRun + 878
4 CoreFoundation 0x33786eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x33786d44 CFRunLoopRunInMode + 100
6 mCloud_iPhone 0x00415acc +[ASIHTTPRequest runRequests] (ASIHTTPRequest.m:4966)
7 Foundation 0x34156e80 __NSThread__main__ + 968
8 libsystem_c.dylib 0x3b91530e _pthread_start + 306
9 libsystem_c.dylib 0x3b9151d4 thread_start + 4
Thread 8 name: com.apple.NSURLConnectionLoader
Thread 8:
0 libsystem_kernel.dylib 0x3b9abeb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3b9ac048 mach_msg + 36
2 CoreFoundation 0x33815040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x33813d9e __CFRunLoopRun + 878
4 CoreFoundation 0x33786eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x33786d44 CFRunLoopRunInMode + 100
6 Foundation 0x340d33d0 +[NSURLConnection(Loader) _resourceLoadLoop:] + 304
7 Foundation 0x34156e80 __NSThread__main__ + 968
8 libsystem_c.dylib 0x3b91530e _pthread_start + 306
9 libsystem_c.dylib 0x3b9151d4 thread_start + 4
Thread 9 name: com.apple.CFSocket.private
Thread 9:
0 libsystem_kernel.dylib 0x3b9bc594 select$DARWIN_EXTSN + 20
1 CoreFoundation 0x338191f2 __CFSocketManager + 674
2 libsystem_c.dylib 0x3b91530e _pthread_start + 306
3 libsystem_c.dylib 0x3b9151d4 thread_start + 4
Thread 10:
0 libsystem_kernel.dylib 0x3b9abeb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3b9ac048 mach_msg + 36
2 CoreFoundation 0x33815040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x33813d9e __CFRunLoopRun + 878
4 CoreFoundation 0x33786eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x33786d44 CFRunLoopRunInMode + 100
6 Foundation 0x340a9f92 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 Foundation 0x3414d860 -[NSRunLoop(NSRunLoop) run] + 76
8 Foundation 0x34156e80 __NSThread__main__ + 968
9 libsystem_c.dylib 0x3b91530e _pthread_start + 306
10 libsystem_c.dylib 0x3b9151d4 thread_start + 4
Thread 11:
0 libsystem_kernel.dylib 0x3b9abeb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3b9ac048 mach_msg + 36
2 CoreFoundation 0x33815040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x33813d9e __CFRunLoopRun + 878
4 CoreFoundation 0x33786eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x33786d44 CFRunLoopRunInMode + 100
6 mCloud_iPhone 0x003ec330 -[FXThreadManager threadFunc:] (FXThreadManager.m:263)
7 Foundation 0x34156e80 __NSThread__main__ + 968
8 libsystem_c.dylib 0x3b91530e _pthread_start + 306
9 libsystem_c.dylib 0x3b9151d4 thread_start + 4
Thread 12:
0 libsystem_kernel.dylib 0x3b9abf04 semaphore_wait_trap + 8
1 libdispatch.dylib 0x3b8e482a _dispatch_semaphore_wait_slow + 178
2 TCC 0x38ef6682 TCCAccessPreflight + 218
3 AddressBook 0x32fbc048 ABAddressBookGetAuthorizationStatus + 4
4 mCloud_iPhone 0x00132116 -[AddrBookObject accessToContacts] (AddrBookObject.m:141)
5 mCloud_iPhone 0x00143fb8 -[ApnsManager isNotificationEnabled] (ApnsManager.m:96)
6 mCloud_iPhone 0x0010798a -[AddressBookManager queryAutoSynSwitchStateForServer] (AddressBookManager.m:1046)
7 mCloud_iPhone 0x00107876 __50-[AddressBookManager accessToTheServerSwitchState]_block_invoke (AddressBookManager.m:1008)
8 libdispatch.dylib 0x3b8d611c _dispatch_call_block_and_release + 8
9 libdispatch.dylib 0x3b8d5996 _dispatch_queue_drain$VARIANT$up + 142
10 libdispatch.dylib 0x3b8d5890 _dispatch_queue_invoke$VARIANT$up + 32
11 libdispatch.dylib 0x3b8e4212 _dispatch_root_queue_drain + 190
12 libdispatch.dylib 0x3b8e43b4 _dispatch_worker_thread2 + 80
13 libsystem_c.dylib 0x3b90aa0e _pthread_wqthread + 358
14 libsystem_c.dylib 0x3b90a8a0 start_wqthread + 4
Thread 13:
0 libsystem_kernel.dylib 0x3b9abeb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3b9ac048 mach_msg + 36
2 CoreFoundation 0x33815040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x33813d9e __CFRunLoopRun + 878
4 CoreFoundation 0x33786eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x33786d44 CFRunLoopRunInMode + 100
6 mCloud_iPhone 0x003ec330 -[FXThreadManager threadFunc:] (FXThreadManager.m:263)
7 Foundation 0x34156e80 __NSThread__main__ + 968
8 libsystem_c.dylib 0x3b91530e _pthread_start + 306
9 libsystem_c.dylib 0x3b9151d4 thread_start + 4
Thread 14 name: Dispatch queue: fmdb.<FMDatabaseQueue: 0x1fbdf850>
Thread 14:
0 libsystem_kernel.dylib 0x3b9ae898 pwrite + 20
1 libsqlite3.dylib 0x3b72e5c0 ___lldb_unnamed_function725$$libsqlite3.dylib + 44
2 libsqlite3.dylib 0x3b6eedc8 ___lldb_unnamed_function200$$libsqlite3.dylib + 52
3 libsqlite3.dylib 0x3b6ec332 ___lldb_unnamed_function190$$libsqlite3.dylib + 1106
4 libsqlite3.dylib 0x3b6ebed2 ___lldb_unnamed_function189$$libsqlite3.dylib + 574
5 libsqlite3.dylib 0x3b6ee126 ___lldb_unnamed_function195$$libsqlite3.dylib + 1150
6 libsqlite3.dylib 0x3b6da2ba ___lldb_unnamed_function124$$libsqlite3.dylib + 6986
7 libsqlite3.dylib 0x3b6d8482 sqlite3_step + 2138
8 mCloud_iPhone 0x00426fee -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] (FMDatabase.m:902)
9 mCloud_iPhone 0x00455e20 +[FXDatabaseOperator updateInTransaction:sql:] (FXDatabaseOperator.m:345)
10 mCloud_iPhone 0x00250d44 __41-[NDDatabaseManager updateTransferTasks:]_block_invoke_0 (NDDatabaseManager.m:2353)
11 mCloud_iPhone 0x00455bb8 __55+[FXDatabaseOperator doTransactionWithDBFileID:action:]_block_invoke (FXDatabaseOperator.m:307)
12 mCloud_iPhone 0x004533b4 __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke (FMDatabaseQueue.m:125)
13 libdispatch.dylib 0x3b8d54b4 _dispatch_client_callout + 20
14 libdispatch.dylib 0x3b8e390a _dispatch_barrier_sync_f_invoke + 22
15 mCloud_iPhone 0x00453286 -[FMDatabaseQueue beginTransaction:withBlock:] (FMDatabaseQueue.m:114)
16 mCloud_iPhone 0x0045353e -[FMDatabaseQueue inTransaction:] (FMDatabaseQueue.m:143)
17 mCloud_iPhone 0x00455a6e +[FXDatabaseOperator doTransactionWithDBFileID:action:] (FXDatabaseOperator.m:303)
18 mCloud_iPhone 0x0025071c -[NDDatabaseManager updateTransferTasks:] (NDDatabaseManager.m:2386)
19 mCloud_iPhone 0x002b14ae __50-[NDTransTaskDataManager startAllAutoPausedTasks:]_block_invoke_0 (NDTransTaskDataManager.m:1212)
20 libdispatch.dylib 0x3b8d611c _dispatch_call_block_and_release + 8
21 libdispatch.dylib 0x3b8e4254 _dispatch_root_queue_drain + 256
22 libdispatch.dylib 0x3b8e43b4 _dispatch_worker_thread2 + 80
23 libsystem_c.dylib 0x3b90aa0e _pthread_wqthread + 358
24 libsystem_c.dylib 0x3b90a8a0 start_wqthread + 4
Unknown thread crashed with unknown flavor: 5, state_count: 1
0x8badf00d: Reads as “ate bad food”! (If you squint your eyes and replace the digits with alphabetic characters. :p) This code indicates that an application was terminated by iOS because a watchdog timeout occurred. Basically, the application took too long to launch, terminate, or respond to system events.
http://www.raywenderlich.com/19788

App "failed to resume in time" and hangs

My app runs fine on my ipad but when I run it on my bosses ipad it hangs and stores the following device log, any ideas?
Incident Identifier: 6C33511B-7C9A-474C-B888-84A4FAFF6F91
CrashReporter Key: 93bbba4f690eb1b7638fa7a09a3ff3aa4e6872f4 Hardware
Model: iPad2,1 Process: Designer [5279] Path:
/var/mobile/Applications/7AA5BF4A-007D-47F8-B1C5-30667477AA12/Designer.app/Designer
Identifier: Designer Version: ??? (???) Code Type:
ARM (Native) Parent Process: launchd [1]
Date/Time: 2011-10-19 13:29:29.907 +0100 OS Version: iPhone
OS 5.0 (9A334) Report Version: 104
Exception Type: 00000020 Exception Codes: 0x8badf00d Highlighted
Thread: 0
Application Specific Information: Systems.Designer failed to resume in
time
Elapsed total CPU time (seconds): 0.000 (user 0.000, system 0.000), 0%
CPU Elapsed application CPU time (seconds): 0.002, 0% CPU
Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0: 0
libsystem_c.dylib 0x307d1a3c memset$VARIANT$CortexA9 +
100 1 libsqlite3.dylib 0x36cd3e7e 0x36cbf000 + 85630 2
libsqlite3.dylib 0x36cc73ec 0x36cbf000 + 33772 3
libsqlite3.dylib 0x36cc6c78 0x36cbf000 + 31864 4
libsqlite3.dylib 0x36cc64a8 0x36cbf000 + 29864 5
libsqlite3.dylib 0x36cc5f92 0x36cbf000 + 28562 6
libsqlite3.dylib 0x36cc5ce8 0x36cbf000 + 27880 7
libsqlite3.dylib 0x36cd29ea 0x36cbf000 + 80362 8
libsqlite3.dylib 0x36cc5962 sqlite3_exec + 678 9
libsqlite3.dylib 0x36cd273a 0x36cbf000 + 79674 10
libsqlite3.dylib 0x36cd228e 0x36cbf000 + 78478 11
libsqlite3.dylib 0x36cceebe 0x36cbf000 + 65214 12
libsqlite3.dylib 0x36ccb41a 0x36cbf000 + 50202 13
libsqlite3.dylib 0x36cc6c78 0x36cbf000 + 31864 14
libsqlite3.dylib 0x36cc6464 0x36cbf000 + 29796 15
libsqlite3.dylib 0x36cc5f92 0x36cbf000 + 28562 16
libsqlite3.dylib 0x36cc5ce8 0x36cbf000 + 27880 17
libsqlite3.dylib 0x36cfd094 sqlite3_prepare_v2 + 20 18
AppSupport 0x36efb8a4 CPSqlitePreparedStatement +
40 19 AppSupport 0x36efbbde
CPSqliteConnectionStatementForSQLAndIgnoreErrors + 114 20 AppSupport
0x36efc64e CPSqliteConnectionPerformSQL + 6 21 AppSupport
0x36efca44 _createConnectionForWriting + 360 22 AppSupport
0x36efcc06 _connectAndCheckVersion + 18 23 AppSupport
0x36efd0b8 CPSqliteDatabaseConnectionForWriting + 36 24 AppSupport
0x36efd18e CPSqliteDatabaseRegisterFunction + 14 25 AddressBook
0x324db6dc ABCDBContextCreateWithPathAndAddressBook + 208 26
AddressBook 0x324cf6fa
ABCCreateAddressBookWithDatabaseDirectoryAndForceInProcessMigrationInProcessLinkingAndResetSortKeys
+ 226 27 AddressBook 0x324ddf88 ABAddressBookCreate + 8 28 Designer 0x000e222c
+[AddressBookModel createTableViewControllerItemFromABRecordID:] (AddressBookModel.m:15) 29 Designer 0x000e1ee0
-[CustomPersonPickerViewController getAllContacts] (CustomPersonPickerViewController.m:56) 30 Designer
0x000e1d9c -[CustomPersonPickerViewController
initWithSelectedABRecordID:andSelectAnItemViewDelegate:]
(CustomPersonPickerViewController.m:28) 31 Designer
0x000dce56 -[EditEntityViewController editAccountable:]
(EditEntityViewController.m:96) 32 CoreFoundation
0x3522442e -[NSObject performSelector:withObject:withObject:] + 46 33
UIKit 0x375d19e4 -[UIApplication
sendAction:to:from:forEvent:] + 56 34 UIKit
0x375d19a0 -[UIApplication sendAction:toTarget:fromSender:forEvent:]
+ 24 35 UIKit 0x375d197e -[UIControl sendAction:to:forEvent:] + 38 36 UIKit
0x375d16ee -[UIControl(Internal) _sendActionsForEvents:withEvent:] +
486 37 UIKit 0x375d131a -[UIControl
touchesBegan:withEvent:] + 238 38 UIKit
0x375d047e -[UIWindow _sendTouchesForEvent:] + 174 39 UIKit
0x375cfefa -[UIWindow sendEvent:] + 374 40 UIKit
0x375b64e6 -[UIApplication sendEvent:] + 350 41 UIKit
0x375b5d26 _UIApplicationHandleEvent + 5802 42 GraphicsServices
0x31d0be0c PurpleEventCallback + 876 43 CoreFoundation
0x3529e54c CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION
+ 32 44 CoreFoundation 0x3529e4ee __CFRunLoopDoSource1 + 134 45 CoreFoundation 0x3529d33c __CFRunLoopRun + 1364 46 CoreFoundation
0x352204d6 CFRunLoopRunSpecific + 294 47 CoreFoundation
0x3522039e CFRunLoopRunInMode + 98 48 GraphicsServices
0x31d0afe6 GSEventRunModal + 150 49 UIKit
0x375e473c UIApplicationMain + 1084 50 Designer
0x000d4854 main (main.m:14) 51 Designer 0x000d480c
0xd3000 + 6156
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager Thread
1: 0 libsystem_kernel.dylib 0x303ff3b4 kevent + 24 1
libdispatch.dylib 0x35b5ef74 _dispatch_mgr_invoke + 708 2
libdispatch.dylib 0x35b5ec92 _dispatch_mgr_thread + 30
Thread 2 name: WebThread Thread 2: 0 libsystem_kernel.dylib
0x3040f0d8 psynch_mutexwait + 24 1 libsystem_c.dylib
0x3075ec44 pthread_mutex_lock + 376 2 WebCore
0x362f536c _ZL17_WebTryThreadLockb + 208 3 WebCore
0x362f5670 ZL14WebRunLoopLockP19_CFRunLoopObservermPv + 24 4
CoreFoundation 0x3529eb44
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 12 5 CoreFoundation 0x3529cd80 __CFRunLoopDoObservers + 252
6 CoreFoundation 0x3529d19a __CFRunLoopRun + 946 7
CoreFoundation 0x352204d6 CFRunLoopRunSpecific + 294 8
CoreFoundation 0x3522039e CFRunLoopRunInMode + 98 9
WebCore 0x36397128 _ZL12RunWebThreadPv + 396 10
libsystem_c.dylib 0x3076bc16 _pthread_start + 314 11
libsystem_c.dylib 0x3076bad0 thread_start + 0
Unknown thread crashed with unknown flavor: 5, state_count: 1
Whenever you see a 0x8badf00d that means you are getting killed by the launch watchdog. Your app is taking too long to return from -applicationDidFinishLaunching.... Normal Core Data related causes to this are:
Trying to import data in the -applicationDidFinishLaunching...
Trying to perform a migration from -applicationDidFinishLaunching...
To solve this you need to change your start up. The creating of the Core Data stack should never be done in the -applicationDidFinishLaunching.... Instead let the -applicationDidFinishLaunching... finish and then stand up the Core Data stack. If a migration is needed (you can check this pretty easily) then present the user with a UI informing them of the delay and then kick it off.
In either case you need to return from the -applicationDidFinishLaunching... as fast as possible, you should only be creating UI elements in this method; you should not be accessing Core Data at this point.