NSURLSession - iOS kills application in background while communicating with server - ios

I am working on a BLE application that will always run in background. It gets health related data from the BLE peripheral and will upload the data to the server in realtime. I am using NSURLSession along with NSURLSessionUploadTask created using [NSURLSession uploadTaskWithRequest:myRequest fromFile:fileURL] to send data to the server.
Right now the application works as expected for 4-5 hours in background but after that iOS kills the application.
Here is the crash log.
Date/Time: 2014-04-02 19:32:11.694 -0700
OS Version: iOS 7.0.4 (11B554a)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x000000008badf00d
Highlighted Thread: 2
Application Specific Information:
MyApp[2548] has active assertions beyond permitted time:
{(
<BKProcessAssertion: 0x15d83310> identifier: Background Content Fetching (66) process: MyApp[2548] permittedBackgroundDuration: 30.000000 reason: backgroundContentFetching owner pid:33 preventSuspend preventThrottleDownUI preventIdleSleep preventSuspendOnSleep
)}
Elapsed total CPU time (seconds): 1.300 (user 1.300, system 0.000), 2% CPU
Elapsed application CPU time (seconds): 0.029, 0% CPU
Thread 0:
0 libsystem_kernel.dylib 0x3bb18a8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3bb18888 mach_msg + 44
2 CoreFoundation 0x30c957be __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x30c93f2a __CFRunLoopRun + 850
4 CoreFoundation 0x30bfec22 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x30bfea06 CFRunLoopRunInMode + 102
6 GraphicsServices 0x358ff27e GSEventRunModal + 134
7 UIKit 0x334a2044 UIApplicationMain + 1132
8 MyApp 0x0007b8b8 main (main.m:16)
9 libdyld.dylib 0x3ba74ab4 start + 0
Thread 1:
0 libsystem_kernel.dylib 0x3bb1883c kevent64 + 24
1 libdispatch.dylib 0x3ba59210 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x3ba58f96 _dispatch_mgr_thread$VARIANT$mp + 34
Thread 2 name: com.apple.NSURLConnectionLoader
Thread 2:
0 libsystem_kernel.dylib 0x3bb18a8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3bb18888 mach_msg + 44
2 CoreFoundation 0x30c957be __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x30c93ee4 __CFRunLoopRun + 780
4 CoreFoundation 0x30bfec22 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x30bfea06 CFRunLoopRunInMode + 102
6 Foundation 0x316392f2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 314
7 Foundation 0x316aec82 __NSThread__main__ + 1058
8 libsystem_pthread.dylib 0x3bb93c1a _pthread_body + 138
9 libsystem_pthread.dylib 0x3bb93b8a _pthread_start + 98
10 libsystem_pthread.dylib 0x3bb91c8c thread_start + 4
Thread 3 name: com.apple.CFSocket.private
Thread 3:
0 libsystem_kernel.dylib 0x3bb2b440 __select + 20
1 CoreFoundation 0x30c99680 __CFSocketManager + 480
2 libsystem_pthread.dylib 0x3bb93c1a _pthread_body + 138
3 libsystem_pthread.dylib 0x3bb93b8a _pthread_start + 98
4 libsystem_pthread.dylib 0x3bb91c8c thread_start + 4
Thread 4:
0 libsystem_kernel.dylib 0x3bb2bc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x3bb91dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x3bb91c80 start_wqthread + 4
I have not implemented [UIApplicationDelegate application:performFetchWithCompletionHandler:] method in AppDelegate, because I think that is related to background download.
Why my application crashes though I am using NSURLSession with background configuration? is that some thing related to not implementing [UIApplicationDelegate application:performFetchWithCompletionHandler:]?
Thanks.

Philip Mills is actually correct. Just because it took 3-5 minutes to download a file, it has nothing to do with the amount of time spent within the application.
If your application is woken up by the OS in the background, you get 30 seconds. No questions. If you do not call the completionBlock within 30 seconds your app will crash in the background, no ifs or buts. I've tested this for weeks.
You are able to download files that take 3-5 minutes or even 3-5 hours because NSURLSession submits the download task to nsnetworkd which is the network daemon managed by iOS. nsnetworkd handles your network jobs, not your app. During the actual download your app is asleep. Only once it's complete does it wake your app for 30 seconds to post-process that file as you see fit -- but you only get 30 seconds.

Related

Unable to reproduce iOS App Review team Crash. Unity app with Vuforia

