Resolving iOS app crash in distribution build - ios

I have submitted an app to the app store, and after the review, the app has been rejected. This is the explanation sent by Apple:
Specifically, after downloading the latest version submitted for review, Version 2.1, we found that when the user taps on the map icon, the app still crashes.
This occurred when your app was used:
- Offline
- On Wi-Fi
- On cellular network
I am not able to detect the issue then during development and testing the app on the emulator and on a real device, the app doesn't crash.
This is the first part of the crash report:
{"app_name":"mujergrancanaria","app_version":"2.0","bundleID":"com.solinpromex.casadelajuventud","adam_id":946142349,"os_version":"iPhone OS 8.1 (12B410)","slice_uuid":"601d3ebb-53d8-39ff-8766-badaadb4f776","share_with_app_devs":false,"build_version":"2.1","is_first_party":false,"bug_type":"109","name":"mujergrancanaria"}
Incident Identifier: 02C4277A-3657-4CFF-9A5D-8A3B34E1ACE4
CrashReporter Key: 34094a2f9cf3e1e29a81d365a85a102af46a1edc
Hardware Model: xxx
Process: mujergrancanaria [4557]
Path: /private/var/mobile/Containers/Bundle/Application/67EFD456-E179-4049-B1A6-FBBF6D6144E4/mujergrancanaria.app/mujergrancanaria
Identifier: com.solinpromex.casadelajuventud
Version: 2.1 (2.0)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Date/Time: 2015-01-09 14:46:52.869 -0800
Launch Time: 2015-01-09 14:46:38.934 -0800
OS Version: iOS 8.1 (12B410)
Report Version: 105
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
(0x186b85e48 0x1977d40e4 0x186b8cf14 0x186b89cc4 0x186a8ec1c 0x10025f1bc 0x10025dc38 0x10025d03c 0x10025ced4 0x1000eb240 0x18b334e84 0x18b334b94 0x18b4d7ad4 0x18b3e9310 0x18b3e90dc 0x18b3e905c 0x18b331a2c 0x18ac89994 0x18ac84564 0x18ac84408 0x18ac83c08 0x18ac8398c 0x18b333948 0x186b3e0e8 0x186b3d38c 0x186b3b43c 0x186a691f4 0x18fbe35a4 0x18b39a784 0x1000d2a40 0x197e42a08)
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000197f5b270 __pthread_kill + 8
1 libsystem_pthread.dylib 0x0000000197ff9224 pthread_kill + 108
2 libsystem_c.dylib 0x0000000197ed2b14 abort + 108
3 libc++abi.dylib 0x0000000196fa5414 abort_message + 112
4 libc++abi.dylib 0x0000000196fc4b88 default_terminate_handler() + 300
5 libobjc.A.dylib 0x00000001977d43bc _objc_terminate() + 124
6 libc++abi.dylib 0x0000000196fc1bb0 std::__terminate(void (*)()) + 12
7 libc++abi.dylib 0x0000000196fc1474 __cxa_throw + 132
8 libobjc.A.dylib 0x00000001977d4200 objc_exception_throw + 344
9 CoreFoundation 0x0000000186b8cf10 -[NSObject(NSObject) doesNotRecognizeSelector:] + 216
10 CoreFoundation 0x0000000186b89cc0 ___forwarding___ + 924
11 CoreFoundation 0x0000000186a8ec18 _CF_forwarding_prep_0 + 88
12 mujergrancanaria 0x000000010025f1b8 0x1000ac000 + 1782200
13 mujergrancanaria 0x000000010025dc34 0x1000ac000 + 1776692
14 mujergrancanaria 0x000000010025d038 0x1000ac000 + 1773624
15 mujergrancanaria 0x000000010025ced0 0x1000ac000 + 1773264
16 mujergrancanaria 0x00000001000eb23c 0x1000ac000 + 258620
17 UIKit 0x000000018b334e80 -[UIViewController loadViewIfRequired] + 688
18 UIKit 0x000000018b334b90 -[UIViewController view] + 28
19 UIKit 0x000000018b4d7ad0 -[UINavigationController _startCustomTransition:] + 708
20 UIKit 0x000000018b3e930c -[UINavigationController _startDeferredTransitionIfNeeded:] + 464
21 UIKit 0x000000018b3e90d8 -[UINavigationController __viewWillLayoutSubviews] + 52
22 UIKit 0x000000018b3e9058 -[UILayoutContainerView layoutSubviews] + 196
23 UIKit 0x000000018b331a28 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 568
24 QuartzCore 0x000000018ac89990 -[CALayer layoutSublayers] + 164
25 QuartzCore 0x000000018ac84560 CA::Layer::layout_if_needed(CA::Transaction*) + 316
26 QuartzCore 0x000000018ac84404 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 28
27 QuartzCore 0x000000018ac83c04 CA::Context::commit_transaction(CA::Transaction*) + 272
28 QuartzCore 0x000000018ac83988 CA::Transaction::commit() + 432
29 UIKit 0x000000018b333944 _UIApplicationHandleEventQueue + 1696
30 CoreFoundation 0x0000000186b3e0e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 20
31 CoreFoundation 0x0000000186b3d388 __CFRunLoopDoSources0 + 260
32 CoreFoundation 0x0000000186b3b438 __CFRunLoopRun + 708
33 CoreFoundation 0x0000000186a691f0 CFRunLoopRunSpecific + 392
34 GraphicsServices 0x000000018fbe35a0 GSEventRunModal + 164
35 UIKit 0x000000018b39a780 UIApplicationMain + 1484
36 mujergrancanaria 0x00000001000d2a3c 0x1000ac000 + 158268
37 libdyld.dylib 0x0000000197e42a04 start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x0000000197f40c94 kevent64 + 8
1 libdispatch.dylib 0x0000000197e2897c _dispatch_mgr_invoke + 272
2 libdispatch.dylib 0x0000000197e1b3b0 _dispatch_mgr_thread + 48
Thread 2:
0 libsystem_kernel.dylib 0x0000000197f5bc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000197ff5390 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x0000000197ff4fa4 start_wqthread + 0
Thread 3:
0 libsystem_kernel.dylib 0x0000000197f5bc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000197ff5390 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x0000000197ff4fa4 start_wqthread + 0
Thread 4:
0 libsystem_kernel.dylib 0x0000000197f5bc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000197ff5390 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x0000000197ff4fa4 start_wqthread + 0
Thread 5 name: com.apple.NSURLConnectionLoader
Thread 5:
0 libsystem_kernel.dylib 0x0000000197f40e7c mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000197f40cf4 mach_msg + 68
2 CoreFoundation 0x0000000186b3d5c8 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x0000000186b3b51c __CFRunLoopRun + 936
4 CoreFoundation 0x0000000186a691f0 CFRunLoopRunSpecific + 392
5 CFNetwork 0x000000018656d6a0 +[NSURLConnection(Loader) _resourceLoadLoop:] + 436
6 Foundation 0x0000000187a55c08 __NSThread__main__ + 1068
7 libsystem_pthread.dylib 0x0000000197ff7e7c _pthread_body + 160
8 libsystem_pthread.dylib 0x0000000197ff7dd8 _pthread_start + 156
9 libsystem_pthread.dylib 0x0000000197ff4fac thread_start + 0
Thread 6:
0 libsystem_kernel.dylib 0x0000000197f5bc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000197ff5390 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x0000000197ff4fa4 start_wqthread + 0
Thread 7 name: com.apple.CFSocket.private
Thread 7:
0 libsystem_kernel.dylib 0x0000000197f5b498 __select + 8
1 CoreFoundation 0x0000000186b42fc0 __CFSocketManager + 656
2 libsystem_pthread.dylib 0x0000000197ff7e7c _pthread_body + 160
3 libsystem_pthread.dylib 0x0000000197ff7dd8 _pthread_start + 156
4 libsystem_pthread.dylib 0x0000000197ff4fac thread_start + 0
Thread 8:
0 libsystem_kernel.dylib 0x0000000197f5bc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000197ff5390 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x0000000197ff4fa4 start_wqthread + 0
I am unable to find where to begin to find out the crash source. Please, any clue is welcome.

