I used the code below to send mail:
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:#"my title"];
NSMutableString *emailBody = [[NSMutableString alloc] initWithString: #"Hi\n\n"];
[emailBody appendString: #"test"];
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];
[emailBody release];
The code works well on old OS version (Base SDK 5.0, Deployment Target 4.0). I just upgraded to Xcode 4.5 with iOS 6.0 as the Base SDK, Deployment Target still 4.3, and the code still works well on Simulator with 5.0, 5.1, and 6.0.
Now I installed the app to iPad with iOS 4.3.3. The MFMailComposeViewController does not appear, it hogs and the app stops working. I checked the device log, it displays:
Incident Identifier: 53CF815B-36FB-4523-8E58-03D80E6BD2D6
CrashReporter Key: e1ce74069fc4d91cdf244ef60282649f2ea4716e
Hardware Model: iPad1,1
Process: MyApp [1018]
Path: /var/mobile/Applications/75088803-4768-4CD6-A561-553F4A182229/MyApp.app/MyApp
Identifier: MyApp
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-11-16 14:29:59.959 +0800
OS Version: iPhone OS 4.3.3 (8J3)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x8badf00d
Highlighted Thread: 0
Application Specific Information:
MyApp[1018] has active assertions beyond permitted time:
{(
<SBProcessAssertion: 0x1fa0dd00> identifier: Suspending process: MyApp[1018] permittedBackgroundDuration: 10.000000 reason: suspend owner pid:30 preventSuspend preventThrottleDownCPU preventThrottleDownUI
)}
Elapsed total CPU time (seconds): 0.770 (user 0.460, system 0.310), 8% CPU
Elapsed application CPU time (seconds): 0.000, 0% CPU
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x332e5c00 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x332e5758 mach_msg + 44
2 AppSupport 0x33bbb7b8 CPDMTwoWayMessage + 164
3 AppSupport 0x33bba530 -[CPDistributedMessagingCenter _sendMessage:userInfoData:oolKey:oolData:makeServer:receiveReply:nonBlocking:error:] + 352
4 AppSupport 0x33bba0b2 -[CPDistributedMessagingCenter _sendMessage:userInfo:receiveReply:error:toTarget:selector:context:nonBlocking:] + 618
5 AppSupport 0x33bb91ae -[CPDistributedMessagingCenter _sendMessage:userInfo:receiveReply:error:toTarget:selector:context:] + 58
6 AppSupport 0x33bb9312 -[CPDistributedMessagingCenter sendMessageAndReceiveReplyName:userInfo:] + 42
7 MessageUI 0x3693c1fa _CallMessageUIServiceMethod + 182
8 MessageUI 0x3693c01e +[MFMailAccountProxy reloadAccounts] + 22
9 MessageUI 0x3693bf6c +[MFMailComposeController _refreshMailAccountsIfNecessary] + 32
10 MessageUI 0x3693bf2a +[MFMailComposeController isSetupForDelivery] + 10
11 MessageUI 0x3693be80 +[MFMailComposeViewController canSendMail] + 24
12 MessageUI 0x3693bc36 -[MFMailComposeViewController initWithComposition:contentSize:mailComposeControllerOptions:] + 42
13 MessageUI 0x3693bbf8 -[MFMailComposeViewController initWithComposition:] + 28
14 MessageUI 0x36963fac -[MFMailComposeViewController initWithNibName:bundle:] + 44
15 UIKit 0x329e8a0c -[UIViewController init] + 12
16 MyApp 0x000d09ee 0xb5000 + 113134
17 MyApp 0x000e3820 0xb5000 + 190496
18 UIKit 0x32ad1036 -[UIActionSheet(Private) _buttonClicked:] + 186
19 CoreFoundation 0x32dc956a -[NSObject(NSObject) performSelector:withObject:withObject:] + 18
20 UIKit 0x329ceec2 -[UIApplication sendAction:to:from:forEvent:] + 78
21 UIKit 0x329cee62 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26
22 UIKit 0x329cee34 -[UIControl sendAction:to:forEvent:] + 32
23 UIKit 0x329ceb86 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 350
24 UIKit 0x329cf41c -[UIControl touchesEnded:withEvent:] + 336
25 UIKit 0x329cdbee -[UIWindow _sendTouchesForEvent:] + 362
26 UIKit 0x329cd568 -[UIWindow sendEvent:] + 256
27 UIKit 0x329b630c -[UIApplication sendEvent:] + 292
28 UIKit 0x329b5c4c _UIApplicationHandleEvent + 5084
29 GraphicsServices 0x35c8ee70 PurpleEventCallback + 660
30 CoreFoundation 0x32e30a90 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
31 CoreFoundation 0x32e32838 __CFRunLoopDoSource1 + 160
32 CoreFoundation 0x32e33606 __CFRunLoopRun + 514
33 CoreFoundation 0x32dc3ebc CFRunLoopRunSpecific + 224
34 CoreFoundation 0x32dc3dc4 CFRunLoopRunInMode + 52
35 GraphicsServices 0x35c8e418 GSEventRunModal + 108
36 GraphicsServices 0x35c8e4c4 GSEventRun + 56
37 UIKit 0x329e0d62 -[UIApplication _run] + 398
38 UIKit 0x329de800 UIApplicationMain + 664
39 MyApp 0x000c95a4 0xb5000 + 83364
40 MyApp 0x000b73b8 0xb5000 + 9144
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x332e8fbc kevent + 24
1 libdispatch.dylib 0x33abc032 _dispatch_mgr_invoke + 706
2 libdispatch.dylib 0x33abd03a _dispatch_queue_invoke + 86
3 libdispatch.dylib 0x33abc5ea _dispatch_worker_thread2 + 186
4 libsystem_c.dylib 0x363d958a _pthread_wqthread + 258
5 libsystem_c.dylib 0x363d9bbc start_wqthread + 0
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x332e5c00 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x332e5758 mach_msg + 44
2 CoreFoundation 0x32e312b8 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x32e33562 __CFRunLoopRun + 350
4 CoreFoundation 0x32dc3ebc CFRunLoopRunSpecific + 224
5 CoreFoundation 0x32dc3dc4 CFRunLoopRunInMode + 52
6 WebCore 0x31e5c27e RunWebThread(void*) + 382
7 libsystem_c.dylib 0x363d830a _pthread_start + 242
8 libsystem_c.dylib 0x363d9bb4 thread_start + 0
Any comment welcome.
The stack trace looks like this is not your fault, it’s system code that hangs and leads to your app being killed. There’s a post in the Developer Forums (non-public link, sorry) that suggest that this might be connected to the system Mail.app.
I’d try rebooting the device and similar tricks, but in the end your app might still be unstable on 4.3 in general. Do you really need to support 4.3?
Related
Would really appreciate if someone could point me in right direction. My app was rejected by apple app review board stating that the application crashed at launch. Unfortunately I am unable to reproduce the crash. The relevant sections of the symbolicated crash log are listed below. Would really appreciate some guidance on resolving this
Hardware Model: xxx
Process: Havana [11291]
Path: /private/var/containers/Bundle/Application/7168627A-AC55-4E81-9FE0-05228C71B31E/Havana.app/Havana
Identifier: au.com.nextx.havana
Version: 6 (1.0)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: au.com.nextx.havana [3636]
Date/Time: 2018-09-10 18:04:16.6495 -0700
Launch Time: 2018-09-10 18:04:15.6077 -0700
OS Version: iPhone OS 11.4.1 (15G77)
Baseband Version: 6.80.00
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000101310d3c
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [0]
Triggered by Thread: 0
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libswiftCore.dylib 0x0000000101310d3c 0x101160000 + 1772860
1 libswiftCore.dylib 0x0000000101310d3c 0x101160000 + 1772860
2 libswiftCore.dylib 0x00000001011a8094 0x101160000 + 295060
3 Havana 0x0000000100dea374 #objc AppDelegate.applicationWillResignActive(_:) + 172916 (AppDelegate.swift:0)
4 UIKit 0x000000018f06ddbc -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 408
5 UIKit 0x000000018f06d1c4 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3484
6 UIKit 0x000000018f03a5e0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1680
7 UIKit 0x000000018f66ab1c __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 784
8 UIKit 0x000000018f039dd0 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 160
9 UIKit 0x000000018f039c6c -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 240
10 UIKit 0x000000018f038afc -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 724
11 UIKit 0x000000018fcce84c __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 296
12 UIKit 0x000000018f0381ec -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 432
13 UIKit 0x000000018fab3ac8 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 220
14 UIKit 0x000000018fc01bf8 _performActionsWithDelayForTransitionContext + 112
15 UIKit 0x000000018f037c0c -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 248
16 UIKit 0x000000018f0375a8 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 368
17 UIKit 0x000000018f0345e0 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 540
18 UIKit 0x000000018f034330 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 364
19 FrontBoardServices 0x0000000187c60470 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 364
20 FrontBoardServices 0x0000000187c68d6c __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 224
21 libdispatch.dylib 0x0000000184d50a60 _dispatch_client_callout + 16
22 libdispatch.dylib 0x0000000184d58170 _dispatch_block_invoke_direct$VARIANT$mp + 224
23 FrontBoardServices 0x0000000187c94878 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36
24 FrontBoardServices 0x0000000187c9451c -[FBSSerialQueue _performNext] + 404
25 FrontBoardServices 0x0000000187c94ab8 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
26 CoreFoundation 0x0000000185407404 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
27 CoreFoundation 0x0000000185406c2c __CFRunLoopDoSources0 + 276
28 CoreFoundation 0x000000018540479c __CFRunLoopRun + 1204
29 CoreFoundation 0x0000000185324da8 CFRunLoopRunSpecific + 552
30 GraphicsServices 0x000000018730a020 GSEventRunModal + 100
31 UIKit 0x000000018f344758 UIApplicationMain + 236
32 Havana 0x0000000100dc7e88 main + 32392 (ThresholdPanGesture.swift:13)
33 libdyld.dylib 0x0000000184db5fc0 start + 4
Thread 1:
0 libsystem_kernel.dylib 0x0000000184ee5d78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000185083eb4 _pthread_wqthread + 928
2 libsystem_pthread.dylib 0x0000000185083b08 start_wqthread + 4
Thread 2:
0 libsystem_pthread.dylib 0x0000000185083b04 start_wqthread + 0
Thread 3:
0 libsystem_pthread.dylib 0x0000000185083b04 start_wqthread + 0
Thread 4 name: com.apple.uikit.eventfetch-thread
Thread 4:
0 libsystem_kernel.dylib 0x0000000184ec3de8 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000184ec3c60 mach_msg + 72
2 CoreFoundation 0x0000000185406e40 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x0000000185404908 __CFRunLoopRun + 1568
4 CoreFoundation 0x0000000185324da8 CFRunLoopRunSpecific + 552
5 Foundation 0x0000000185d99674 -[NSRunLoop+ 34420 (NSRunLoop) runMode:beforeDate:] + 304
6 Foundation 0x0000000185d994dc -[NSRunLoop+ 34012 (NSRunLoop) runUntilDate:] + 84
7 UIKit 0x000000018f029768 -[UIEventFetcher threadMain] + 136
8 Foundation 0x0000000185ea9efc __NSThread__start__ + 1040
9 libsystem_pthread.dylib 0x0000000185085220 _pthread_body + 272
10 libsystem_pthread.dylib 0x0000000185085110 _pthread_body + 0
11 libsystem_pthread.dylib 0x0000000185083b10 thread_start + 4
Thread 5:
0 libsystem_pthread.dylib 0x0000000185083b04 start_wqthread + 0
In my testing, the game works good on my android 5.1 and ios 10.3.2 (iPhone 6S) devices.
But on my Apple reviewer's iPad Air 2 and iPhone 7 Plus, I get crash on game launch. I got the crashlogs and did symbolicate them, the crash log is:
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018ad39014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x000000018ae03264 pthread_kill + 112
2 libsystem_c.dylib 0x000000018acad9c4 abort + 140
3 truck 0x000000010059afc0 _GLOBAL__I_a (VerifyiPhoneSplashScreen.cpp:0)
4 truck 0x000000010059a2f4 VerifyiPhoneSplashScreen(std::string const&) (basic_string.h:238)
5 truck 0x00000001005788a8 UnityInitApplicationNoGraphics (basic_string.h:280)
6 truck 0x000000010003f718 -[UnityAppController application:didFinishLaunchingWithOptions:] (UnityAppController.mm:226)
7 UIKit 0x0000000191eda204 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 380
8 UIKit 0x00000001920e6738 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3452
9 UIKit 0x00000001920ec1e0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1684
10 UIKit 0x0000000192100d18 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke.3151 + 48
11 UIKit 0x00000001920e9474 -[UIApplication workspaceDidEndTransaction:] + 168
12 FrontBoardServices 0x000000018d8e7884 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36
13 FrontBoardServices 0x000000018d8e76f0 -[FBSSerialQueue _performNext] + 176
14 FrontBoardServices 0x000000018d8e7aa0 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
15 CoreFoundation 0x000000018bced42c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
16 CoreFoundation 0x000000018bcecd9c __CFRunLoopDoSources0 + 540
17 CoreFoundation 0x000000018bcea9a8 __CFRunLoopRun + 744
18 CoreFoundation 0x000000018bc1ada4 CFRunLoopRunSpecific + 424
19 UIKit 0x0000000191ed3384 -[UIApplication _run] + 652
20 UIKit 0x0000000191ece058 UIApplicationMain + 208
21 truck 0x00000001000322b4 main (main.mm:39)
22 libdyld.dylib 0x000000018ac2959c start + 4
Please see and let me know if any way to find out the root cause of crash. To me it looks like game doesn't go beyond the splash screen but what is the cause of it not failing on my end.
Actually this crash is not reproducing every time, even not frequently but we got this crash in our production app. I am not sure where is the problem. It is telling crash is happening in thread 4 in Environments class line number 38.
Code:
NSBundle* bundle = [NSBundle mainBundle];
NSString* envsPListPath = [bundle pathForResource:#"Environment" ofType:#"plist"];
Line 38:
NSDictionary *environments = [[NSDictionary alloc] initWithContentsOfFile:envsPListPath];
But according to exception type:00000020 , app is failed to launch in in-time.
I don't understand whats wrong with above code. Please help me out the relation b/w watchdog crash and above lines of code.
Crash Log:
Incident Identifier: FBDC0D68-9EC3-423C-A0DF-CD08EA079215
Hardware Model: iPod4,1
Process: Sparkle [16542]
Path: /var/mobile/Applications/55887817-5FD2-479A-B124-6ABF1907B339/Sparkle.app/Sparkle
Identifier: Sparkle
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2013-10-26 14:30:43.046 -0400
OS Version: iOS 6.1.3 (10B329)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x000000008badf00d
Highlighted Thread: 4
Application Specific Information:
com.xxxx.xxx failed to launch in time
Elapsed total CPU time (seconds): 15.060 (user 15.060, system 0.000), 50% CPU
Elapsed application CPU time (seconds): 1.756, 6% CPU
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x3a106eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3a107048 mach_msg + 36
2 UIKit 0x33ebb7e6 _UIPasteboardServerCreate + 158
3 UIKit 0x33ebb684 UIPasteboardServerCreate + 208
4 UIKit 0x33ebb54a -[UIPasteboard(Static) _initWithName:system:create:] + 90
5 UIKit 0x34055d9c +[UIPasteboard pasteboardWithName:create:] + 292
6 Sparkle 0x0049fe8a -[ADMS_Churn readFacebookReferrer] + 42
7 Sparkle 0x0049f5ac -[ADMS_Churn setInstallVariables] + 204
8 Sparkle 0x0049f2b0 -[ADMS_Churn setLaunchTypeVariables] + 68
9 Sparkle 0x0049ead4 -[ADMS_Churn trackSessionStart] + 40
10 Sparkle 0x0049ea56 -[ADMS_Churn resumeSession] + 46
11 Sparkle 0x004a7ae4 -[ADMS_NotificationHandler handleApplicationNotifications:] + 112
12 CoreFoundation 0x31eec034 _CFXNotificationPost + 1424
13 Foundation 0x32802594 -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
14 UIKit 0x33e03896 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1754
15 UIKit 0x33dfb846 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 694
16 UIKit 0x33da3c34 -[UIApplication handleEvent:withNewEvent:] + 1000
17 UIKit 0x33da36c8 -[UIApplication sendEvent:] + 68
18 UIKit 0x33da3116 _UIApplicationHandleEvent + 6150
19 GraphicsServices 0x35a955a0 _PurpleEventCallback + 588
20 GraphicsServices 0x35a951ce PurpleEventCallback + 30
21 CoreFoundation 0x31f70170 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
22 CoreFoundation 0x31f70112 __CFRunLoopDoSource1 + 134
23 CoreFoundation 0x31f6ef94 __CFRunLoopRun + 1380
24 CoreFoundation 0x31ee1eb8 CFRunLoopRunSpecific + 352
25 CoreFoundation 0x31ee1d44 CFRunLoopRunInMode + 100
26 UIKit 0x33dfa480 -[UIApplication _run] + 664
27 UIKit 0x33df72fc UIApplicationMain + 1116
28 Sparkle 0x003fafd2 main (main.m:18)
29 libdyld.dylib 0x3a050b1c start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x3a107648 kevent64 + 24
1 libdispatch.dylib 0x3a0404ec _dispatch_mgr_invoke + 792
2 libdispatch.dylib 0x3a032df4 _dispatch_mgr_thread$VARIANT$up + 32
Thread 2:
0 libsystem_kernel.dylib 0x3a117d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3a065cf6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3a065a12 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3a0658a0 start_wqthread + 4
Thread 3 name: WebThread
Thread 3:
0 libsystem_kernel.dylib 0x3a106eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3a107048 mach_msg + 36
2 CoreFoundation 0x31f70040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x31f6ed9e __CFRunLoopRun + 878
4 CoreFoundation 0x31ee1eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x31ee1d44 CFRunLoopRunInMode + 100
6 WebCore 0x37ecf500 RunWebThread(void*) + 440
7 libsystem_c.dylib 0x3a07030e _pthread_start + 306
8 libsystem_c.dylib 0x3a0701d4 thread_start + 4
Thread 4 name: Dispatch queue: momentumMapQueue
Thread 4:
0 libsystem_c.dylib 0x3a060332 szone_malloc_should_clear + 110
1 libsystem_c.dylib 0x3a060290 malloc_zone_malloc + 68
2 CoreFoundation 0x31eda712 _CFRuntimeCreateInstance + 210
3 CoreFoundation 0x31f7953a __CFStringCreateImmutableFunnel3 + 1882
4 CoreFoundation 0x31edd6c6 CFStringCreateWithBytes + 46
5 CoreFoundation 0x31effe76 _uniqueStringForUTF8Bytes + 90
6 CoreFoundation 0x31effd40 parseStringTag + 1304
7 CoreFoundation 0x31efe930 parseXMLElement + 2760
8 CoreFoundation 0x31efdc8e getContentObject + 450
9 CoreFoundation 0x31efe6aa parseXMLElement + 2114
10 CoreFoundation 0x31efdc8e getContentObject + 450
11 CoreFoundation 0x31efe6aa parseXMLElement + 2114
12 CoreFoundation 0x31efdc8e getContentObject + 450
13 CoreFoundation 0x31efe1c4 parseXMLElement + 860
14 CoreFoundation 0x31f0a044 _CFPropertyListCreateFromUTF8Data + 1592
15 CoreFoundation 0x31edcfb6 _CFPropertyListCreateWithData + 882
16 CoreFoundation 0x31edcbe0 CFPropertyListCreateFromXMLData + 116
17 Foundation 0x328114ea +[NSDictionary(NSDictionary) newWithContentsOf:immutable:] + 110
18 Sparkle 0x006c4f66 -[Environments initializeSharedInstance] (Environments.m:38)
19 Sparkle 0x006c4d54 +[Environments sharedInstance] (Environments.m:27)
20 Sparkle 0x006c4992 +[ConfigurationManager getLogLevel:] (ConfigurationManager.m:54)
21 Sparkle 0x006c4870 +[ConfigurationManager logLevelForFileName:] (ConfigurationManager.m:21)
22 Sparkle 0x006e824a -[NTRequestPolicy init] (NTRequestPolicy.m:38)
23 Sparkle 0x006e80f6 +[NTRequestPolicy sharedRequestPolicy] (NTRequestPolicy.m:24)
24 Sparkle 0x004f5fe8 +[WAGServiceHandler execute:requestObject:responseClass:serviceCallBack:requestType:additionalHTTPHeaders:backgroundRequest:] (WAGServiceHandler.m:39)
25 Sparkle 0x004f5ed0 +[WAGServiceHandler execute:requestObject:responseClass:serviceCallBack:requestType:] (WAGServiceHandler.m:26)
26 Sparkle 0x004f5e72 +[WAGServiceHandler execute:requestObject:responseClass:serviceCallBack:] (WAGServiceHandler.m:20)
27 Sparkle 0x0040acaa -[Mbox load] (Mbox.m:118)
28 Sparkle 0x0040bf52 -[MBoxHandler invokeMboxManager] (MBoxHandler.m:47)
29 Sparkle 0x0040d548 __39-[MomentumMapPlugIn downloadIconImages]_block_invoke (MomentumMapPlugIn.m:222)
30 libdispatch.dylib 0x3a03111c _dispatch_call_block_and_release + 8
31 libdispatch.dylib 0x3a030996 _dispatch_queue_drain$VARIANT$up + 142
32 libdispatch.dylib 0x3a030890 _dispatch_queue_invoke$VARIANT$up + 32
33 libdispatch.dylib 0x3a03f212 _dispatch_root_queue_drain + 190
34 libdispatch.dylib 0x3a03f3b4 _dispatch_worker_thread2 + 80
35 libsystem_c.dylib 0x3a065a0e _pthread_wqthread + 358
36 libsystem_c.dylib 0x3a0658a0 start_wqthread + 4
Simply put, Exception Type 20 means you are doing asynchronous networking on the main thread and when the connection or operation is slow, the App can be terminated by iOS. This will occur randomly. See this note:
https://developer.apple.com/library/ios/qa/qa1693/_index.html
If you get Exception Type: 00000020 and Exception Codes: 0x8badf00d in your crash log then it is Watchdog time out crash report.
This happens when you execute activity synchronously on main thread.
Fix for this is to use asynchronously on main thread.
This Apple document provides detail about this crash in detail.
Do one thing modify your code like that below and test.
if([[NSFileManager DefaultManger]
fileExistAtPath:envsPListPath]){
NSDictionary *environments = [[NSDictionary
dictionaryWithContentsOfFile:envsPListPath];
}
Find in which thread your app is crashing and put that thread in
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_async(dispatch_get_main_queue(), ^{
// run that crashing thread here.
});
});
I found couple of strange crash issues in my app and here is the details of it
Incident Identifier: 9ECA0354-F69F-4562-A9FC-4904319BFC72
CrashReporter Key: 7e75d7f19d6ccbb07328f3b3317626187ecbc9bb
Hardware Model: iPod5,1
Process: myApp [1760]
Path: /var/mobile/Applications/7E5B3CA8-81BA-4F6A-A2A8-1B8F4060A037/myApp.app/myApp
Identifier: myApp
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2013-09-24 11:33:16.513 +0530
OS Version: iOS 6.1.3 (10B329)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 11
Last Exception Backtrace:
0 CoreFoundation 0x342c229e __exceptionPreprocess + 158
1 libobjc.A.dylib 0x3bfa697a objc_exception_throw + 26
2 CoreFoundation 0x342c1d80 __NSFastEnumerationMutationHandler + 124
3 Foundation 0x34b62504 -[NSConcreteMapTable countByEnumeratingWithState:objects:count:] + 52
4 CoreFoundation 0x3424ad34 -[__NSFastEnumerationEnumerator nextObject] + 128
5 CoreFoundation 0x3421df0c -[NSEnumerator countByEnumeratingWithState:objects:count:] + 44
6 Foundation 0x34c7208e -[NSISEngine enumerateRows:] + 210
7 Foundation 0x34c77fda -[NSISEngine description] + 118
8 CoreFoundation 0x34232892 -[NSObject(NSObject) _copyDescription] + 30
9 CoreFoundation 0x342a32d6 __CFStringAppendFormatCore + 11134
10 CoreFoundation 0x3423dfa4 CFStringCreateWithFormatAndArguments + 68
11 CoreFoundation 0x342c2190 +[NSException raise:format:] + 52
12 Foundation 0x34c7411a -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 186
13 Foundation 0x34c76754 -[NSISEngine optimize] + 56
14 Foundation 0x34c76e6a -[NSISEngine tryToAddConstraintWithMarker:expression:integralizationAdjustment:mutuallyExclusiveConstraints:] + 630
15 Foundation 0x34c7fbba -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 390
16 UIKit 0x365033bc -[UIView(UIConstraintBasedLayout) _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:] + 124
17 UIKit 0x36503530 -[UIView(UIConstraintBasedLayout) _tryToAddConstraintWithoutUpdatingConstraintsArray:roundingAdjustment:mutuallyExclusiveConstraints:] + 32
18 UIKit 0x360ea2dc -[UIView(Internal) _didMoveFromWindow:toWindow:] + 372
19 UIKit 0x360ea5c2 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1114
20 UIKit 0x360e4e4e -[UIView(Hierarchy) _postMovedFromSuperview:] + 134
21 UIKit 0x360cc7d8 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1296
22 UIKit 0x360e9af2 -[UIScrollView(UIScrollViewInternal) _addContentSubview:atBack:] + 66
23 UIKit 0x360e993a -[UITableView(_UITableViewPrivate) _addContentSubview:atBack:] + 126
24 UIKit 0x360fc0a0 -[UITableView(_UITableViewPrivate) _updateVisibleHeadersAndFootersNow:] + 1696
25 UIKit 0x360fa506 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1810
26 UIKit 0x361117ca -[UITableView layoutSubviews] + 202
27 UIKit 0x360cd7fe -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 254
28 QuartzCore 0x35e77d86 -[CALayer layoutSublayers] + 210
29 QuartzCore 0x35e77924 CA::Layer::layout_if_needed(CA::Transaction*) + 456
30 QuartzCore 0x35e78858 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 12
31 QuartzCore 0x35e7823e CA::Context::commit_transaction(CA::Transaction*) + 234
32 QuartzCore 0x35e7804c CA::Transaction::commit() + 312
33 QuartzCore 0x35e77eac CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 56
34 CoreFoundation 0x342976c8 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16
35 CoreFoundation 0x342959bc __CFRunLoopDoObservers + 272
36 CoreFoundation 0x34295d12 __CFRunLoopRun + 738
37 CoreFoundation 0x34208eb8 CFRunLoopRunSpecific + 352
38 CoreFoundation 0x34208d44 CFRunLoopRunInMode + 100
39 GraphicsServices 0x37dd02e6 GSEventRunModal + 70
40 UIKit 0x3611e2fc UIApplicationMain + 1116
41 myApp 0x000a4aca 0xa2000 + 10954
42 libdyld.dylib 0x3c3ddb1c start + 0
It says that thread 11 is crashed but this looks like main thread crash as I can see from last line. The thread 11 stack trace looks like this
Thread 11 Crashed:
0 libsystem_kernel.dylib 0x3c4a4d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3c3f2cf6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3c3f2a12 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3c3f28a0 start_wqthread + 4
Also the crash report points out that app was crashed while doing enumeration but I am not sure how it is related to UIView and UITableView objects as I see from the stack trace. Some more info, I have tableview which shows a list if data, this is fetched from server.
Can some help me in fixing this issue?
Thanks
#nkd, why not use a Crash Reporting Manager like , Crashlytics it does a two step symbolication process, once at the app, and at the server side, to give you exact location of your crash with all thread information, testing environment etc.
I have been using this extensively, helps a lot in resolving bugs.
One of my beta testers reported that my app was crashing repeatedly on her phone, of course when I went over to look at it there weren't any problems. But I pulled the crash log and am trying to figure out how to read these things. Two of them looked pretty similar (one is posted below). I just need someone to hold my hand a little bit when it comes to staring at these. I initially was suspecting memory issues but then someone said that memory leaks don't cause crashes unless you flood yourself, and this log doesn't mention anything about memory. Can anyone give me any hints on what might have happened?
Date/Time: 2012-12-19 10:09:05.852 -0700
OS Version: iOS 6.0.1 (10A523)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x000000008badf00d
Highlighted Thread: 0
Application Specific Information:
com.graphiteGames.Capture-This failed to launch in time
Elapsed total CPU time (seconds): 2.730 (user 2.730, system 0.000), 14% CPU
Elapsed application CPU time (seconds): 0.930, 5% CPU
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x33fc40fc __psynch_mutexwait + 24
1 libsystem_c.dylib 0x35438124 pthread_mutex_lock + 388
2 Capture This 0x000a1a7a -[PFObject objectForKey:] (PFObject.m:1572)
3 Capture This 0x00092c06 -[RootTableView tableView:cellForRowAtIndexPath:] (RootTableView.m:228)
4 UIKit 0x37f49540 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 408
5 UIKit 0x37f2e306 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1306
6 UIKit 0x37f457c2 -[UITableView layoutSubviews] + 202
7 UIKit 0x37f017fe -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 254
8 QuartzCore 0x30db5d5e -[CALayer layoutSublayers] + 210
9 QuartzCore 0x30db58fc CA::Layer::layout_if_needed(CA::Transaction*) + 456
10 QuartzCore 0x30de47a2 -[CALayer layoutIfNeeded] + 138
11 UIKit 0x37fab0c4 -[UIViewController window:setupWithInterfaceOrientation:] + 204
12 UIKit 0x37faa2b0 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 3616
13 UIKit 0x37fa9482 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 42
14 UIKit 0x37fa940c -[UIWindow _setRotatableViewOrientation:duration:force:] + 64
15 UIKit 0x380df17c __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke_0 + 100
16 UIKit 0x37f67676 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 214
17 UIKit 0x37f673b8 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 688
18 UIKit 0x37f66d26 -[UIViewController _tryBecomeRootViewControllerInWindow:] + 154
19 UIKit 0x37f5de9e -[UIWindow addRootViewControllerViewIfPossible] + 366
20 UIKit 0x37f59ae0 -[UIWindow _setHidden:forced:] + 360
21 UIKit 0x37f9b1c4 -[UIWindow makeKeyAndVisible] + 56
22 UIKit 0x37f5e832 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1662
23 UIKit 0x37f5683e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 694
24 UIKit 0x37efec34 -[UIApplication handleEvent:withNewEvent:] + 1000
25 UIKit 0x37efe6c8 -[UIApplication sendEvent:] + 68
26 UIKit 0x37efe116 _UIApplicationHandleEvent + 6150
27 GraphicsServices 0x34b1e5a0 _PurpleEventCallback + 588
28 GraphicsServices 0x34b1e1ce PurpleEventCallback + 30
29 CoreFoundation 0x35e34170 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
30 CoreFoundation 0x35e34112 __CFRunLoopDoSource1 + 134
31 CoreFoundation 0x35e32f94 __CFRunLoopRun + 1380
32 CoreFoundation 0x35da5eb8 CFRunLoopRunSpecific + 352
33 CoreFoundation 0x35da5d44 CFRunLoopRunInMode + 100
34 UIKit 0x37f55478 -[UIApplication _run] + 664
35 UIKit 0x37f522f4 UIApplicationMain + 1116
36 Capture This 0x0008b8ba main (main.m:16)
37 libdyld.dylib 0x34a94b1c start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x33fb4648 kevent64 + 24
1 libdispatch.dylib 0x34a7d4ec _dispatch_mgr_invoke + 792
2 libdispatch.dylib 0x34a6fdf4 _dispatch_mgr_thread$VARIANT$up + 32
Thread 2 name: Dispatch queue: com.apple.root.default-priority
Thread 2:
0 libsystem_kernel.dylib 0x33fc408c __psynch_cvwait + 24
1 libsystem_c.dylib 0x35440d2a _pthread_cond_wait + 642
2 libsystem_c.dylib 0x3544af14 pthread_cond_wait + 36
3 Foundation 0x3592aa4c -[__NSOperationInternal waitUntilFinished] + 144
4 Capture This 0x000e4710 -[PFNetworkCommandRunner runInOperation:callback:] (PFNetworkCommandRunner.m:84)
5 Capture This 0x000e4f1e -[PFRetryingCommandRunner runInOperation:callback:] (PFRetryingCommandRunner.m:52)
6 Capture This 0x000e5cba -[PFOperation runInThisThread:] (PFOperation.m:32)
7 Capture This 0x0009dbb2 -[PFObject(Private) fetchWithLocking:error:] (PFObject.m:942)
8 Capture This 0x000ae44e -[PFUser fetchWithLocking:error:] (PFUser.m:1001)
9 Capture This 0x000a1520 __39-[PFObject fetchInBackgroundWithBlock:]_block_invoke_0 (PFObject.m:1500)
10 Capture This 0x000d3db6 __25-[PFBackgroundTask start]_block_invoke_0 (PFBackgroundTask.m:59)
11 libdispatch.dylib 0x34a6e11c _dispatch_call_block_and_release + 8
12 libdispatch.dylib 0x34a7c254 _dispatch_root_queue_drain + 256
13 libdispatch.dylib 0x34a7c3b4 _dispatch_worker_thread2 + 80
14 libsystem_c.dylib 0x3543da0e _pthread_wqthread + 358
15 libsystem_c.dylib 0x3543d8a0 start_wqthread + 4
Thread 3 name: WebThread
Thread 3:
0 libsystem_kernel.dylib 0x33fb3eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x33fb4048 mach_msg + 36
2 CoreFoundation 0x35e34040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x35e32d9e __CFRunLoopRun + 878
4 CoreFoundation 0x35da5eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x35da5d44 CFRunLoopRunInMode + 100
6 WebCore 0x31a8aa40 _ZL12RunWebThreadPv + 440
7 libsystem_c.dylib 0x3544830e _pthread_start + 306
8 libsystem_c.dylib 0x354481d4 thread_start + 4
Thread 4:
0 libsystem_kernel.dylib 0x33fb3eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x33fb4048 mach_msg + 36
2 CoreFoundation 0x35e34040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x35e32d9e __CFRunLoopRun + 878
4 CoreFoundation 0x35da5eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x35da5d44 CFRunLoopRunInMode + 100
6 Foundation 0x358df78a -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 Foundation 0x35983058 -[NSRunLoop(NSRunLoop) run] + 76
8 Capture This 0x000d7c9a +[PFNetworkingUtils networkThreadMain] (PFNetworkingUtils.m:32)
9 Foundation 0x3598c678 __NSThread__main__ + 968
10 libsystem_c.dylib 0x3544830e _pthread_start + 306
11 libsystem_c.dylib 0x354481d4 thread_start + 4
Thread 5:
0 libsystem_kernel.dylib 0x33fc4d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3543dcf6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3543da12 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3543d8a0 start_wqthread + 4
Thread 6:
0 libsystem_kernel.dylib 0x33fc408c __psynch_cvwait + 24
1 libsystem_c.dylib 0x35440d2a _pthread_cond_wait + 642
2 libsystem_c.dylib 0x3544af14 pthread_cond_wait + 36
3 Foundation 0x35908cca -[NSCondition wait] + 190
4 Capture This 0x000c89a8 -[PFCommandCache runLoop] (PFCommandCache.m:491)
5 Foundation 0x3598c678 __NSThread__main__ + 968
6 libsystem_c.dylib 0x3544830e _pthread_start + 306
7 libsystem_c.dylib 0x354481d4 thread_start + 4
Thread 7:
0 libsystem_kernel.dylib 0x33fb3eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x33fb4048 mach_msg + 36
2 CoreFoundation 0x35e34040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x35e32d9e __CFRunLoopRun + 878
4 CoreFoundation 0x35da5eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x35da5d44 CFRunLoopRunInMode + 100
6 Foundation 0x358df78a -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 Foundation 0x35983058 -[NSRunLoop(NSRunLoop) run] + 76
8 Capture This 0x000eb5f0 +[PF_AFURLConnectionOperation networkRequestThreadEntryPoint:] (PF_AFURLConnectionOperation.m:151)
9 Foundation 0x3598c678 __NSThread__main__ + 968
10 libsystem_c.dylib 0x3544830e _pthread_start + 306
11 libsystem_c.dylib 0x354481d4 thread_start + 4
Thread 8 name: com.apple.NSURLConnectionLoader
Thread 8:
0 libsystem_kernel.dylib 0x33fb3eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x33fb4048 mach_msg + 36
2 CoreFoundation 0x35e34040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x35e32d9e __CFRunLoopRun + 878
4 CoreFoundation 0x35da5eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x35da5d44 CFRunLoopRunInMode + 100
6 Foundation 0x35908bc8 +[NSURLConnection(Loader) _resourceLoadLoop:] + 304
7 Foundation 0x3598c678 __NSThread__main__ + 968
8 libsystem_c.dylib 0x3544830e _pthread_start + 306
9 libsystem_c.dylib 0x354481d4 thread_start + 4
Thread 9 name: com.apple.CFSocket.private
Thread 9:
0 libsystem_kernel.dylib 0x33fc4594 __select + 20
1 CoreFoundation 0x35e381f2 __CFSocketManager + 674
2 libsystem_c.dylib 0x3544830e _pthread_start + 306
3 libsystem_c.dylib 0x354481d4 thread_start + 4
Unknown thread crashed with unknown flavor: 5, state_count: 1
And the app did finish launching method as requested:
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[Parse setApplicationId:#"key"
clientKey:#"key"];
[PFFacebookUtils initializeWithApplicationId:#"id"];
[application registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge|
UIRemoteNotificationTypeAlert|
UIRemoteNotificationTypeSound];
//--set background and camera images
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (![defaults objectForKey:BACKGROUND_IMAGE]){
[[NSUserDefaults standardUserDefaults] setObject:#"background0.png" forKey:BACKGROUND_IMAGE];
}
if (![defaults objectForKey:CAMERA_BUTTON]){
[defaults setObject:#"cameraButton0.png" forKey:CAMERA_BUTTON];
}
if (![defaults objectForKey:PURCHASED_CAMERAS]){
NSMutableArray *cameras = [[NSMutableArray alloc] init];
[cameras addObject:#"cameraButton0.png"];
[defaults setObject:cameras forKey:PURCHASED_CAMERAS];
}
if (![defaults objectForKey:PURCHASED_BACKGROUNDS]){
NSMutableArray *back = [[NSMutableArray alloc] init];
[back addObject:#"background0.png"];
[defaults setObject:back forKey:PURCHASED_BACKGROUNDS];
}
if ([PFUser currentUser]){
[[PFUser currentUser] refreshInBackgroundWithBlock:^(PFObject *object, NSError *error) {
if (error){
[[[UIAlertView alloc] initWithTitle:#"Couldn't refresh user data" message:#"Please try again later" delegate:nil cancelButtonTitle:#"OK" otherButtonTitles: nil] show];
}
[Utilities refreshCurrentUser];
}];
}
[[UIApplication sharedApplication] cancelAllLocalNotifications];
return YES;
}
From what I understand, iOS has a watchdog checking for applications running at all times. When the application doesn't respond for more than 20 seconds, the application is automatically killed. Not sure if this is what's happening here, but it might be the case.
I'd start looking at processes running at application startup. Some people might encounter that kind of problem when they have a lot of applications loaded and running in the background, slowing down processing, which could appear as the application not responding.