We have submitted two apps recently (one new app, and one wich was an update of an already published app) and got the two rejected by the iOS app review team for the following reason :
Guideline 2.1 - Performance
Your app crashed on iPad or iPhone running iOS 11.2.5 connected to an IPv6 network during our review.
Before submitting the apps we extensively tested them with testflight on 4 different devices and iOS versions and experienced no crash at all.
We are unable to reproduce the crash the ios app review team experience
Our dev environment is the same for the two apps, may be this is the cause of the crash :
Unity 2017.2.1f1 with Vuforia (this is an augmentented reality app), Xcode 9.2 (latest version)
Herafter you will find the crashlog for the new app,( the updated app had an identical crashlog...), they are very similar :
The two crashlogs are very similar :
{"app_name":"ournewappname","timestamp":"2018-03-01 17:04:56.02 -0800","app_version":"1.0.1","slice_uuid":"af7e5c57-c2bc-3c91-8e1e-559acfccdb7f","adam_id":0,"build_version":"1","bundleID":"fr.ourcompany.ournewappname","share_with_app_devs":false,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 11.2.5 (15D60)","incident_id":"002164F5-FD42-4A49-BF58-E8C1CB773010","name":"ournewappname"}
Incident Identifier: 002164F5-FD42-4A49-BF58-E8C1CB773010
CrashReporter Key: 6fa54cb83ccb006df1d056599e75f6797f1ac664
Hardware Model: iPad5,1
Device Model: J96AP
Process: ournewappname [4216]
Path: /private/var/containers/Bundle/Application/752BA8CA-A7AE-4823-976E-1D5DEBD34B2E/ournewappname.app/ournewappname
Identifier: fr.ourcompany.ournewappname
Version: 1 (1.0.1)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd.development [1]
Coalition: fr.ourcompany.ournewappname [1066]
Date/Time: 2018-03-01 17:04:55.8059 -0800
Launch Time: 2018-03-01 17:04:54.7575 -0800
OS Version: iPhone OS 11.2.5 (15D60)
Baseband Version: n/a
UDID: a728c3d680bc84aaaddc473d254d3c02a764955f
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000088
VM Region Info: 0x88 is not in any region. Bytes before following region: 4301520760
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 0000000100640000-0000000100644000 [ 16K] r-x/r-x SM=COW ...ealtwrarcard]
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
Triggered by Thread: 0
Filtered syslog:
Timestamp Thread Type Activity PID
2018-03-01 17:04:54.8314 -0800 0xfd29 1024 0x0 4216 AssertionServices: BKSWorkspace created.
2018-03-01 17:04:54.9677 -0800 0xfd29 1024 0x0 4216 AccessibilitySettingsLoader: Loading settings loader: (system: 0)
2018-03-01 17:04:54.9790 -0800 0xfd29 1024 0x0 4216 AccessibilitySettingsLoader: AXSettingsLoader told to start
2018-03-01 17:04:54.9967 -0800 0xfd29 1024 0x0 4216 UIAccessibility: Starting accessibility server
2018-03-01 17:04:55.1193 -0800 0xfd29 1024 0x0 4216 UIAccessibility: Started AXRuntime server: 0
2018-03-01 17:04:55.1239 -0800 0xfd29 1024 0x0 4216 UIAccessibility: (null): Loading synchronously
2018-03-01 17:04:55.1262 -0800 0xfd29 1024 0x0 4216 UIAccessibility: Main bundle finished loading: load type: 0 - is system app server: 0 (<UIApplication: 0x113d0adb0>)
2018-03-01 17:04:55.2735 -0800 0xfd3c 1024 0x0 4216 FrontBoardServices: [FBSScene] [fr.ourcompany.ournewappname] Created client agent: <UIApplicationSceneClientAgent: 0x1c401d120>
2018-03-01 17:04:55.2742 -0800 0xfd3c 1024 0x0 4216 FrontBoardServices: [FBSScene] [fr.ourcompany.ournewappname - AirPlay] Created client agent: <UIApplicationSceneClientAgent: 0x1c001d3f0>
2018-03-01 17:04:55.7238 -0800 0xfd29 1024 0x0 4216 UIKit: View did appear: <SplashScreenController: 0x113d6d690> 1
2018-03-01 17:04:55.7253 -0800 0xfd29 1024 0x0 4216 UIAccessibility: Did post notification. notification: (1001) error:0 data:(null)
2018-03-01 17:04:55.7334 -0800 0xfd29 1024 0x0 4216 UIAccessibility: Did post notification. notification: (4002) error:0 data:{
controllerClass = SplashScreenController;
event = ViewDidAppear;
}
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 ournewappname 0x0000000100b3e9d8 0x100640000 + 5237208
1 ournewappname 0x000000010065339c 0x100640000 + 78748
2 ournewappname 0x0000000100653740 0x100640000 + 79680
3 CoreFoundation 0x00000001811c513c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20 (CFNotificationCenter.c:661)
4 CoreFoundation 0x00000001811c46dc _CFXRegistrationPost + 420 (CFNotificationCenter.c:163)
5 CoreFoundation 0x00000001811c4440 ___CFXNotificationPost_block_invoke + 60 (CFNotificationCenter.c:1060)
6 CoreFoundation 0x0000000181241e24 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1408 (CFXNotificationRegistrar.m:163)
7 CoreFoundation 0x00000001810fad60 _CFXNotificationPost + 380 (CFNotificationCenter.c:1057)
8 Foundation 0x0000000181b27348 -[NSNotificationCenter postNotificationName:object:userInfo:] + 68 (NSNotification.m:543)
9 UIKit 0x000000018ad28a20 +[UIScreen _FBSDisplayConfigurationConnected:andNotify:] + 280 (UIScreen.m:599)
10 UIKit 0x000000018aa51060 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 292 (UIApplication.m:3094)
11 UIKit 0x000000018ae66dbc -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 364 (UIApplicationSceneClientAgent.m:41)
12 FrontBoardServices 0x00000001838f61f0 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 364 (FBSSceneImpl.m:460)
13 FrontBoardServices 0x00000001838feaf8 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 224 (FBSWorkspace.m:606)
14 libdispatch.dylib 0x0000000180bb2a14 _dispatch_client_callout + 16 (object.m:502)
15 libdispatch.dylib 0x0000000180bba200 _dispatch_block_invoke_direct$VARIANT$mp + 288 (queue.c:3025)
16 FrontBoardServices 0x000000018392a7f8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36 (FBSSerialQueue.m:164)
17 FrontBoardServices 0x000000018392a49c -[FBSSerialQueue _performNext] + 404 (FBSSerialQueue.m:196)
18 FrontBoardServices 0x000000018392aa38 -[FBSSerialQueue _performNextFromRunLoopSource] + 56 (FBSSerialQueue.m:232)
19 CoreFoundation 0x00000001811db77c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1982)
20 CoreFoundation 0x00000001811db6fc __CFRunLoopDoSource0 + 88 (CFRunLoop.c:2017)
21 CoreFoundation 0x00000001811daf84 __CFRunLoopDoSources0 + 204 (CFRunLoop.c:2053)
22 CoreFoundation 0x00000001811d8b5c __CFRunLoopRun + 1048 (CFRunLoop.c:2920)
23 CoreFoundation 0x00000001810f8c58 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3245)
24 GraphicsServices 0x0000000182fa4f84 GSEventRunModal + 100 (GSEvent.c:2245)
25 UIKit 0x000000018a8515c4 UIApplicationMain + 236 (UIApplication.m:3956)
26 ournewappname 0x0000000100645980 0x100640000 + 22912
27 libdyld.dylib 0x0000000180c1856c start + 4
Thread 1:
0 libsystem_pthread.dylib 0x0000000180e5ab68 start_wqthread + 0
Thread 2:
0 libsystem_pthread.dylib 0x0000000180e5ab68 start_wqthread + 0
Thread 3 name: Dispatch queue: com.apple.frontboardservices.workspace.client
Thread 3:
0 CoreFoundation 0x00000001810f3d6c CFDataGetBytePtr + 88 (CFInternal.h:714)
1 Foundation 0x0000000181b3296c bytesInEncoding + 200 (NSStringEncodings.m:155)
2 Foundation 0x0000000181b3296c bytesInEncoding + 200 (NSStringEncodings.m:155)
3 CoreFoundation 0x0000000181104f6c -[__NSCFString UTF8String] + 80 (CFObject.m:228)
4 BaseBoard 0x0000000183703ee8 BSSerializeStringToXPCDictionaryWithKey + 44 (BSXPCSerialization.m:171)
5 BaseBoard 0x0000000183703ce8 BSSerializeBSXPCEncodableObjectToXPCDictionary + 52 (BSXPCSerialization.m:86)
6 BaseBoard 0x0000000183703ca4 BSCreateSerializedBSXPCEncodableObject + 56 (BSXPCSerialization.m:51)
7 BaseBoard 0x0000000183703d88 BSSerializeBSXPCEncodableObjectToXPCDictionaryWithKey + 40 (BSXPCSerialization.m:59)
8 FrontBoardServices 0x00000001838f929c -[FBSWorkspaceSceneClientSettingsChangedEvent encodeWithXPCDictionary:] + 84 (FBSWorkspaceSceneClientSettingsChangedEvent.m:52)
9 BaseBoard 0x0000000183703ce8 BSSerializeBSXPCEncodableObjectToXPCDictionary + 52 (BSXPCSerialization.m:86)
10 BaseBoard 0x0000000183703ca4 BSCreateSerializedBSXPCEncodableObject + 56 (BSXPCSerialization.m:51)
11 BaseBoard 0x0000000183703d88 BSSerializeBSXPCEncodableObjectToXPCDictionaryWithKey + 40 (BSXPCSerialization.m:59)
12 BaseBoard 0x0000000183720a30 +[BSXPCMessage messageWithPacker:] + 96 (BSXPCMessage.m:33)
13 BaseBoard 0x000000018371db08 -[BSBaseXPCClient _sendMessage:withReplyHandler:waitForReply:waitDuration:] + 132 (BSBaseXPCClient.m:187)
14 FrontBoardServices 0x0000000183918710 -[FBSWorkspaceClient _queue_sendMessage:withEvent:withResponseEvent:ofType:] + 144 (FBSWorkspaceClient.m:300)
15 libdispatch.dylib 0x0000000180bb2a54 _dispatch_call_block_and_release + 24 (init.c:994)
16 libdispatch.dylib 0x0000000180bb2a14 _dispatch_client_callout + 16 (object.m:502)
17 libdispatch.dylib 0x0000000180bbc96c _dispatch_queue_serial_drain$VARIANT$mp + 528 (inline_internal.h:2500)
18 libdispatch.dylib 0x0000000180bbd2fc _dispatch_queue_invoke$VARIANT$mp + 340 (queue.c:5302)
19 libdispatch.dylib 0x0000000180bbdd20 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 404 (queue.c:5920)
20 libdispatch.dylib 0x0000000180bc603c _dispatch_workloop_worker_thread$VARIANT$mp + 644 (source.c:2529)
21 libsystem_pthread.dylib 0x0000000180e5af1c _pthread_wqthread + 932 (pthread.c:2207)
22 libsystem_pthread.dylib 0x0000000180e5ab6c start_wqthread + 4
Thread 4:
0 libsystem_pthread.dylib 0x0000000180e5ab68 start_wqthread + 0
Thread 5 name: com.apple.uikit.eventfetch-thread
Thread 5:
0 libsystem_kernel.dylib 0x0000000180d27568 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000180d273e0 mach_msg + 72 (mach_msg.c:103)
2 CoreFoundation 0x00000001811db108 __CFRunLoopServiceMachPort + 196 (CFRunLoop.c:2613)
3 CoreFoundation 0x00000001811d8cd4 __CFRunLoopRun + 1424 (CFRunLoop.c:2969)
4 CoreFoundation 0x00000001810f8c58 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3245)
5 Foundation 0x0000000181b2d594 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304 (NSRunLoop.m:367)
6 Foundation 0x0000000181b4c9ac -[NSRunLoop(NSRunLoop) runUntilDate:] + 96 (NSRunLoop.m:411)
7 UIKit 0x000000018b3bb7a8 -[UIEventFetcher threadMain] + 136 (UIEventFetcher.m:437)
8 Foundation 0x0000000181c2f0f4 __NSThread__start__ + 996 (NSThread.m:1181)
9 libsystem_pthread.dylib 0x0000000180e5c2b4 _pthread_body + 308 (pthread.c:740)
10 libsystem_pthread.dylib 0x0000000180e5c180 _pthread_start + 312 (pthread.c:799)
11 libsystem_pthread.dylib 0x0000000180e5ab74 thread_start + 4
Thread 6:
0 libsystem_pthread.dylib 0x0000000180e5ab68 start_wqthread + 0
Thread 7 name: GC Finalizer
Thread 7:
0 libsystem_kernel.dylib 0x0000000180d480f0 __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x0000000180e5ece4 _pthread_cond_wait$VARIANT$mp + 640 (pthread_cond.c:579)
2 ournewappname 0x00000001012e86a8 0x100640000 + 13272744
3 ournewappname 0x00000001012cd658 0x100640000 + 13162072
4 ournewappname 0x00000001012e5400 0x100640000 + 13259776
5 ournewappname 0x00000001012e8df0 0x100640000 + 13274608
6 libsystem_pthread.dylib 0x0000000180e5c2b4 _pthread_body + 308 (pthread.c:740)
7 libsystem_pthread.dylib 0x0000000180e5c180 _pthread_start + 312 (pthread.c:799)
8 libsystem_pthread.dylib 0x0000000180e5ab74 thread_start + 4
Thread 8 name: BatchDeleteObjects
Thread 8:
0 libsystem_kernel.dylib 0x0000000180d275a4 semaphore_wait_trap + 8
1 libdispatch.dylib 0x0000000180bb4f04 _dispatch_sema4_wait$VARIANT$mp + 24 (lock.c:134)
2 libdispatch.dylib 0x0000000180bb58b4 _dispatch_semaphore_wait_slow + 140 (semaphore.c:143)
3 ournewappname 0x0000000100d546b8 0x100640000 + 7423672
4 ournewappname 0x0000000100cd40dc 0x100640000 + 6897884
5 ournewappname 0x0000000100d53c8c 0x100640000 + 7421068
6 libsystem_pthread.dylib 0x0000000180e5c2b4 _pthread_body + 308 (pthread.c:740)
7 libsystem_pthread.dylib 0x0000000180e5c180 _pthread_start + 312 (pthread.c:799)
8 libsystem_pthread.dylib 0x0000000180e5ab74 thread_start + 4
Thread 9 name: AsyncReadManager
Thread 9:
0 libsystem_kernel.dylib 0x0000000180d275a4 semaphore_wait_trap + 8
1 libdispatch.dylib 0x0000000180bb4f04 _dispatch_sema4_wait$VARIANT$mp + 24 (lock.c:134)
2 libdispatch.dylib 0x0000000180bb58b4 _dispatch_semaphore_wait_slow + 140 (semaphore.c:143)
3 ournewappname 0x0000000100c3c530 0x100640000 + 6276400
4 ournewappname 0x0000000100c3c074 0x100640000 + 6275188
5 ournewappname 0x0000000100d53c8c 0x100640000 + 7421068
6 libsystem_pthread.dylib 0x0000000180e5c2b4 _pthread_body + 308 (pthread.c:740)
7 libsystem_pthread.dylib 0x0000000180e5c180 _pthread_start + 312 (pthread.c:799)
8 libsystem_pthread.dylib 0x0000000180e5ab74 thread_start + 4
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000048 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000101f8b03c
x4: 0x0000000000000010 x5: 0x0000000000000001 x6: 0x0000000000000000 x7: 0x0000000000000403
x8: 0x0000000101f8fa40 x9: 0x0000000000000001 x10: 0x0000000101f8ad60 x11: 0x0000000113d15730
x12: 0x0000000101f8adb8 x13: 0x0000000000000002 x14: 0x0000000113e01680 x15: 0x016b5c01016b5cc0
x16: 0x0000000180e51c60 x17: 0x0000000181b31d38 x18: 0xfffffff01210d25c x19: 0x0000000000000002
x20: 0x000000016f7bdc38 x21: 0x0000000101f8a000 x22: 0x0000000000000002 x23: 0x0000000000000000
x24: 0x0000000000000002 x25: 0x000000016f7bdc38 x26: 0x0000000000000001 x27: 0x00000001b2373650
x28: 0x0000000000000001 fp: 0x000000016f7bdb60 lr: 0x0000000100b3e9d8
sp: 0x000000016f7bd9f0 pc: 0x0000000100b3e9d8 cpsr: 0x60000000
As we could not reproduce the crash its difficult to fix.
In this crashlog there is something about SplashScreenController, so just in case we removed the splashscreen, and also changed Unity Version to 2017.3.1 and resubmitted the app...
Any help would really be appreciated, perhaps we are missing some usefull information in the crash log ?
We were running into the same issue (same Exception and app store rejection). We came across this Unity bug that seemed to be the culprit.
https://issuetracker.unity3d.com/issues/ios-11-build-crashes-on-remotear-unityupdatedisplaylist-when-launching-app-from-url-with-airplay-connected
There was a bug that caused this crash when users were streaming their device screen (AirPlay etc). I assume testers sometimes use AirPlay, causing the crash, while developers saw nothing wrong.
Luckily this bug has been corrected in Unity and has been backported to several Unity patch versions:
Fixed in:
2018.1.0b1
Backported to:
2017.3.0p2
2017.2.1p2
2017.1.3p1
After updating from 2017.2.1 to 2017.2.1p2, our app was accepted.
We had an AR app rejected for the same reasons last Friday. We're using Unity 2017.3.0f3 with native Vuforia integration and Xcode 9.2; we're also using Native Share.
The crash log we received from Apple looks pretty much the same as yours #Jeff; same exception type and methods shown on the crashed thread.
I'll try your approach of downgrading to a different version of Unity and will share my results.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000088
VM Region Info: 0x88 is not in any region. Bytes before following region: 4377919352
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 0000000104f1c000-0000000104f20000 [ 16K] r-x/r-x SM=COW .../OurApp]
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
Triggered by Thread: 0
and
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 OurApp 0x0000000105463334 0x104f1c000 + 5534516
1 OurApp 0x0000000104f2f130 0x104f1c000 + 78128
2 OurApp 0x0000000104f2f4d4 0x104f1c000 + 79060
3 CoreFoundation 0x0000000184bd113c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20 (CFNotificationCenter.c:661)
4 CoreFoundation 0x0000000184bd06dc _CFXRegistrationPost + 420 (CFNotificationCenter.c:163)
5 CoreFoundation 0x0000000184bd0440 ___CFXNotificationPost_block_invoke + 60 (CFNotificationCenter.c:1060)
6 CoreFoundation 0x0000000184c4de24 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1408 (CFXNotificationRegistrar.m:163)
7 CoreFoundation 0x0000000184b06d60 _CFXNotificationPost + 380 (CFNotificationCenter.c:1057)
8 Foundation 0x0000000185533348 -[NSNotificationCenter postNotificationName:object:userInfo:] + 68 (NSNotification.m:543)
9 UIKit 0x000000018e734a20 +[UIScreen _FBSDisplayConfigurationConnected:andNotify:] + 280 (UIScreen.m:599)
10 UIKit 0x000000018e45d060 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 292 (UIApplication.m:3094)
11 UIKit 0x000000018e872dbc -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 364 (UIApplicationSceneClientAgent.m:41)
12 FrontBoardServices 0x00000001873021f0 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 364 (FBSSceneImpl.m:460)
13 FrontBoardServices 0x000000018730aaf8 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 224 (FBSWorkspace.m:606)
14 libdispatch.dylib 0x00000001845bea14 _dispatch_client_callout + 16 (object.m:502)
15 libdispatch.dylib 0x00000001845c6200 _dispatch_block_invoke_direct$VARIANT$mp + 288 (queue.c:3025)
16 FrontBoardServices 0x00000001873367f8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36 (FBSSerialQueue.m:164)
17 FrontBoardServices 0x000000018733649c -[FBSSerialQueue _performNext] + 404 (FBSSerialQueue.m:196)
18 FrontBoardServices 0x0000000187336a38 -[FBSSerialQueue _performNextFromRunLoopSource] + 56 (FBSSerialQueue.m:232)
19 CoreFoundation 0x0000000184be777c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1982)
20 CoreFoundation 0x0000000184be76fc __CFRunLoopDoSource0 + 88 (CFRunLoop.c:2017)
21 CoreFoundation 0x0000000184be6f84 __CFRunLoopDoSources0 + 204 (CFRunLoop.c:2053)
22 CoreFoundation 0x0000000184be4b5c __CFRunLoopRun + 1048 (CFRunLoop.c:2920)
23 CoreFoundation 0x0000000184b04c58 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3245)
24 GraphicsServices 0x00000001869b0f84 GSEventRunModal + 100 (GSEvent.c:2245)
25 UIKit 0x000000018e25d5c4 UIApplicationMain + 236 (UIApplication.m:3956)
26 OurApp 0x0000000104f21880 0x104f1c000 + 22656
27 libdyld.dylib 0x000000018462456c start + 4
Today an App review team guy finally examined our case and validated our app although it was marked as rejected before.
The app got rejected 5 times in a row, with always the same message and no crash logs the last two times.
We contacted the app review team 4 days ago to appeal an app rejection with this form :https://developer.apple.com/contact/app-store/?topic=appeal
I think Apple test procedure relies heavily on automatic testing and in some cases this is not reliable, their "bot" reject our app although its working perfectly.
What Apple seems to ignore, is that we spent sleepless nights doing everything possible to find a solution so that our client had his application on time...
I wish goodluck to everyone with this problem and i can only advice you to enter in contact with apple by all means to have a person who will look at your app.
Since last week, we also suffered from rejected our applications for the similar reason.
Then, I looked at the post of #HidingGlass and applied the Unity's patch.
As a result, our applications passed Apple's review.
I'll share the result.
Reject : ver.2017.2.1f1
Accept : ver.2017.2.1p2
Funnily enough, we are having the exact same issue over here. We have been sending Apple builds to review before, and they all worked on their devices(only rejected for some minor issues), up until a couple days ago. They have rejected two of our builds due to this 'crash', despite the fact they are working fine on our test devices.
What is strange about this, is that they had the same thing to say about both our submissions:
"Your app crashed on iPad or iPhone running iOS 11.2.5 connected to an IPv6 network during our review."
Not only that, but the crash logs provided by them also reflect the same issue as yours.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000088
VM Region Info: 0x88 is not in any region.
For now, we are about to send a previous build that was working in their review, and see what they have to say about it.
As I mentioned in my comment on your question, I'm sporadically able to reproduce this crash locally by turning off wifi on my iPhone 7. After some more digging I found that someone had added this issue to the Unity issue tracker at the end of February, but it appears that the webpage for that issue was made inaccessible either today or yesterday.
The issue tracker webpage was originally accessible here:
https://issuetracker.unity3d.com/issues/unitywebrequest-ios-2017-dot-3-player-crashes-at-job-executeunitywebrequest-when-switching-to-airplane-mode
Google still has it cached here, though:
http://webcache.googleusercontent.com/search?q=cache:TcQczK0adjMJ:https://issuetracker.unity3d.com/issues/unitywebrequest-ios-2017-dot-3-player-crashes-at-job-executeunitywebrequest-when-switching-to-airplane-mode&num=1&hl=en&gl=us&strip=0&vwsrc=0
The webpage doesn't render correctly at the cached URL, but I was able to view it by viewing the source and saving it to an HTML file on my machine. Here is a screenshot of it:
The stack trace in the issue matches what I see when I reproduce the issue locally. Interestingly, the comment on the issue mentions that this is causing apps that use Vuforia to crash. I don't use Vuforia, but apparently something else in my stack (probably the GVR SDK) is sending the web request that is leading to my crash.
Update 1:
Following the recommendation in the page's comment, I downgraded to Unity 2017.2.1f and found that the crash no longer occurs. So, I'll submit this build of my app and see what happens. As you have said that you're already using that version of Unity, maybe this is actually a different problem than what you're experiencing.
Update 2:
My app update was just approved by Apple.
In our case, we've been on Unity 5.6.3p4 for the last couple of app updates in January and were approved just fine, and very quickly (less than 1 day from submission to approval). A week ago, however, the app was in the state of 'In Review' for 3 days and then we got rejection due to the same crash issue as described here, while we didn't change Unity version and didn't add any new external frameworks - so, by reading all of the other replied here, I suspect that Apple must have recently changed something in their review test bot (like started using AirPlay), which triggered these issues because of a dormant Unity bug.
It's interesting that this issue is being actively discussed in Unity issues tracker and Unity engineer just posted a work-around in the DisplayManager.mm code, and also they just backported the fix to 5.6.5p3:
https://issuetracker.unity3d.com/issues/ios-11-build-crashes-on-remotear-unityupdatedisplaylist-when-launching-app-from-url-with-airplay-connected?page=1#comments
As for us, we upgraded to 2017.1.3p2 and resubmitted, and got rejected again - but this time with a different crash report:
Termination Description: SPRINGBOARD, scene-create watchdog transgression: com.ourComany.ourApp exhausted real (wall clock) time allowance of 10.00 seconds
and this seems like some brand new issue that's being discussed here since yesterday:
https://forum.unity.com/threads/ios-crash-on-startup-unity-2017-1-3p2.521666/#post-3424784