You are going to want to symbolicate your crash log. In your code this is where the crash is happening
12 mujergrancanaria 0x000000010025f1b8 0x1000ac000 + 1782200
There are a number of posts about how to symbolicate this so that you can know which file and line that crash is happening on. Generally all you need to do is open Xcode, then open Devices (from the menu), then select a real device, click on view device logs, and then drag your log into the list. Xcode will automatically find the binary and dsym file from when you created the archive (assuming this is the same machine you build the archive on). If that doesn't work look at this Symbolicating iPhone App Crash Reports

Ok so, it's map related and review team are in Palo Alto California I think (correct me if I'm wrong).
So I would definitly start by testing with location set in simulator in Palo Alto.
Next, the log.
A big part is redacted
12 mujergrancanaria 0x000000010025f1b8 0x1000ac000 + 1782200
13 mujergrancanaria 0x000000010025dc34 0x1000ac000 + 1776692
14 mujergrancanaria 0x000000010025d038 0x1000ac000 + 1773624
15 mujergrancanaria 0x000000010025ced0 0x1000ac000 + 1773264
16 mujergrancanaria 0x00000001000eb23c 0x1000ac000 + 258620
Meaning you need to put it in Xcode or another tool where you can use the DSym (symbole file created during archiving of the app) to exploit it.
Without it what I can tell you is that this line in the stack :
-[NSObject(NSObject) doesNotRecognizeSelector:]
Means your are calling a non existing method on an object.

The app crash reason was a missing flag in the Other Linker Flags section. The app includes the Google Maps SDK for iOS, and the flag -ObjC is needed. I had it only at the Debug Build section. Adding the flag -ObjC also in the Release Build section solves the problem, and the app doesn't crash any more when launching the Distribution file...

Related

Crash :com.apple.network.connections EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000036

Since the release of iOS16.1.0 and iOS16.1.1, I have received reports from iOS16.1.0 and iOS16.1.1 users about the crash problem. Later, I discovered that this problem occurred only iOS16.1.0 and later. This problem does not occur to all users ,I have tried several methods (such as using different versions of xcode build App), but still not solved...
Here are the crash track caught by firebase:
Crash :com.apple.network.connections EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000036
Crashed: com.apple.network.connections
0 libxpc.dylib 0x16020 _xpc_dictionary_insert + 96
1 Network 0x908504 nw_path_snapshot_agents + 292
2 Network 0x907960 nw_path_snapshot_path + 192
3 Network 0x9257b8 nw_path_necp_update_evaluator + 756
4 Network 0x924aa4 nw_path_necp_check_for_updates + 1268
5 libdispatch.dylib 0x3fdc _dispatch_client_callout + 20
6 libdispatch.dylib 0x746c _dispatch_continuation_pop + 504
7 libdispatch.dylib 0x1aa58 _dispatch_source_invoke + 1588
8 libdispatch.dylib 0xd4f8 _dispatch_workloop_invoke + 1780
9 libdispatch.dylib 0x16e10 _dispatch_workloop_worker_thread + 652
10 libsystem_pthread.dylib 0xdf8 _pthread_wqthread + 288
11 libsystem_pthread.dylib 0xb98 start_wqthread + 8
com.apple.main-thread
0 libsystem_kernel.dylib 0xb48 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x13008 mach_msg2_internal + 80
2 libsystem_kernel.dylib 0x13248 mach_msg_overwrite + 388
3 libsystem_kernel.dylib 0x108c mach_msg + 24
4 CoreFoundation 0x7aaf0 __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x7bd34 __CFRunLoopRun + 1232
6 CoreFoundation 0x80ed4 CFRunLoopRunSpecific + 612
7 GraphicsServices 0x1368 GSEventRunModal + 164
8 UIKitCore 0x3a23d0 -[UIApplication _run] + 888
9 UIKitCore 0x3a2034 UIApplicationMain + 340
10 xxxxxx 0x44ea24 main + 14 (main.m:14)
11 ??? 0x1d6e8c960 (缺少)
other thread ......

iOS app weird crash in background