Xcode dies on attempt to open account under preferences, issue with development certificates?

I'm attempting my first IOS build from Unity 3d.
Here's some of the output from the dump after Xcode dies. I've done a fetch/retrieve of a new developer certificate, and it seems valid in the keychain. I've also removed all old provisioning profiles from the IOS device (iphone 4S) attached. I tried removing Xcode and reinstalling it to no avail. The iphone actually does actually show up under Window->Devices in xcode. When I right click on the iphone in the device list and look at provisioning profiles I get the following:
iostpp:com.jaqen2525.hb1 Ad Hoc
iostpp:com.jaqen2525.hb1 Dev
and two others that I'm not using: so the new provisioning profiles are there, and the development certificate under the keychain looks fine, though there is one that is not quite working:
Lee Bererton's CA: This root certificate is not trusted. So I trusted it in my keychain access by right clicking and getting Info, then clicking on choosing to trust it.
Also of note, any attempt under Xcode->Preferences->Account, then opening up the provisioning profiles consistently crashes Xcode
Xcode still crashing, any thoughts?
Process: Xcode [1244]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 6.2 (6776)
Build Info: IDEFrameworks-6776000000000000~11
App Item ID: 497799835
App External ID: 811890240
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [1244]
User ID: 501
Date/Time: 2015-03-13 13:23:31.081 -0600
OS Version: Mac OS X 10.10.2 (14C1510)
Report Version: 11
Anonymous UUID: 4F9FAC01-C04A-5ECE-C8B8-4E1F44F3E7C5
Time Awake Since Boot: 4700 seconds
Crashed Thread: 17
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
ProductBuildVersion: 6C131e
ASSERTION FAILURE in /SourceCache/DVTFrameworks/DVTFrameworks-6760/DVTFoundation/DeveloperStructure/DVTExtendedPlatformInfo.m:39
Details: No Xcode.DVTFoundation.ExtendedPlatformInfo extension provided for platform 'com.apportable.platform.android'
Object: <DVTExtendedPlatformInfo>
Method: +extendedPlatformInfoForPlatformIdentifier:
Thread: <NSThread: 0x7ff48e8c78f0>{number = 26, name = (null)}
Hints: None
Backtrace:
0 0x000000010a6a81aa -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit)
1 0x000000010945f18f _DVTAssertionHandler (in DVTFoundation)
2 0x000000010945f47e _DVTAssertionFailureHandler (in DVTFoundation)
3 0x000000010947c316 +[DVTExtendedPlatformInfo extendedPlatformInfoForPlatformIdentifier:] (in DVTFoundation)
4 0x000000010947d374 -[DVTPlatform(DVTExtendedPlatformInfo) dvt_extendedInfo] (in DVTFoundation)
5 0x00000001134974b1 -[DTDKProvisioningProfile dvt_platform] (in DTDeviceKitBase)
6 0x0000000109444860 DVTProvisioningProfileAllowsEntitlements (in DVTFoundation)
7 0x000000010945b259 __216+[DVTCodesignResolver parametersForTeamID:bundleIdentifier:entitlements:requiredFeatures:applicableSigningIdentityCertificates:platform:requiredCodesignableDevices:requiresProfile:profileManager:logAspect:withError:]_block_invoke459 (in DVTFoundation)
8 0x0000000109303f76 -[NSSet(DVTNSSetAdditions) dvt_setByFilteringUsingBlock:] (in DVTFoundation)
9 0x0000000109459eab +[DVTCodesignResolver parametersForTeamID:bundleIdentifier:entitlements:requiredFeatures:applicableSigningIdentityCertificates:platform:requiredCodesignableDevices:requiresProfile:profileManager:logAspect:withError:] (in DVTFoundation)
10 0x000000010945955d +[DVTCodesignResolver parametersForTeamID:certificateKind:bundleIdentifier:entitlements:requiredFeatures:limitSearchToKeychain:platform:requiredCodesignableDevices:requiresProfile:certificateUtilities:withError:] (in DVTFoundation)
11 0x0000000112eb9a46 +[XCCodeSignContext codesignParameterSnapshotWithMacroExpansionScope:emitWarnings:certificateUtilities:error:] (in DevToolsCore)
12 0x0000000112eb9f76 +[XCCodeSignContext prepareForCodeSigningWithMacroExpansionScope:certificateUtilities:] (in DevToolsCore)
13 0x0000000112e2641e -[XCProductTypeSpecification computeDependenciesWithMacroExpansionScope:] (in DevToolsCore)
14 0x0000000112ecb8eb -[XCNativeTargetDGSnapshot(DependencyGraphCreation) computeDependenciesWithMacroExpansionScope:] (in DevToolsCore)
15 0x0000000112da43fa -[PBXTargetBuildContext createDependencyGraphWithTargetDGSnapshot:] (in DevToolsCore)
16 0x0000000112dc1e0a -[PBXTargetBuildContext(DependencyGraphEvents) dg_setTargetSnapshot:] (in DevToolsCore)
17 0x0000000112dc09a8 -[PBXTargetBuildContext(DependencyGraphEvents) processDependencyGraphEvents] (in DevToolsCore)
18 0x0000000112e1dd60 -[XCBlockQueue _processNextBlockInThreadSlotNumber:] (in DevToolsCore)
19 0x0000000112e1e030 -[XCBlockQueue _processBlocksInThreadSlotNumber:] (in DevToolsCore)
20 0x00007fff883b990a __NSThread__main__ (in Foundation)
21 0x00007fff93ae0268 _pthread_body (in libsystem_pthread.dylib)
22 0x00007fff93ae01e5 _pthread_body (in libsystem_pthread.dylib)
23 0x00007fff93ade41d thread_start (in libsystem_pthread.dylib)
abort() called
Application Specific Signatures:
((void *)0) != platformInfo
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff9357a4de mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff9357964f mach_msg + 55
2 com.apple.CoreFoundation 0x00007fff8bbaab34 __CFRunLoopServiceMachPort + 212
3 com.apple.CoreFoundation 0x00007fff8bba9ffb __CFRunLoopRun + 1371
4 com.apple.CoreFoundation 0x00007fff8bba9858 CFRunLoopRunSpecific + 296
5 com.apple.HIToolbox 0x00007fff8fca2aef RunCurrentEventLoopInMode + 235
6 com.apple.HIToolbox 0x00007fff8fca286a ReceiveNextEventCommon + 431
7 com.apple.HIToolbox 0x00007fff8fca26ab _BlockUntilNextEventMatchingListInModeWithFilter + 71
8 com.apple.AppKit 0x00007fff8642ef81 _DPSNextEvent + 964
9 com.apple.AppKit 0x00007fff8642e730 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 194
10 com.apple.dt.DVTKit 0x00000001099c6d3d -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 237
11 com.apple.AppKit 0x00007fff86422593 -[NSApplication run] + 594
12 com.apple.AppKit 0x00007fff8640da14 NSApplicationMain + 1832
13 libdyld.dylib 0x00007fff9342e5c9 start + 1
Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x00007fff93580232 kevent64 + 10
1 libdispatch.dylib 0x00007fff935a8a6a _dispatch_mgr_thread + 52
Thread 2:: com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x00007fff9357a4de mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff9357964f mach_msg + 55
2 com.apple.CoreFoundation 0x00007fff8bbaab34 __CFRunLoopServiceMachPort + 212
3 com.apple.CoreFoundation 0x00007fff8bba9ffb __CFRunLoopRun + 1371
4 com.apple.CoreFoundation 0x00007fff8bba9858 CFRunLoopRunSpecific + 296
5 com.apple.CFNetwork 0x00007fff9435fc80 +[NSURLConnection(Loader) _resourceLoadLoop:] + 434
6 com.apple.Foundation 0x00007fff883b990a __NSThread__main__ + 1345
7 libsystem_pthread.dylib 0x00007fff93ae0268 _pthread_body + 131
8 libsystem_pthread.dylib 0x00007fff93ae01e5 _pthread_start + 176
9 libsystem_pthread.dylib 0x00007fff93ade41d thread_start + 13
Thread 3:
0 libsystem_kernel.dylib 0x00007fff9357a4de mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff9357964f mach_msg + 55
2 com.apple.CoreFoundation 0x00007fff8bbaab34 __CFRunLoopServiceMachPort + 212
3 com.apple.CoreFoundation 0x00007fff8bba9ffb __CFRunLoopRun + 1371
4 com.apple.CoreFoundation 0x00007fff8bba9858 CFRunLoopRunSpecific + 296
5 com.apple.Foundation 0x00007fff883bb849 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 278
6 com.apple.DTDeviceKitBase 0x0000000113465df8 -[DTDKRemoteDeviceDataListener listenerThreadImplementation] + 970
7 com.apple.Foundation 0x00007fff883b990a __NSThread__main__ + 1345
8 libsystem_pthread.dylib 0x00007fff93ae0268 _pthread_body + 131
9 libsystem_pthread.dylib 0x00007fff93ae01e5 _pthread_start + 176
10 libsystem_pthread.dylib 0x00007fff93ade41d thread_start + 13
Thread 4:: com.apple.CFSocket.private
0 libsystem_kernel.dylib 0x00007fff9357f3fa __select + 10
1 libsystem_pthread.dylib 0x00007fff93ae0268 _pthread_body + 131
2 libsystem_pthread.dylib 0x00007fff93ae01e5 _pthread_start + 176
3 libsystem_pthread.dylib 0x00007fff93ade41d thread_start + 13
This is related to the android plugin for Sprite Builder. A quick fix until the plugin has been updated is to uninstall it. Navigate to /Library in Finder or the Terminal. Remove the directory called SBAndroid or SBAndroidStarter. Try starting xcode and it should be working again.
Keep an eye on this issue on Github and this thread on the Sprite Builder forums. Hopefully they can fix it soon.
Quit your xcode and delete plist file /Library/Preferences/com.apple.dt.Xcode.*
this worked for me :)
if its not worked for you then remove /Library/Preferences/SBAndroidStarter folder
Reinstalling the latest SpriteBuilder Android Plugin fixed this for me