I need help.
I'm working on an old iOS app written in Objective-c. It was released in 2014 and now I have migrated the project to Xcode 8. After migration everything works as expected except weird crash when app is in background(not immediately but after some time). It's hard to debug because crash occurs only when device is disconnected from Xcode. I have checked device logs and it seems like it's core data crash:
Incident Identifier: BDD70C46-6573-44A7-85AB-620E6FBA207F
CrashReporter Key: c04f591f9e0cc9d1991ce10e33ebcabd56affbe6
Hardware Model: iPhone8,4
Process: myApp [17746]
Path: /private/var/containers/Bundle/Application/878DB803-1DA5-46D7-8B50-655D43A5C28D/myApp.app/myApp
Identifier: com.example.myApp
Version: 2 (1.0.2)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.example.myApp [16959]
Date/Time: 2017-09-19 14:34:57.1435 +0300
Launch Time: 2017-09-19 14:31:38.0853 +0300
OS Version: iPhone OS 10.3.3 (14G60)
Report Version: 104
Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace <0xF>, Code 0x8badf00d
Triggered by Thread: 0
Filtered syslog:
None found
Thread 0 name: Dispatch queue: SQLQueue 0x100724310 for myApp.sqlite
Thread 0 Crashed:
0 libsqlite3.dylib 0x000000018f36d818 0x18f361000 + 51224
1 libsqlite3.dylib 0x000000018f36c9a4 0x18f361000 + 47524
2 libsqlite3.dylib 0x000000018f36c9a4 0x18f361000 + 47524
3 libsqlite3.dylib 0x000000018f36c2c4 0x18f361000 + 45764
4 libsqlite3.dylib 0x000000018f36bf24 0x18f361000 + 44836
5 CoreData 0x000000019113e0b0 -[NSSQLiteConnection prepareSQLStatement:] + 468
6 CoreData 0x000000019125f178 -[NSSQLiteConnection updateRow:forRequestContext:] + 492
7 CoreData 0x0000000191307f28 _writeChangesForSaveRequest + 1128
8 CoreData 0x0000000191309584 _executeSaveChangesRequest + 388
9 CoreData 0x00000001912ff5f0 -[NSSQLSaveChangesRequestContext executeRequestUsingConnection:] + 44
10 CoreData 0x00000001912170c4 __52-[NSSQLDefaultConnectionManager handleStoreRequest:]_block_invoke + 256
11 libdispatch.dylib 0x0000000100455a10 0x100454000 + 6672
12 libdispatch.dylib 0x00000001004625bc 0x100454000 + 58812
13 CoreData 0x0000000191216f64 -[NSSQLDefaultConnectionManager handleStoreRequest:] + 208
14 CoreData 0x00000001912d9824 -[NSSQLCoreDispatchManager routeStoreRequest:] + 272
15 CoreData 0x000000019124475c -[NSSQLCore dispatchRequest:withRetries:] + 236
16 CoreData 0x0000000191240578 -[NSSQLCore processSaveChanges:forContext:] + 200
17 CoreData 0x0000000191144f10 -[NSSQLCore executeRequest:withContext:error:] + 724
18 CoreData 0x000000019122384c __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke + 3492
19 CoreData 0x000000019121c0f0 -[NSPersistentStoreCoordinator _routeHeavyweightBlock:] + 276
20 CoreData 0x0000000191144adc -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 408
21 CoreData 0x000000019116597c -[NSManagedObjectContext save:] + 2548
22 myApp 0x00000001000cd0dc 0x1000c0000 + 53468
23 myApp 0x00000001000cbc24 0x1000c0000 + 48164
24 CoreLocation 0x00000001970ee828 0x1970de000 + 67624
25 CoreLocation 0x00000001970edfcc 0x1970de000 + 65484
26 CoreLocation 0x00000001970e11d8 0x1970de000 + 12760
27 CoreFoundation 0x000000018ee1930c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
28 CoreFoundation 0x000000018ee18b28 __CFRunLoopDoBlocks + 288
29 CoreFoundation 0x000000018ee16e1c __CFRunLoopRun + 1884
30 CoreFoundation 0x000000018ed46da4 CFRunLoopRunSpecific + 424
31 GraphicsServices 0x00000001907b1074 GSEventRunModal + 100
32 UIKit 0x0000000195001c9c UIApplicationMain + 208
33 myApp 0x00000001000e4574 0x1000c0000 + 148852
34 libdyld.dylib 0x000000018dd5559c start + 4
Thread 1 name: Dispatch queue: BKSProcessAssertionClient
Thread 1:
0 libsystem_kernel.dylib 0x000000018de47224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018de4709c mach_msg + 72
2 libdispatch.dylib 0x000000010046d37c 0x100454000 + 103292
3 libdispatch.dylib 0x000000010046d780 0x100454000 + 104320
4 libxpc.dylib 0x000000018df60edc xpc_connection_send_message_with_reply_sync + 196
5 BaseBoard 0x000000019095a944 -[BSXPCMessage sendSynchronouslyToConnection:error:] + 76
6 BaseBoard 0x0000000190957148 -[BSBaseXPCClient _sendMessage:withReplyHandler:waitForReply:waitDuration:] + 436
7 AssertionServices 0x00000001909a17c4 -[BKSProcessAssertionClient _assertionQueue_sendEvent:forMessageType:responseHandler:] + 136
8 AssertionServices 0x00000001909a0f78 -[BKSProcessAssertionClient sendCreateAssertion:] + 108
9 AssertionServices 0x00000001909a0968 -[BKSProcessAssertion _clientQueue_acquireAssertion] + 312
10 libdispatch.dylib 0x0000000100455a50 0x100454000 + 6736
11 libdispatch.dylib 0x0000000100455a10 0x100454000 + 6672
12 libdispatch.dylib 0x00000001004632e8 0x100454000 + 62184
13 libdispatch.dylib 0x0000000100459634 0x100454000 + 22068
14 libdispatch.dylib 0x0000000100465630 0x100454000 + 71216
15 libdispatch.dylib 0x000000010046539c 0x100454000 + 70556
16 libsystem_pthread.dylib 0x000000018df2b100 _pthread_wqthread + 1096
17 libsystem_pthread.dylib 0x000000018df2acac start_wqthread + 4
Thread 2 name: Dispatch queue: com.apple.CoreLocation.ConnectionClient.0x17013b6c0.events
Thread 2:
0 libsystem_kernel.dylib 0x000000018de47278 semaphore_timedwait_trap + 8
1 libdispatch.dylib 0x000000010047f238 0x100454000 + 176696
2 libdispatch.dylib 0x0000000100467db8 0x100454000 + 81336
3 CoreLocation 0x00000001970e1078 0x1970de000 + 12408
4 CoreLocation 0x00000001970e6118 0x1970de000 + 33048
5 CoreLocation 0x00000001970e5f18 0x1970de000 + 32536
6 CoreLocation 0x0000000197131e88 0x1970de000 + 343688
7 CoreLocation 0x000000019712e4f0 0x1970de000 + 328944
8 CoreLocation 0x000000019712e414 0x1970de000 + 328724
9 CoreLocation 0x000000019712fa80 0x1970de000 + 334464
10 libxpc.dylib 0x000000018df5f84c _xpc_connection_call_event_handler + 68
11 libxpc.dylib 0x000000018df5d358 _xpc_connection_mach_event + 1448
12 libdispatch.dylib 0x0000000100455ae0 0x100454000 + 6880
13 libdispatch.dylib 0x00000001004599d8 0x100454000 + 23000
14 libdispatch.dylib 0x0000000100463128 0x100454000 + 61736
15 libdispatch.dylib 0x0000000100458da0 0x100454000 + 19872
16 libdispatch.dylib 0x0000000100463128 0x100454000 + 61736
17 libdispatch.dylib 0x0000000100459634 0x100454000 + 22068
18 libdispatch.dylib 0x0000000100463128 0x100454000 + 61736
19 libdispatch.dylib 0x0000000100459634 0x100454000 + 22068
20 libdispatch.dylib 0x0000000100464358 0x100454000 + 66392
21 libdispatch.dylib 0x000000010046c57c 0x100454000 + 99708
22 libsystem_pthread.dylib 0x000000018df2afbc _pthread_wqthread + 772
23 libsystem_pthread.dylib 0x000000018df2acac start_wqthread + 4
Thread 3 name: com.apple.uikit.eventfetch-thread
Thread 3:
0 libsystem_kernel.dylib 0x000000018de47224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018de4709c mach_msg + 72
2 CoreFoundation 0x000000018ee18e90 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x000000018ee16ae4 __CFRunLoopRun + 1060
4 CoreFoundation 0x000000018ed46da4 CFRunLoopRunSpecific + 424
5 Foundation 0x000000018f861db4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6 Foundation 0x000000018f882b84 -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
7 UIKit 0x000000019598b830 -[UIEventFetcher threadMain] + 136
8 Foundation 0x000000018f95f318 __NSThread__start__ + 996
9 libsystem_pthread.dylib 0x000000018df2d68c _pthread_body + 240
10 libsystem_pthread.dylib 0x000000018df2d59c _pthread_body + 0
11 libsystem_pthread.dylib 0x000000018df2acb4 thread_start + 4
Thread 4:
0 libsystem_pthread.dylib 0x000000018df2aca8 start_wqthread + 0
Thread 5 name: com.apple.NSURLConnectionLoader
Thread 5:
0 libsystem_kernel.dylib 0x000000018de47224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018de4709c mach_msg + 72
2 CoreFoundation 0x000000018ee18e90 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x000000018ee16ae4 __CFRunLoopRun + 1060
4 CoreFoundation 0x000000018ed46da4 CFRunLoopRunSpecific + 424
5 CFNetwork 0x000000018f553df4 +[NSURLConnection(Loader) _resourceLoadLoop:] + 404
6 Foundation 0x000000018f95f318 __NSThread__start__ + 996
7 libsystem_pthread.dylib 0x000000018df2d68c _pthread_body + 240
8 libsystem_pthread.dylib 0x000000018df2d59c _pthread_body + 0
9 libsystem_pthread.dylib 0x000000018df2acb4 thread_start + 4
Thread 6 name: GAIThread
Thread 6:
0 libsystem_kernel.dylib 0x000000018de47224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018de4709c mach_msg + 72
2 CoreFoundation 0x000000018ee18e90 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x000000018ee16ae4 __CFRunLoopRun + 1060
4 CoreFoundation 0x000000018ed46da4 CFRunLoopRunSpecific + 424
5 Foundation 0x000000018f861db4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6 Foundation 0x000000018f8b6704 -[NSRunLoop(NSRunLoop) run] + 88
7 myApp 0x0000000100120398 0x1000c0000 + 394136
8 Foundation 0x000000018f95f318 __NSThread__start__ + 996
9 libsystem_pthread.dylib 0x000000018df2d68c _pthread_body + 240
10 libsystem_pthread.dylib 0x000000018df2d59c _pthread_body + 0
11 libsystem_pthread.dylib 0x000000018df2acb4 thread_start + 4
Thread 7:
0 libsystem_pthread.dylib 0x000000018df2aca8 start_wqthread + 0
Thread 8:
0 libsystem_pthread.dylib 0x000000018df2aca8 start_wqthread + 0
But in major cases crash report looks like:
Incident Identifier: D5D6C3C6-7EB7-4E2C-901C-7203943BD722
CrashReporter Key: c04f591f9e0cc9d1991ce10e33ebcabd56affbe6
Hardware Model: iPhone8,4
Process: myApp [17444]
Path: /private/var/containers/Bundle/Application/93AB2A15-0C65-47D5-BE24-FB298DC396E0/myApp.app/myApp
Identifier: com.example.myApp
Version: 2 (1.0.2)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.example.myApp [16449]
Date/Time: 2017-09-19 12:41:45.3051 +0300
Launch Time: 2017-09-19 12:24:22.7861 +0300
OS Version: iPhone OS 10.3.3 (14G60)
Report Version: 104
Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace <0xF>, Code 0x8badf00d
Triggered by Thread: 0
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018de47224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018de4709c mach_msg + 72
2 CoreFoundation 0x000000018ee18e90 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x000000018ee16ae4 __CFRunLoopRun + 1060
4 CoreFoundation 0x000000018ed46da4 CFRunLoopRunSpecific + 424
5 GraphicsServices 0x00000001907b1074 GSEventRunModal + 100
6 UIKit 0x0000000195001c9c UIApplicationMain + 208
7 myApp 0x0000000100031bb8 0x10000c000 + 154552
8 libdyld.dylib 0x000000018dd5559c start + 4
Thread 1 name: com.apple.uikit.eventfetch-thread
Thread 1:
0 libsystem_kernel.dylib 0x000000018de47224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018de4709c mach_msg + 72
2 CoreFoundation 0x000000018ee18e90 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x000000018ee16ae4 __CFRunLoopRun + 1060
4 CoreFoundation 0x000000018ed46da4 CFRunLoopRunSpecific + 424
5 Foundation 0x000000018f861db4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6 Foundation 0x000000018f882b84 -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
7 UIKit 0x000000019598b830 -[UIEventFetcher threadMain] + 136
8 Foundation 0x000000018f95f318 __NSThread__start__ + 996
9 libsystem_pthread.dylib 0x000000018df2d68c _pthread_body + 240
10 libsystem_pthread.dylib 0x000000018df2d59c _pthread_body + 0
11 libsystem_pthread.dylib 0x000000018df2acb4 thread_start + 4
Thread 2 name: com.twitter.crashlytics.ios.MachExceptionServer
Thread 2:
0 libsystem_kernel.dylib 0x000000018de47224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018de4709c mach_msg + 72
2 myApp 0x000000010008d6a0 0x10000c000 + 530080
3 libsystem_pthread.dylib 0x000000018df2d68c _pthread_body + 240
4 libsystem_pthread.dylib 0x000000018df2d59c _pthread_body + 0
5 libsystem_pthread.dylib 0x000000018df2acb4 thread_start + 4
Thread 3 name: com.apple.NSURLConnectionLoader
Thread 3:
0 libsystem_kernel.dylib 0x000000018de47224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018de4709c mach_msg + 72
2 CoreFoundation 0x000000018ee18e90 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x000000018ee16ae4 __CFRunLoopRun + 1060
4 CoreFoundation 0x000000018ed46da4 CFRunLoopRunSpecific + 424
5 CFNetwork 0x000000018f553df4 +[NSURLConnection(Loader) _resourceLoadLoop:] + 404
6 Foundation 0x000000018f95f318 __NSThread__start__ + 996
7 libsystem_pthread.dylib 0x000000018df2d68c _pthread_body + 240
8 libsystem_pthread.dylib 0x000000018df2d59c _pthread_body + 0
9 libsystem_pthread.dylib 0x000000018df2acb4 thread_start + 4
Thread 4 name: GAIThread
Thread 4:
0 libsystem_kernel.dylib 0x000000018de47224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018de4709c mach_msg + 72
2 CoreFoundation 0x000000018ee18e90 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x000000018ee16ae4 __CFRunLoopRun + 1060
4 CoreFoundation 0x000000018ed46da4 CFRunLoopRunSpecific + 424
5 Foundation 0x000000018f861db4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6 Foundation 0x000000018f8b6704 -[NSRunLoop(NSRunLoop) run] + 88
7 myApp 0x000000010006d9dc 0x10000c000 + 399836
8 Foundation 0x000000018f95f318 __NSThread__start__ + 996
9 libsystem_pthread.dylib 0x000000018df2d68c _pthread_body + 240
10 libsystem_pthread.dylib 0x000000018df2d59c _pthread_body + 0
11 libsystem_pthread.dylib 0x000000018df2acb4 thread_start + 4
Thread 5:
0 libsystem_pthread.dylib 0x000000018df2aca8 start_wqthread + 0
Thread 6:
0 libsystem_pthread.dylib 0x000000018df2aca8 start_wqthread + 0
Thread 7:
0 libsystem_pthread.dylib 0x000000018df2aca8 start_wqthread + 0
Thread 8:
0 libsystem_pthread.dylib 0x000000018df2aca8 start_wqthread + 0
Thread 9:
0 libsystem_pthread.dylib 0x000000018df2aca8 start_wqthread + 0
Maybe someone had a similar issue and have some suggestions?
One thing that's odd is that you say this happens in the background, but the crashes are happening when the app is in the foreground as far as the system is concerned:
Role: Foreground
So, that's confusing.
Just wild guessing, I'd look at things like memory corruption/using released objects (especially if this is non-ARC code), async code like networking requests or timer callbacks jumping into released code, doing things like UI on a thread that's not the main thread (if you can run under Xcode 9, the runtime thread diagnostics will help a lot with this.) Even with Xc8, look at your project's scheme and the memory debugging options available under the Run configuration. Those could help.
Check out the running system log on the device. You don't need to be debugging with Xcode to see that. Just go to the Devices window and the system console will be near the bottom. You may need to reveal it. That system log may give a clue.
If you're using manual retain/release, double check any code that gets hit in the time frame of the crash. Keep in mind that those types of crashes happen after the problem occurs, so where you see the crash may have little bearing on where the actual problem is, and the crash location may fluctuate, especially on different devices.
Maybe diff the pre-Xcode 8 code and the current code to double-check any changes you've made. My guess is that you introduced a memory issue when updating the code for Xcode 8.
UPDATE:
Sorry, just noticed the termination reason.
This may help:
The exception code 0x8badf00d indicates that an application has been
terminated by iOS because a watchdog timeout occurred. The application
took too long to launch, terminate, or respond to system events. One
common cause of this is doing synchronous networking on the main
thread. Whatever operation is on Thread 0: needs to be moved to a
background thread, or processed differently, so that it does not block
the main thread.
Make sure as you're going into the background you're not doing anything that will take a long time, use a background task if needed, and don't do anything like OpenGL calls from the background. Since the crash report says you're in the Foreground, I wonder if you're taking too long going into the background and Springboard is killing your app. The system log will confirm that.

why is xcode 7 not running an app on ios 9?

Lately installed Xcode 7 beta 4.
My app will not run on an iOS 9.0 device, although it will run on an iOS 9.0 simulator, and an iOS 8.4 device (using Xcode 7b4).
Xcode shows "Running %app_name on %device_name", the icon shows up on the device, but does not run, and that's how it stays.
Debug console shows nothing (checked the preferences, also, when using an iOS 8.4 device it shows output log as expected).
Another app that I created runs fine, it's just this app, on iOS9 device (Sim works smoothly).
No exception is thrown, no compilation error... nothing to go on.
Trying to start the app from the phone itself results in a request to send notifications (ok behaviour) and crashes...
Any ideas ?
EDIT:
In the device console output, I these two messages (not always):
Aug 4 11:39:53 iOS-9-test-device syslog_relay(liblockdown.dylib)[117]
: The connection is now invalid. Aug 4 11:39:53
iOS-9-test-device lockbot[79] : got an unknown event
And this is a crash report from the device itself :
Incident Identifier: C6A70E35-2ACD-4A17-959C-547DE3CC39F0 CrashReporter Key: 5c34ba5da623fd5860d5d4059ad9f46615e4e3f9 Hardware Model: iPhone5,1 Process: MyAppName [6737] Path: /var/mobile/Containers/Bundle/Application/099D6717-A7A5-45A5-96DE-92810AE0476A/MyAppName.app/MyAppName Identifier: com.MyOrgName.MyAppName Version: 7 (2.2.10) Code Type: ARM (Native) Parent Process: launchd [1]
Date/Time: 2015-08-04 11:47:38.38 +0300 Launch Time: 2015-08-04 11:47:23.23 +0300 OS Version: iOS 9.0 (13A4254v) Report Version: 105
Exception Type: 00000020 Exception Codes: 0x000000008badf00d Exception Note: SIMULATED (this is NOT a crash) Highlighted by Thread: 0
Application Specific Information: com.MyOrgName.MyAppName failed to scene-create after 14.65s (launch took 0.35s of total time limit
15.00s)
Elapsed total CPU time (seconds): 3.220 (user 3.220, system 0.000), 11% CPU Elapsed application CPU time (seconds): 0.779, 3% CPU
Filtered syslog: None found
Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0: 0 libsystem_kernel.dylib 0x35a09b08 __psynch_mutexwait + 24 1 libsystem_pthread.dylib 0x35a9cad0 _pthread_mutex_lock + 412 2 libc++.1.dylib 0x349bfa60 std::__1::mutex::lock() + 4 3 VectorKit 0x323165be
-[VKTileSetBackedTileSource setStyleManager:] + 222 4 VectorKit 0x320db374 -[VKMapModel createSourceForLayer:tileSet:mode:] + 1260 5 VectorKit 0x320dab7c -[VKMapModel sourceForLayer:mode:] + 228 6 VectorKit 0x320da52a -[VKMapModel configureTileSources] + 402 7 VectorKit 0x32166234 -[VKMapModel forceMapType:animated:] + 5068 8 VectorKit 0x3216a64a -[VKMapModel initShouldRasterize:mapPurpose:tileGroupIdentifier:locale:contentScale:]
+ 3378 9 VectorKit 0x32157a74 -[VKMapCanvas initShouldRasterize:contentScale:target:device:inBackground:locale:] + 680 10 VectorKit 0x320cd1de -[VKMapView initWithGlobe:shouldRasterize:inBackground:] + 846 11 MapKit 0x24e5299a -[MKBasicMapView initWithFrame:andGlobe:shouldRasterize:]
+ 346 12 MapKit 0x24e821a0 -[MKMapView _commonInitFromIB:gestureRecognizerHostView:showsAttribution:] + 976 13 MapKit 0x24e82d28 -[MKMapView initWithCoder:] + 124 14 UIKit 0x27cecd14 UINibDecoderDecodeObjectForValue + 776 15 UIKit 0x27cec9fc -[UINibDecoder decodeObjectForKey:] + 292 16 UIKit 0x27bf794a -[UIRuntimeConnection initWithCoder:] + 110 17 UIKit 0x27cecd14 UINibDecoderDecodeObjectForValue + 776 18 UIKit 0x27cecca6 UINibDecoderDecodeObjectForValue + 666 19 UIKit 0x27cec9fc -[UINibDecoder decodeObjectForKey:] + 292 20 UIKit 0x27bf6ede -[UINib instantiateWithOwner:options:] + 1106 21 UIKit 0x27ad2396 -[UIViewController _loadViewFromNibNamed:bundle:] + 318 22 UIKit 0x278bd842 -[UIViewController loadView]
+ 138 23 UIKit 0x27785fb0 -[UIViewController loadViewIfRequired] + 132 24 UIKit 0x27842a92 -[UINavigationController _layoutViewController:] + 34 25 UIKit 0x27842992 -[UINavigationController
_updateScrollViewFromViewController:toViewController:] + 282 26 UIKit 0x27841d9c -[UINavigationController
_startTransition:fromViewController:toViewController:] + 80 27 UIKit 0x278419f2 -[UINavigationController
_startDeferredTransitionIfNeeded:] + 842 28 UIKit 0x2784163c -[UINavigationController __viewWillLayoutSubviews] + 48 29 UIKit 0x278415b2 -[UILayoutContainerView layoutSubviews] + 210 30 UIKit 0x2778246c
-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 640 31 QuartzCore 0x27099f64 -[CALayer layoutSublayers] + 124 32 QuartzCore 0x27095714 CA::Layer::layout_if_needed(CA::Transaction*) + 348 33 QuartzCore 0x270955a4 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
+ 12 34 QuartzCore 0x27094b0c CA::Context::commit_transaction(CA::Transaction*) + 364 35 QuartzCore 0x270947ce CA::Transaction::commit() + 586 36 QuartzCore 0x2708e17a CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 134 37 CoreFoundation 0x23638a3a
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18 38 CoreFoundation 0x23636d02 __CFRunLoopDoObservers + 278 39 CoreFoundation 0x23587abc CFRunLoopRunSpecific + 544 40 CoreFoundation 0x23587890 CFRunLoopRunInMode + 104 41 UIKit 0x277f2a82 -[UIApplication
_run] + 522 42 UIKit 0x277ed314 UIApplicationMain + 140 43 MyAppName 0x000bb176 main (main.m:16) 44 libdyld.dylib 0x3593a9cc start + 0
Thread 1: 0 libsystem_kernel.dylib 0x35a0a92c
__workq_kernreturn + 8 1 libsystem_pthread.dylib 0x35a9c8c0 _pthread_wqthread + 1032 2 libsystem_pthread.dylib 0x35a9c4a4 start_wqthread + 4
Thread 2 name: Dispatch queue: com.apple.libdispatch-manager Thread 2: 0 libsystem_kernel.dylib 0x35a0b3c0 kevent_qos + 24 1 libdispatch.dylib 0x3591ecfa _dispatch_mgr_invoke + 250 2 libdispatch.dylib 0x3591170a _dispatch_mgr_thread + 34
Thread 3: 0 libsystem_kernel.dylib 0x35a0a92c
__workq_kernreturn + 8 1 libsystem_pthread.dylib 0x35a9c8c0 _pthread_wqthread + 1032 2 libsystem_pthread.dylib 0x35a9c4a4 start_wqthread + 4
Thread 4: 0 libsystem_kernel.dylib 0x35a0a92c
__workq_kernreturn + 8 1 libsystem_pthread.dylib 0x35a9c8c0 _pthread_wqthread + 1032 2 libsystem_pthread.dylib 0x35a9c4a4 start_wqthread + 4
Thread 5 name: com.apple.NSURLConnectionLoader Thread 5: 0 libsystem_kernel.dylib 0x359f60b0 mach_msg_trap + 20 1 libsystem_kernel.dylib 0x359f5eac mach_msg + 36 2 CoreFoundation 0x23638e34 __CFRunLoopServiceMachPort + 132 3 CoreFoundation 0x2363718e __CFRunLoopRun + 1046 4 CoreFoundation 0x23587a9c CFRunLoopRunSpecific + 512 5 CoreFoundation 0x23587890 CFRunLoopRunInMode + 104 6 CFNetwork 0x22f166ea +[NSURLConnection(Loader) _resourceLoadLoop:] + 482 7 Foundation 0x2447eb0e __NSThread__start__ + 1098 8 libsystem_pthread.dylib 0x35a9ea84 _pthread_body + 136 9 libsystem_pthread.dylib 0x35a9e9f6 _pthread_start + 106 10 libsystem_pthread.dylib 0x35a9c4b0 thread_start + 4
Thread 6 name: GAIThread Thread 6: 0 libsystem_kernel.dylib 0x359f60b0 mach_msg_trap + 20 1 libsystem_kernel.dylib 0x359f5eac mach_msg + 36 2 CoreFoundation 0x23638e34 __CFRunLoopServiceMachPort + 132 3 CoreFoundation 0x2363718e __CFRunLoopRun + 1046 4 CoreFoundation 0x23587a9c CFRunLoopRunSpecific + 512 5 CoreFoundation 0x23587890 CFRunLoopRunInMode + 104 6 Foundation 0x243afb44 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 264 7 Foundation 0x243fe8c0 -[NSRunLoop(NSRunLoop) run]
+ 76 8 MyAppName 0x0015ccac +[GAI threadMain:] + 60 9 Foundation 0x2447eb0e __NSThread__start__ + 1098 10 libsystem_pthread.dylib 0x35a9ea84 _pthread_body + 136 11 libsystem_pthread.dylib 0x35a9e9f6 _pthread_start + 106 12 libsystem_pthread.dylib 0x35a9c4b0 thread_start + 4
Thread 7 name: NetworkLoad Thread 7: 0 libsystem_kernel.dylib 0x359f60b0 mach_msg_trap + 20 1 libsystem_kernel.dylib 0x359f5eac mach_msg + 36 2 CoreFoundation 0x23638e34 __CFRunLoopServiceMachPort + 132 3 CoreFoundation 0x2363718e __CFRunLoopRun + 1046 4 CoreFoundation 0x23587a9c CFRunLoopRunSpecific + 512 5 CoreFoundation 0x23587890 CFRunLoopRunInMode + 104 6 GeoServices 0x2c90c76a _runNetworkThread + 462 7 libsystem_pthread.dylib 0x35a9ea84 _pthread_body + 136 8 libsystem_pthread.dylib 0x35a9e9f6 _pthread_start + 106 9 libsystem_pthread.dylib 0x35a9c4b0 thread_start + 4
Thread 8 name: com.apple.CFSocket.private Thread 8: 0 libsystem_kernel.dylib 0x35a09fec __select + 20 1 CoreFoundation 0x2363dd44 __CFSocketManager + 568 2 libsystem_pthread.dylib 0x35a9ea84 _pthread_body + 136 3 libsystem_pthread.dylib 0x35a9e9f6 _pthread_start + 106 4 libsystem_pthread.dylib 0x35a9c4b0 thread_start + 4
No thread state (register information) available
Upgrading to the latest Xcode 7 beta 5 and iOS 9 beta 5 just resolved the issue. Thanks for the help guys.