Would writing to SQLite on a secondary thread cause a pthread_kill crash in Objective-C?

I've got an odd crash I'm trying to debug, and some help would be most appreciated.
My main thread crashes like so:
Thread : Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x3316ddfc __pthread_kill + 8
1 libsystem_pthread.dylib 0x331ebd37 pthread_kill + 62
2 libsystem_c.dylib 0x3310d909 abort + 76
3 libc++abi.dylib 0x324389c9 __cxa_bad_cast
4 libc++abi.dylib 0x3244fe29 std::__terminate(void (*)()) + 148
5 libc++abi.dylib 0x3244f8af __cxa_rethrow + 102
6 libobjc.A.dylib 0x32b27dd3 objc_exception_rethrow + 42
7 CoreFoundation 0x2522245d CFRunLoopRunSpecific + 632
8 CoreFoundation 0x252221d3 CFRunLoopRunInMode + 106
9 GraphicsServices 0x2c5da0a9 GSEventRunModal + 136
10 UIKit 0x28831fa1 UIApplicationMain + 1440
11 LifeLock Wallet 0x000e98b1 main (main.mm:21)
The other threads looked alright, until I saw this background thread, where I'm generating 2048-bit RSA keys:
Thread : RSA Key Gen Queue
0 libsystem_kernel.dylib 0x3315c064 fsync + 8
1 MyApp 0x00c697f5 unixSync (sqlite3.c:30624)
2 MyApp 0x00c310f5 syncJournal (sqlite3.c:19113)
3 MyApp 0x00c10d47 sqlite3PagerCommitPhaseOne (sqlite3.c:49218)
4 MyApp 0x00c1101d sqlite3BtreeCommitPhaseOne (sqlite3.c:56943)
5 MyApp 0x00c63107 sqlite3VdbeHalt (sqlite3.c:66150)
6 MyApp 0x00c62bd1 sqlite3VdbeExec (sqlite3.c:70841)
7 MyApp 0x00c11f33 sqlite3_step (sqlite3.c:68643)
8 MyApp 0x00c0cfdf sqlite3_exec (sqlite3.c:98380)
9 MyApp 0x000ee3eb +[DBHelper execStringNormal:] (DBHelper.m:88)
10 MyApp 0x000f448b +[DBHelper insertCategories] (DBHelper.m:1373)
11 MyApp 0x000f34ed +[DBHelper createDB] (DBHelper.m:1147)
12 MyApp 0x000ee97b +[DBHelper initSqlite] (DBHelper.m:212)
13 MyApp 0x000ea245 -[MyApp databaseSetup (MyAppDelegate.m:187)
14 MyApp 0x001fcc69 __37-[Security generateRSAKeyPair]_block_invoke (Security.m:317)
15 libdispatch.dylib 0x330877bb _dispatch_call_block_and_release + 10
16 libdispatch.dylib 0x3308f5b1 _dispatch_queue_drain + 952
17 libdispatch.dylib 0x33089f85 _dispatch_queue_invoke + 84
18 libdispatch.dylib 0x33090b9b _dispatch_root_queue_drain + 338
19 libdispatch.dylib 0x33091cd7 _dispatch_worker_thread3 + 94
20 libsystem_pthread.dylib 0x331e8e31 _pthread_wqthread + 668
This caught my eye because of the general flow in my code. In a nutshell:
A GCD background thread is created on app start, to generate my RSA keys.
The class that creates the RSA keys has a protocol to call back to a delegate (in this case, my app delegate), when the keys are ready.
On the same GCD background thread, I call back to my delegate object.
Once my app delegate gets called back, I open my SQLite connection and write to the local DB.
My questions are:
Would writing to the SQLite DB on a background thread cause my 'pthread_kill' crash?
Is it worth serializing my SQLite DB to ensure that, in the event I have other threads writing to SQLite, I stay thread-safe?
Thanks!

ios app rejected, need help identifying the issue

Apple rejected my app today, I tried to follow the crash log they sent but I couldn't find the source of the crash, I tested my app on two physical phones:
1- iphone 4
2- iphone 5
and I tested it on xcode simulators:
1-Ipad
2-Ipad Retina
3-Ipad Retina (64-bit)
and it works fine on all of them.
this is what they sent to me
We found that your app crashed on iPad running iOS 7.0.6, which is not in compliance with the App
Store Review Guidelines.
Your app crashed when we:
1) Start the app on a device
2) The app crashes on launch
This occurred when your app was used:
- On Wi-Fi
- On cellular network
and this one of the los they sent to me
Incident Identifier: F0618233-A16F-4782-8B79-3A2AE5D8BFF6
CrashReporter Key: 1db6124687c1282286f546adfc3c54dc0d8ed7ce
Hardware Model: xxx
Process: taptap [266]
Path: /var/mobile/Applications/.....
Identifier: x.x.x
Version: 1.0 (1.0)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2014-02-22 14:32:19.271 -0800
OS Version: iOS 7.0.6 (11B651)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
(0x2d9bff46 0x3819c6aa 0x2d9bfe88 0x2e347a66 0x8c47c 0x2d982114 0x2d8f6252 0x2e2dbc28 0x301b1f52
0x3019d4c4 0x3013841a 0x3013771c 0x3019cb38 0x325d5708 0x325d52f2 0x2d98a9da 0x2d98a976 0x2d98914a
0x2d8f3c22 0x2d8f3a06 0x3019bdd4 0x30197044 0x8fde2 0x386a4ab2)
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3875b1fc __pthread_kill + 8
1 libsystem_pthread.dylib 0x387c4a2e pthread_kill + 54
2 libsystem_c.dylib 0x3870bff8 abort + 72
3 libc++abi.dylib 0x37a3acd2 abort_message + 70
4 libc++abi.dylib 0x37a536e0 default_terminate_handler() + 248
5 libobjc.A.dylib 0x3819c91e _objc_terminate() + 190
6 libc++abi.dylib 0x37a511c4 std::__terminate(void (*)()) + 76
7 libc++abi.dylib 0x37a50d28 __cxa_rethrow + 96
8 libobjc.A.dylib 0x3819c7f2 objc_exception_rethrow + 38
9 CoreFoundation 0x2d8f3c98 CFRunLoopRunSpecific + 636
10 CoreFoundation 0x2d8f3a06 CFRunLoopRunInMode + 102
11 UIKit 0x3019bdd4 -[UIApplication _run] + 756
12 UIKit 0x30197044 UIApplicationMain + 1132
13 taptap 0x0008fde2 0x83000 + 52706
14 libdyld.dylib 0x386a4ab4 start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x3874883c kevent64 + 24
1 libdispatch.dylib 0x38689210 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x38688f96 _dispatch_mgr_thread$VARIANT$mp + 34
Thread 2:
0 libsystem_kernel.dylib 0x3875bc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x387c1dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x387c1c80 start_wqthread + 4
Thread 3:
0 libsystem_kernel.dylib 0x3875bc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x387c1dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x387c1c80 start_wqthread + 4
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x3875afa8 __psynch_mutexwait + 24
1 libsystem_pthread.dylib 0x387c1f0a _pthread_mutex_lock + 302
2 WebCore 0x35a6f7f0 _WebTryThreadLock(bool) + 104
3 WebCore 0x35a6f772 WebRunLoopLock(__CFRunLoopObserver*, unsigned long,
void*) + 42
4 CoreFoundation 0x2d98b1ca
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
5 CoreFoundation 0x2d988b6c __CFRunLoopDoObservers + 280
6 CoreFoundation 0x2d988f7c __CFRunLoopRun + 932
7 CoreFoundation 0x2d8f3c22 CFRunLoopRunSpecific + 518
8 CoreFoundation 0x2d8f3a06 CFRunLoopRunInMode + 102
9 WebCore 0x35a6e266 RunWebThread(void*) + 414
10 libsystem_pthread.dylib 0x387c3c1a _pthread_body + 138
11 libsystem_pthread.dylib 0x387c3b8a _pthread_start + 98
12 libsystem_pthread.dylib 0x387c1c8c thread_start + 4
Thread 5:
0 libsystem_kernel.dylib 0x38748a8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x38748888 mach_msg + 44
2 CoreFoundation 0x2d98a7be __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2d988ee4 __CFRunLoopRun + 780
4 CoreFoundation 0x2d8f3c22 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2d8f3a06 CFRunLoopRunInMode + 102
6 libAVFAudio.dylib 0x2c976584 GenericRunLoopThread::Entry(void*) + 124
7 libAVFAudio.dylib 0x2c96a99c CAPThread::Entry(CAPThread*) + 176
8 libsystem_pthread.dylib 0x387c3c1a _pthread_body + 138
9 libsystem_pthread.dylib 0x387c3b8a _pthread_start + 98
10 libsystem_pthread.dylib 0x387c1c8c thread_start + 4
Thread 6:
0 libsystem_kernel.dylib 0x3875bc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x387c1dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x387c1c80 start_wqthread + 4
Thread 7 name: com.apple.NSURLConnectionLoader
Thread 7:
0 libsystem_kernel.dylib 0x38748a8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x38748888 mach_msg + 44
2 CoreFoundation 0x2d98a7be __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2d988ee4 __CFRunLoopRun + 780
4 CoreFoundation 0x2d8f3c22 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2d8f3a06 CFRunLoopRunInMode + 102
6 Foundation 0x2e32e2f2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 314
7 Foundation 0x2e3a3c82 __NSThread__main__ + 1058
8 libsystem_pthread.dylib 0x387c3c1a _pthread_body + 138
9 libsystem_pthread.dylib 0x387c3b8a _pthread_start + 98
10 libsystem_pthread.dylib 0x387c1c8c thread_start + 4
Thread 8 name: com.apple.CFSocket.private
Thread 8:
0 libsystem_kernel.dylib 0x3875b440 __select + 20
1 CoreFoundation 0x2d98e680 __CFSocketManager + 480
2 libsystem_pthread.dylib 0x387c3c1a _pthread_body + 138
3 libsystem_pthread.dylib 0x387c3b8a _pthread_start + 98
4 libsystem_pthread.dylib 0x387c1c8c thread_start + 4
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x00002060
r4: 0x00000006 r5: 0x3a60618c r6: 0x00000000 r7: 0x27d80594
r8: 0x1451e760 r9: 0x00000001 r10: 0x00000000 r11: 0x403e0000
ip: 0x00000148 sp: 0x27d80588 lr: 0x387c4a33 pc: 0x3875b1fc
cpsr: 0x00000010
how could I get to the cause of this crash log, thanks
That Apple isn't providing the Binary Images section in the provided crash report makes it much harder than necessary to find out what the cause is. Without the that information it is not possible to symbolicate the Last Exception Backtrace and find out more automatically.
The reason for the crash is definitely an exception inside the app, it is not because the apps main thread was blocking for too long because in that case the report would not show a Last Exception Backtrace and look very different. But using synchronous networking requests on the main thread should never be done anyway!
So how to find out more about this exception. Since the Binary Images are missing and the symbols for the system calls are already symbolicated, it is hard to find the address ranges for each system framework. But we know the load address from the app looking at the following line:
13 taptap 0x0008fde2 0x83000 + 52706
So the load address is 0x83000. Now we take the Last Exception Backtrace addresses and search for the ones that are likely belonging to the app:
0x2d9bff46 0x3819c6aa 0x2d9bfe88 0x2e347a66 0x8c47c 0x2d982114 0x2d8f6252 0x2e2dbc28 0x301b1f52
0x3019d4c4 0x3013841a 0x3013771c 0x3019cb38 0x325d5708 0x325d52f2 0x2d98a9da 0x2d98a976 0x2d98914a
0x2d8f3c22 0x2d8f3a06 0x3019bdd4 0x30197044 0x8fde2 0x386a4ab2
The ones that should belong to the app are the following:
0x8c47c 0x8fde2
0x8fde2 is the same as in the main thread and will symbolicate to something like
13 taptap 0x0008fde2 main (main.m:14)
The interesting one is 0x8c47c, which shows up 5th place from top from the exception. To get the symbol for this one, you need the apps dSYM that you submitted to Apple. You'll find it in the organizer Archives tab. Select the app and choose the entry for the app. Right mouse click the item that you used to submit to Apple and choose Show in Finder. Then another right mouse click and choose Show Package Contents. Open the dSYMs folder.
It is unknown which iPad was used and since the Binary Images section is missing we don't know it either (which would show the used architecture and UUID to verify the architecture, binary, and dSYM). So it can be either armv7 or armv7s. The newest iPad mini with retina and the iPad Air use armv7s in 32 bit mode, all other iPads also either use armv7s or armv7. So we have to try both which may return the same results.
Now open a terminal window and type:
`xcrun atos -arch armv7s -l 0x83000 DragInTheDSYMItemFromTheFinderInHere 0x8c47c`
Then use the same if it doesn't make sense and replace armv7s with armv7.
This should give you the class, method, filename and line number where the exception occured in your app. We'll still be missing the exception reason since the crash report doesn't show that and due to missing binary images we can't really symbolicate all the other addresses and use that find out more. Hopefully this will already give an idea.
Once you have that, please update your question with the details.
UPDATE: Now that the binary images where provided, I was able to symbolicate the crash report and get the Last Exception Backtrace symbols. Although without the app symbols, since I obviously don't have the dSYM.
The symbolicated report is available here: http://pastebin.com/An10dUpi
The important frames are the following
Last Exception Backtrace:
0 CoreFoundation 0x2d9bff46 __exceptionPreprocess + 126
1 libobjc.A.dylib 0x3819c6aa objc_exception_throw + 32
2 CoreFoundation 0x2d9bfe88 +[NSException raise:format:] + 98
3 Foundation 0x2e347a66 +[NSJSONSerialization JSONObjectWithData:options:error:] + 60
4 taptap 0x8c47c 0x83000 + 38012
This shows that the crash occurs because the app tries to serialize a given NSData object into json and fails to do so, because the NSData object is not a valid json string.
When symbolicating the 4th line as described above in the post, you will get the exact line in your code where this happens.

App crash in the device, exception: 0x8badf00d

I have a problem in my app. My app is using internet connection. When I run it in the device from the Xcode its running without crashing. But when I install it fisttime it runs, but if I close the app and then try to again run after loading the splash screen it crashes. Why is that? But this is working when I'm run the app through the xcode in the device.
But when I use 3G instead of wifi it goes beyond the splash screen
Updated
Incident Identifier: 5AAF8220-55D5-4011-B14A-F9A86C624F7C
CrashReporter Key: f0828a82293c0951598f3501da6c4cc391e66276
Hardware Model: iPad1,1
Process: mMusic [303]
Path: /var/mobile/Applications/6D985396-5C2A-430D-B605-617EFA46A470/mMusic.app/mMusic
Identifier: mMusic
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2013-09-25 10:11:07.842 +0530
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x8badf00d
Highlighted Thread: 0
Application Specific Information:
com.microimage.mMusic failed to launch in time
Elapsed total CPU time (seconds): 1.050 (user 1.050, system 0.000), 5% CPU
Elapsed application CPU time (seconds): 0.237, 1% CPU
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x357fb004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x357fb1fa mach_msg + 50
2 CoreFoundation 0x357693ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x35768124 __CFRunLoopRun + 876
4 CoreFoundation 0x356eb49e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x356eb366 CFRunLoopRunInMode + 98
6 CFNetwork 0x314ade14 CFURLConnectionSendSynchronousRequest + 340
7 Foundation 0x34b304a6 +[NSURLConnection sendSynchronousRequest:returningResponse:error:] + 242
8 Foundation 0x34b54356 -[NSData(NSData) initWithContentsOfURL:] + 178
9 Foundation 0x34b85174 +[NSData(NSData) dataWithContentsOfURL:] + 36
10 mMusic 0x0013b2a4 0xa5000 + 615076
11 mMusic 0x0012fc34 0xa5000 + 568372
12 mMusic 0x000a6b96 0xa5000 + 7062
13 UIKit 0x32ecdca4 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1176
14 UIKit 0x32ec77d6 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 402
15 UIKit 0x32e95abc -[UIApplication handleEvent:withNewEvent:] + 1004
16 UIKit 0x32e95560 -[UIApplication sendEvent:] + 48
17 UIKit 0x32e94f34 _UIApplicationHandleEvent + 5820
18 GraphicsServices 0x33487224 PurpleEventCallback + 876
19 CoreFoundation 0x3576951c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
20 CoreFoundation 0x357694be __CFRunLoopDoSource1 + 134
21 CoreFoundation 0x3576830c __CFRunLoopRun + 1364
22 CoreFoundation 0x356eb49e CFRunLoopRunSpecific + 294
23 CoreFoundation 0x356eb366 CFRunLoopRunInMode + 98
24 UIKit 0x32ec6864 -[UIApplication _run] + 544
25 UIKit 0x32ec3cce UIApplicationMain + 1074
26 mMusic 0x000a638c 0xa5000 + 5004
27 mMusic 0x000a62e8 0xa5000 + 4840
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x357fb3a8 kevent + 24
1 libdispatch.dylib 0x33b2eea4 _dispatch_mgr_invoke + 708
2 libdispatch.dylib 0x33b2ebc2 _dispatch_mgr_thread + 30
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x357fb004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x357fb1fa mach_msg + 50
2 CoreFoundation 0x357693ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x35768124 __CFRunLoopRun + 876
4 CoreFoundation 0x356eb49e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x356eb366 CFRunLoopRunInMode + 98
6 WebCore 0x37431c9c _ZL12RunWebThreadPv + 396
7 libsystem_c.dylib 0x349b472e _pthread_start + 314
8 libsystem_c.dylib 0x349b45e8 thread_start + 0
Thread 3 name: com.apple.NSURLConnectionLoader
Thread 3:
0 libsystem_kernel.dylib 0x357fb004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x357fb1fa mach_msg + 50
2 CoreFoundation 0x357693ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x35768124 __CFRunLoopRun + 876
4 CoreFoundation 0x356eb49e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x356eb366 CFRunLoopRunInMode + 98
6 Foundation 0x34b30bb2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 302
7 Foundation 0x34b30a7a -[NSThread main] + 66
8 Foundation 0x34bc458a __NSThread__main__ + 1042
9 libsystem_c.dylib 0x349b472e _pthread_start + 314
10 libsystem_c.dylib 0x349b45e8 thread_start + 0
Thread 4 name: com.apple.CFSocket.private
Thread 4:
0 libsystem_kernel.dylib 0x3580b570 __select + 20
1 CoreFoundation 0x3576d63a __CFSocketManager + 726
2 libsystem_c.dylib 0x349b472e _pthread_start + 314
3 libsystem_c.dylib 0x349b45e8 thread_start + 0
Unknown thread crashed with unknown flavor: 5, state_count: 1
Looks like your application was killed by the Springboard because it failed to launch before the watchdog timer expired.
Exception Codes: 0x8badf00d
Application Specific Information:
com.microimage.mMusic failed to launch in time
It looks like you are making a synchronous call to download data at application launch. This is blocking the main thread causing application to not launch in time. You should allow the application to launch completely first and then initiate the network call on background thread (not the main thread).
Read more from these links: Link1, Link2
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.
Hope that helps!
If you get Exception Type: 00000020 and Exception Codes: 0x8badf00d in your crash log then it is due to running synchronous task on main thread. Solution is to use asynchronous task on main thread.
It is referred to as watchdog timeout crash reports. You can check this Apple document for details.
Seeing a similar crash for our watchos 3 app.
Part of the problem was it was difficult to get a complete crash report. Only when I was able to reliably reproduce the crash and repeated it 20-30 times did I get a single coherent crash report with a stack trace. Saw many partial reports with some json including kernel, crashReporterKey, memoryPages etc. but only one complete report with a stack trace.
Another problem, xcode never connected to the device while debugging. Of course, the app was killed for taking to long to start, so the debugger is of no use. Same symptoms with simulator.
Solution: we were activating our wcsession in our extension delegate's applicationDidFinishLaunching. Activation is asynchronous, so I assumed this was ok. Moving session activation to applicationDidBecomeActive have fixed the issue.

Resources