SIGTRAP error on iOS – AutoreleasePoolPage::busted

Does anyone have any clue what's causing this crash?
It happens very rarely.
The crash reports are coming via HockeyApp from the device. I've not been able to reproduce it on the simulator.
Any ideas greatly appreciated.
Exception Type: SIGTRAP
Exception Codes: #0 at 0x197c73c10
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x0000000197c73c10 _objc_trap() + 0
1 libobjc.A.dylib 0x0000000197c73c80 _objc_fatal + 80
2 libobjc.A.dylib 0x0000000197c8e7fc (anonymous namespace)::AutoreleasePoolPage::busted(bool) + 140
3 libobjc.A.dylib 0x0000000197c8d54c (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 88
4 CoreFoundation 0x0000000187418f94 _CFAutoreleasePoolPop + 24
5 UIKit 0x000000018bcd8c28 _wrapRunLoopWithAutoreleasePoolHandler + 72
6 CoreFoundation 0x00000001874ee14c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 28
7 CoreFoundation 0x00000001874eb0d8 __CFRunLoopDoObservers + 356
8 CoreFoundation 0x00000001874eb4b8 __CFRunLoopRun + 832
9 CoreFoundation 0x00000001874191f4 CFRunLoopRunSpecific + 392
10 GraphicsServices 0x00000001905a75a4 GSEventRunModal + 164
11 UIKit 0x000000018bd4a784 UIApplicationMain + 1484
12 MyAppName 0x00000001001794d4 main (main.mm:15)
13 libdyld.dylib 0x00000001982e2a08 start + 0
Thread 1:
0 libsystem_kernel.dylib 0x00000001983e0c94 kevent64 + 8
1 libdispatch.dylib 0x00000001982bb3b4 _dispatch_mgr_thread + 48
Thread 2:
0 libsystem_kernel.dylib 0x00000001983e0e7c mach_msg_trap + 8
1 CoreFoundation 0x00000001874ed5cc __CFRunLoopServiceMachPort + 196
2 CoreFoundation 0x00000001874eb520 __CFRunLoopRun + 936
3 CoreFoundation 0x00000001874191f4 CFRunLoopRunSpecific + 392
4 CFNetwork 0x0000000186f1d6a4 +[NSURLConnection(Loader) _resourceLoadLoop:] + 436
5 Foundation 0x0000000188405c0c __NSThread__main__ + 1068
6 libsystem_pthread.dylib 0x0000000198497e80 _pthread_body + 160
7 libsystem_pthread.dylib 0x0000000198497ddc _pthread_start + 156
8 libsystem_pthread.dylib 0x0000000198494fb0 thread_start + 0
Thread 3:
0 libsystem_kernel.dylib 0x00000001983fb498 __select + 8
1 libsystem_pthread.dylib 0x0000000198497e80 _pthread_body + 160
2 libsystem_pthread.dylib 0x0000000198497ddc _pthread_start + 156
3 libsystem_pthread.dylib 0x0000000198494fb0 thread_start + 0
Thread 4:
0 libsystem_kernel.dylib 0x00000001983fbc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000198494fa8 start_wqthread + 0
Thread 5:
0 libsystem_kernel.dylib 0x00000001983fbc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000198494fa8 start_wqthread + 0
I fixed this in the end by refactoring my code.
I had blocks that I was holding on to for a navigation menu – the idea being to just call the block when a menu button was tapped.
I refactored my navigation menu buttons to no longer rely on the blocks and these AutoreleasePoolPage::busted errors disappeared.
Strange crashes can happens when device have not enough available free memory.
This is usually different single crashes in absolutely different places.
Look attached screenshots with crash info from one of my apps
(I'm using Crashlytics for getting crash reports, it also shows information about free memory)

iPhone app using Facebook SDK crashes with "has active assertions beyond permitted time" error

I have an iPhone (iOS native) app that uses the current Facebook iOS SDK. When attempting to connect my app via the Single-Sign-On process, I frequently get a crash stating my app "has active assertions beyond permitted time". After reviewing other similar reports here on Stack Overflow (such as iPhone app "has active assertions beyond permitted time") I don't find anything that seems to fit my situation. I am following Facebook's recommended practices for integrating SSO (from https://developers.facebook.com/docs/mobile/ios/build/#implementsso). That means I am calling the Facebook SDK on my main thread. Facebook doesn't seem to think this will be a problem.
Can anyone explain what this particular error means? I assume that some iOS supervisor mechanism is killing my app because it's taking too long doing something, but what particular something? Is it because the foreground task is locked for too long? Or what?
Here's an iOS app crash report showing the error.
Incident Identifier: F2486727-9EAC-4D7F-8A45-07AC51ADD186
CrashReporter Key: b3825455d63e6e7f659074b5ea5fb89cf8ed1b9f
Hardware Model: iPhone2,1
Process: JouleBug [2060]
Path: /var/mobile/Applications/FA3DB4BA-92AF-4D14-AD3A-1553EFA1FA16/JouleBug.app/JouleBug
Identifier: JouleBug
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-07-05 14:44:30.751 -0400
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x8badf00d
Highlighted Thread: 3
Application Specific Information:
JouleBug[2060] has active assertions beyond permitted time:
{(
<SBProcessAssertion: 0xe2ed000> identifier: Suspending process: JouleBug[2060] permittedBackgroundDuration: 10.000000 reason: suspend owner pid:52 preventSuspend preventThrottleDownCPU preventThrottleDownUI
)}
Elapsed total CPU time (seconds): 6.190 (user 6.190, system 0.000), 84% CPU
Elapsed application CPU time (seconds): 1.515, 21% CPU
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x37e23dcc __open + 8
1 Foundation 0x31ab412a _NSmkstemp83 + 322
2 Foundation 0x31ab3f4a _NSCreateTemporaryFile + 118
3 Foundation 0x31ab3b36 _NSWriteBytesToFileWithExtendedAttributes + 186
4 Foundation 0x31ab3a70 _NSWriteBytesToFile + 24
5 Foundation 0x31ab3a48 -[NSData(NSData) writeToFile:atomically:] + 76
6 JouleBug 0x00109c5c -[LazyJSONModelMapper save] (LazyJSONModelMapper.m:106)
7 JouleBug 0x00109b40 __36-[LazyJSONModelMapper initWithFile:]_block_invoke_0 (LazyJSONModelMapper.m:63)
8 Foundation 0x31a856c2 -[__NSObserver _doit:] + 286
9 Foundation 0x31b1152a __67-[NSNotificationCenter addObserverForName:object:queue:usingBlock:]_block_invoke_0 + 22
10 CoreFoundation 0x311d6540 ___CFXNotificationPost_block_invoke_0 + 64
11 CoreFoundation 0x31162090 _CFXNotificationPost + 1400
12 Foundation 0x31a853e4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 60
13 UIKit 0x3090524e -[UIApplication _handleApplicationSuspend:eventInfo:] + 786
14 UIKit 0x30895ef8 -[UIApplication handleEvent:withNewEvent:] + 2088
15 UIKit 0x30895560 -[UIApplication sendEvent:] + 48
16 UIKit 0x30894f34 _UIApplicationHandleEvent + 5820
17 GraphicsServices 0x331db224 PurpleEventCallback + 876
18 CoreFoundation 0x311deacc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 8
19 CoreFoundation 0x311de32e __CFRunLoopDoSources0 + 358
20 CoreFoundation 0x311dd03e __CFRunLoopRun + 646
21 CoreFoundation 0x3116049e CFRunLoopRunSpecific + 294
22 CoreFoundation 0x31160366 CFRunLoopRunInMode + 98
23 GraphicsServices 0x331da432 GSEventRunModal + 130
24 UIKit 0x308c3cce UIApplicationMain + 1074
25 JouleBug 0x00033ac6 main (main.m:14)
26 JouleBug 0x00003900 0x1000 + 10496
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x37e143a8 kevent + 24
1 libdispatch.dylib 0x35a2eea4 _dispatch_mgr_invoke + 708
2 libdispatch.dylib 0x35a2ebc2 _dispatch_mgr_thread + 30
Thread 2:
0 libsystem_kernel.dylib 0x37e24cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x352aaf36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x352aacc8 start_wqthread + 0
Thread 3 name: WebThread
Thread 3:
0 libsystem_kernel.dylib 0x37e240d8 __psynch_mutexwait + 24
1 libsystem_c.dylib 0x352a4674 pthread_mutex_lock + 376
2 WebCore 0x362614e8 _ZL17_WebTryThreadLockb + 208
3 WebCore 0x362c016c _ZL19SendDelegateMessageP12NSInvocation + 700
4 WebKit 0x36bfad80 -[_WebSafeForwarder forwardInvocation:] + 112
5 CoreFoundation 0x3120ca7c ___forwarding___ + 660
6 CoreFoundation 0x31167648 _CF_forwarding_prep_0 + 40
7 WebCore 0x3631bf7c WebCore::FrameLoader::finishedParsing() + 56
8 WebCore 0x3631bf12 WebCore::Document::finishedParsing() + 186
9 WebCore 0x3631be50 WebCore::HTMLTreeBuilder::finished() + 16
10 WebCore 0x3630cfbe WebCore::HTMLDocumentParser::prepareToStopParsing() + 106
11 WebCore 0x3630cc9e WebCore::HTMLDocumentParser::finish() + 90
12 WebCore 0x3630cc3a WebCore::Document::finishParsing() + 14
13 WebCore 0x36309e62 WebCore::DocumentWriter::endIfNotLoadingMainResource() + 74
14 WebCore 0x363084fa WebCore::DocumentLoader::finishedLoading() + 74
15 WebCore 0x363559c8 WebCore::FrameLoader::finishedLoading() + 48
16 WebCore 0x36355938 WebCore::MainResourceLoader::didFinishLoading(double) + 88
17 WebCore 0x363558c2 _ZN7WebCoreL16didFinishLoadingEP16_CFURLConnectionPKv + 46
18 CFNetwork 0x349997ee URLConnectionClient::_clientDidFinishLoading(URLConnectionClient::ClientConnectionEventQueue*) + 186
19 CFNetwork 0x3498e49e URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 418
20 CFNetwork 0x3498e592 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 662
21 CFNetwork 0x3498e19c URLConnectionClient::processEvents() + 100
22 CFNetwork 0x3498e0d2 MultiplexerSource::perform() + 150
23 CoreFoundation 0x311deacc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 8
24 CoreFoundation 0x311de32e __CFRunLoopDoSources0 + 358
25 CoreFoundation 0x311dd03e __CFRunLoopRun + 646
26 CoreFoundation 0x3116049e CFRunLoopRunSpecific + 294
27 CoreFoundation 0x31160366 CFRunLoopRunInMode + 98
28 WebCore 0x36304c9c _ZL12RunWebThreadPv + 396
29 libsystem_c.dylib 0x352b072e _pthread_start + 314
30 libsystem_c.dylib 0x352b05e8 thread_start + 0
Thread 4:
0 libsystem_kernel.dylib 0x37e14004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x37e141fa mach_msg + 50
2 CoreFoundation 0x311de3ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x311dd124 __CFRunLoopRun + 876
4 CoreFoundation 0x3116049e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x311dd444 CFRunLoopRun + 92
6 JouleBug 0x00071800 +[ASIHTTPRequest runRequests] (ASIHTTPRequest.m:4772)
7 Foundation 0x31a92a7a -[NSThread main] + 66
8 Foundation 0x31b2658a __NSThread__main__ + 1042
9 libsystem_c.dylib 0x352b072e _pthread_start + 314
10 libsystem_c.dylib 0x352b05e8 thread_start + 0
Thread 5 name: com.apple.NSURLConnectionLoader
Thread 5:
0 libsystem_kernel.dylib 0x37e14004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x37e141fa mach_msg + 50
2 CoreFoundation 0x311de3ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x311dd124 __CFRunLoopRun + 876
4 CoreFoundation 0x3116049e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x31160366 CFRunLoopRunInMode + 98
6 Foundation 0x31a92bb2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 302
7 Foundation 0x31a92a7a -[NSThread main] + 66
8 Foundation 0x31b2658a __NSThread__main__ + 1042
9 libsystem_c.dylib 0x352b072e _pthread_start + 314
10 libsystem_c.dylib 0x352b05e8 thread_start + 0
Thread 6 name: com.apple.CFSocket.private
Thread 6:
0 libsystem_kernel.dylib 0x37e24570 __select + 20
1 CoreFoundation 0x311e263a __CFSocketManager + 726
2 libsystem_c.dylib 0x352b072e _pthread_start + 314
3 libsystem_c.dylib 0x352b05e8 thread_start + 0
Thread 7:
0 libsystem_kernel.dylib 0x37e14004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x37e141fa mach_msg + 50
2 CoreFoundation 0x311de3ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x311dd124 __CFRunLoopRun + 876
4 CoreFoundation 0x3116049e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x31160366 CFRunLoopRunInMode + 98
6 Foundation 0x31a86b6e -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 Foundation 0x31aa051c -[NSRunLoop(NSRunLoop) run] + 72
8 JouleBug 0x0014e516 0x1000 + 1365270
9 Foundation 0x31a92a7a -[NSThread main] + 66
10 Foundation 0x31b2658a __NSThread__main__ + 1042
11 libsystem_c.dylib 0x352b072e _pthread_start + 314
12 libsystem_c.dylib 0x352b05e8 thread_start + 0
Thread 8 name: Dispatch queue: com.apple.root.default-priority
Thread 8:
0 libsystem_kernel.dylib 0x37e2451c __rename + 8
1 libsystem_kernel.dylib 0x37e15b6e rename + 2
2 Foundation 0x31ab3dac _NSWriteBytesToFileWithExtendedAttributes + 816
3 Foundation 0x31ab3a70 _NSWriteBytesToFile + 24
4 Foundation 0x31ab3a48 -[NSData(NSData) writeToFile:atomically:] + 76
5 JouleBug 0x00109c5c -[LazyJSONModelMapper save] (LazyJSONModelMapper.m:106)
6 JouleBug 0x00109a4e -[LazyJSONModelMapper initWithFile:] (LazyJSONModelMapper.m:85)
7 JouleBug 0x001097c6 -[LazyJSONModelMapper initWithData:fromFile:] (LazyJSONModelMapper.m:45)
8 JouleBug 0x00089e5c +[GameDataManager storePinFromPinDict:] (GameDataManager.m:238)
9 JouleBug 0x000dd378 +[GameDataLoader processData:] (GameDataLoader.m:62)
10 JouleBug 0x000ae300 +[DataLoader refreshDataSynchronously] (DataLoader.m:54)
11 JouleBug 0x000ae29c __25+[DataLoader refreshData]_block_invoke_0 (DataLoader.m:36)
12 Foundation 0x31acbe50 -[NSBlockOperation main] + 196
13 Foundation 0x31aad38c -[__NSOperationInternal start] + 856
14 JouleBug 0x000ccb06 -[TimedBlockOperation start] (NSOperationExtensions.m:96)
15 Foundation 0x31b1678c __block_global_6 + 96
16 libdispatch.dylib 0x35a22c52 _dispatch_call_block_and_release + 6
17 libdispatch.dylib 0x35a2e7b4 _dispatch_worker_thread2 + 256
18 libsystem_c.dylib 0x352aadf4 _pthread_wqthread + 288
19 libsystem_c.dylib 0x352aacc8 start_wqthread + 0
Thread 9:
0 libsystem_kernel.dylib 0x37e24cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x352aaf36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x352aacc8 start_wqthread + 0
Thread 10:
0 libsystem_kernel.dylib 0x37e24cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x352aaf36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x352aacc8 start_wqthread + 0
Thread 11 name: WebCore: CFNetwork Loader
Thread 11:
0 libsystem_kernel.dylib 0x37e14004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x37e141fa mach_msg + 50
2 CoreFoundation 0x311de3ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x311dd124 __CFRunLoopRun + 876
4 CoreFoundation 0x3116049e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x31160366 CFRunLoopRunInMode + 98
6 WebCore 0x3632e0d2 _ZN7WebCoreL15runLoaderThreadEPv + 122
7 libsystem_c.dylib 0x352b072e _pthread_start + 314
8 libsystem_c.dylib 0x352b05e8 thread_start + 0
Thread 12:
0 libsystem_kernel.dylib 0x37e24cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x352aaf36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x352aacc8 start_wqthread + 0
Unknown thread crashed with unknown flavor: 5, state_count: 1
I finally tracked this down. Just as in other similar incidents reported on Stack Overflow, this turned out to be a problem with a scheduled operation attempting to run in the background. My problem is resolved.

Resources