something strange when core data function [duplicate] - iphone

This question already has answers here:
Core Data causing app to crash while migrating
(1 answer)
Why is App crashing when loading a pre populated DB into Core Data upon first open on Older Devices?
(1 answer)
Closed 9 years ago.
In my project, sometimes when call - (void)saveContext, the app crash, keep the screen locked, nothing could be done.
I found that in function - (void)saveContext below
- (void)saveContext
{
NSError *error = nil;
NSManagedObjectContext *managedObjectContext = _dataController.managedObjectContext;
if (managedObjectContext != nil) {
if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error]) {
// Replace this implementation with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog(#"Unresolved error %#, %#", error, [error userInfo]);
abort();
}
else {
NSLog(#"save successful?");
}
}
if (error != nil) {
NSLog(#"Unresolved error %#, %#", error, [error userInfo]);
}
}
there is no output message. Core data's save function did not success and no failed error.
Why did that happen?Could somebody help me? Thanks!
crash report
Date/Time: 2013-10-03 18:05:31.016 +0800
OS Version: iOS 6.1.3 (10B329)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x000000008badf00d
Highlighted Thread: 0
Elapsed total CPU time (seconds): 11.020 (user 11.020, system 0.000), 55% CPU
Elapsed application CPU time (seconds): 9.389, 47% CPU
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libobjc.A.dylib 0x3b8745ac objc_msgSend + 12
1 CoreData 0x337f6bf4 -[NSSQLCore createAdapterOperationsForDatabaseOperation:] + 232
2 CoreData 0x337f88c0 -[NSSQLCore performChanges] + 184
3 CoreData 0x337f9a56 -[NSSQLCore saveChanges:] + 630
4 CoreData 0x3376022a -[NSSQLCore executeRequest:withContext:error:] + 506
5 CoreData 0x3375f4c4 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 1300
6 CoreData 0x337b76de -[NSManagedObjectContext save:] + 726
7 LFeCatalogue 0x000ff130 -[AppDelegate saveContext] (AppDelegate.m:329)
8 LFeCatalogue 0x00152432 -[ECatalogueDataController alertView:clickedButtonAtIndex:] (ECatalogueDataController.m:2316)
9 UIKit 0x3591dc4c -[UIAlertView(Private) _buttonClicked:] + 292
10 UIKit 0x358b10c0 -[UIApplication sendAction:to:from:forEvent:] + 68
11 UIKit 0x358b1072 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26
12 UIKit 0x358b1050 -[UIControl sendAction:to:forEvent:] + 40
13 UIKit 0x358b0906 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 498
14 UIKit 0x358b0dfc -[UIControl touchesEnded:withEvent:] + 484
15 UIKit 0x357d95ec -[UIWindow _sendTouchesForEvent:] + 520
16 UIKit 0x357c67fc -[UIApplication sendEvent:] + 376
17 UIKit 0x357c6116 _UIApplicationHandleEvent + 6150
18 GraphicsServices 0x374d15a0 _PurpleEventCallback + 588
19 GraphicsServices 0x374d11ce PurpleEventCallback + 30
20 CoreFoundation 0x33993170 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
21 CoreFoundation 0x33993112 __CFRunLoopDoSource1 + 134
22 CoreFoundation 0x33991f94 __CFRunLoopRun + 1380
23 CoreFoundation 0x33904eb8 CFRunLoopRunSpecific + 352
24 CoreFoundation 0x33904d44 CFRunLoopRunInMode + 100
25 GraphicsServices 0x374d02e6 GSEventRunModal + 70
26 UIKit 0x3581a2fc UIApplicationMain + 1116
27 LFeCatalogue 0x000fdc72 main (main.m:16)
28 libdyld.dylib 0x3bcb0b1c start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x3bd67648 kevent64 + 24
1 libdispatch.dylib 0x3bc97974 _dispatch_mgr_invoke + 792
2 libdispatch.dylib 0x3bc97654 _dispatch_mgr_thread$VARIANT$mp + 32
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x3bd66eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3bd67048 mach_msg + 36
2 CoreFoundation 0x33993040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x33991d9e __CFRunLoopRun + 878
4 CoreFoundation 0x33904eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x33904d44 CFRunLoopRunInMode + 100
6 WebCore 0x3990b500 _ZL12RunWebThreadPv + 440
7 libsystem_c.dylib 0x3bcd030e _pthread_start + 306
8 libsystem_c.dylib 0x3bcd01d4 thread_start + 4
Thread 3 name: com.apple.NSURLConnectionLoader
Thread 3:
0 libsystem_kernel.dylib 0x3bd66eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3bd67048 mach_msg + 36
2 CoreFoundation 0x33993040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x33991d9e __CFRunLoopRun + 878
4 CoreFoundation 0x33904eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x33904d44 CFRunLoopRunInMode + 100
6 Foundation 0x342513d0 +[NSURLConnection(Loader) _resourceLoadLoop:] + 304
7 Foundation 0x342d4e80 __NSThread__main__ + 968
8 libsystem_c.dylib 0x3bcd030e _pthread_start + 306
9 libsystem_c.dylib 0x3bcd01d4 thread_start + 4
Thread 4 name: com.apple.CFSocket.private
Thread 4:
0 libsystem_kernel.dylib 0x3bd77594 __select + 20
1 CoreFoundation 0x339971f2 __CFSocketManager + 674
2 libsystem_c.dylib 0x3bcd030e _pthread_start + 306
3 libsystem_c.dylib 0x3bcd01d4 thread_start + 4
Thread 5:
0 libsystem_kernel.dylib 0x3bd77d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3bcc5cf6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3bcc5a12 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3bcc58a0 start_wqthread + 4
Thread 6:
0 libsystem_kernel.dylib 0x3bd77d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3bcc5cf6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3bcc5a12 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3bcc58a0 start_wqthread + 4
Unknown thread crashed with unknown flavor: 5, state_count: 1

Related

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

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

iOS App crash with exception related to _NSFastEnumerationMutationHandler

I am currently working on an iOS app which crashes and generates the crash report provided below.We think that the app is crashing due to mutation while Fast Enumeration but the error is occurring in NSISEngine.
We also think that the issue is related to constraints of a Table View. This Table View shows info fetched from Rest Services and we are programmatically updating the DataSource in viewWillAppear().
Some of the constraints we are adding programmatically which are as follows:
Method:
1.cellForRowAtIndexPath()
Constraints:
a. Updated UILabel with attributed String to set line height:
[attributedString addAttribute:NSFontAttributeName value:self.font range:NSMakeRange(0, text.length)];
self.attributedText = attributedString;
b. Updated UIImage:
myCell.myLogo.layer.masksToBounds =YES;
myCell.myLogo.layer.opaque = NO;
[[myCell.myLogo layer] setCornerRadius:4.];
c. Border for Table View cell
mySecondCell.secondCellContainerView.layer.masksToBounds = YES;
[mySecondCell.secondCellContainerView.layer setCornerRadius:3.7];
[mySecondCell.secondCellContainerView addBorderWithColorRed:#214 Green:#214 Blue:#214];
[myCell.myLogo addBorderWithColorRed:#214 Green:#214 Blue:#214];
heightForRowAtIndexPath()
Constraints:
We are calculating height on the basis of the content which is dynamic.
We are using StoryBoard and some of the constraints are set there using Auto Layout.
I searched a lot however was unable to find a crash report similar to the one my app generated. I am new to iOS programming. Can somebody help me with debugging this crash report? If there is a constraint causing this issue, can somebody help me figure out the same? Thanks in advance.
Incident Identifier: F155875B-9FD3-425F-85B9-7595617AF52A
CrashReporter Key: aaa79870161ff1e371394b881a26e97f0066f464
Hardware Model: iPhone5,2
Process: myapp [611]
Path: /var/mobile/Applications/40D6D77C-1DBB-4F6B-BEE1-73A67C789C49/myapp.app/myapp
Identifier: com.myapp
Version: 1.0 (0.9)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2013-10-17 11:16:45.559 +0530
OS Version: iOS 7.0.2 (11A501)
Report Version: 104
Exception Type: EXC_CRASH (SIGTRAP)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x2fc9fe86 __exceptionPreprocess + 126
1 libobjc.A.dylib 0x39f9a6c2 objc_exception_throw + 34
2 CoreFoundation 0x2fc9f974 __NSFastEnumerationMutationHandler + 124
3 Foundation 0x30604f32 -[NSISEngine substituteOutAllOccurencesOfBodyVar:withExpression:] + 438
4 Foundation 0x30607ba2 -[NSISEngine pivotToMakeBodyVar:newHeadOfRowWithHead:andDropRow:] + 334
5 Foundation 0x3060594c -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 232
6 Foundation 0x3060546e -[NSISEngine optimize] + 170
7 Foundation 0x306011a8 -[NSISEngine withBehaviors:performModifications:] + 312
8 UIKit 0x32424490 -[UIView(Hierarchy) _postMovedFromSuperview:] + 292
9 UIKit 0x3243114e -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1398
10 UIKit 0x32447a9c -[UIView(Hierarchy) insertSubview:atIndex:] + 32
11 UIKit 0x325fb888 -[UINavigationBar _wrapView:inClippingViewWithLeftBoundary:rightBoundary:leftMaskImage:leftMaskIsChevron:rightMaskImage:] + 240
12 UIKit 0x325b505e -[UINavigationBar _startPopAnimationFromItems:fromBarStyle:toItems:toBarStyle:] + 1982
13 UIKit 0x324f1b88 -[UINavigationBar popNavigationItem] + 1316
14 UIKit 0x324f14a0 -[UINavigationBar _popNavigationItemWithTransition:] + 556
15 UIKit 0x326f02ac ___popViewControllerNormal_block_invoke + 152
16 UIKit 0x324d43a0 -[UINavigationController _startDeferredTransitionIfNeeded:] + 868
17 UIKit 0x324d3fe4 -[UINavigationController __viewWillLayoutSubviews] + 40
18 UIKit 0x324d3f78 -[UILayoutContainerView layoutSubviews] + 180
19 UIKit 0x3242552e -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 342
20 QuartzCore 0x320acf3e -[CALayer layoutSublayers] + 138
21 QuartzCore 0x320a8762 CA::Layer::layout_if_needed(CA::Transaction*) + 346
22 QuartzCore 0x320a85f4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 12
23 QuartzCore 0x320a8008 CA::Context::commit_transaction(CA::Transaction*) + 224
24 QuartzCore 0x320a7e1a CA::Transaction::commit() + 310
25 QuartzCore 0x320d5436 CA::Transaction::release_thread(void*) + 158
26 libsystem_pthread.dylib 0x3a5af9b0 _pthread_tsd_cleanup + 160
27 libsystem_pthread.dylib 0x3a5af732 _pthread_exit + 82
28 libsystem_pthread.dylib 0x3a5b04b8 pthread_exit + 24
29 Foundation 0x305d7ac6 +[NSThread exit] + 6
30 Foundation 0x30683de0 __NSThread__main__ + 1088
31 libsystem_pthread.dylib 0x3a5b0c58 _pthread_body + 136
32 libsystem_pthread.dylib 0x3a5b0bca _pthread_start + 98
33 libsystem_pthread.dylib 0x3a5aeccc thread_start + 4
Thread 0 Crashed:
0 libsystem_malloc.dylib 0x3a572596 szone_free_definite_size + 1510
1 UIFoundation 0x3754aab4 -[NSAttributeDictionaryEnumerator dealloc] + 68
2 libobjc.A.dylib 0x39fa5b06 objc_object::sidetable_release(bool) + 170
3 libobjc.A.dylib 0x39f9701e (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 354
4 QuartzCore 0x320a1b54 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 64
5 CoreFoundation 0x2fc6af6e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
6 CoreFoundation 0x2fc688fa __CFRunLoopDoObservers + 282
7 CoreFoundation 0x2fc68c46 __CFRunLoopRun + 734
8 CoreFoundation 0x2fbd353c CFRunLoopRunSpecific + 520
9 CoreFoundation 0x2fbd331e CFRunLoopRunInMode + 102
10 GraphicsServices 0x3490a2e6 GSEventRunModal + 134
11 UIKit 0x3248a1e0 UIApplicationMain + 1132
12 myapp 0x000aac16 main (main.mm:16)
13 libdyld.dylib 0x3a493ab4 start + 0
Thread 1:
0 libsystem_kernel.dylib 0x3a537838 kevent64 + 24
1 libdispatch.dylib 0x3a4860d0 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x3a48063e _dispatch_mgr_thread + 34
Thread 2 name: com.apple.NSURLConnectionLoader
Thread 2:
0 libsystem_kernel.dylib 0x3a537a84 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3a53787c mach_msg + 36
2 CoreFoundation 0x2fc6a55c __CFRunLoopServiceMachPort + 152
3 CoreFoundation 0x2fc68c7c __CFRunLoopRun + 788
4 CoreFoundation 0x2fbd353c CFRunLoopRunSpecific + 520
5 CoreFoundation 0x2fbd331e CFRunLoopRunInMode + 102
6 Foundation 0x3060e64c +[NSURLConnection(Loader) _resourceLoadLoop:] + 316
7 Foundation 0x30683dc2 __NSThread__main__ + 1058
8 libsystem_pthread.dylib 0x3a5b0c5a _pthread_body + 138
9 libsystem_pthread.dylib 0x3a5b0bca _pthread_start + 98
10 libsystem_pthread.dylib 0x3a5aeccc thread_start + 4
Thread 3 name: com.apple.CFSocket.private
Thread 3:
0 libsystem_kernel.dylib 0x3a54a440 select$DARWIN_EXTSN + 20
1 CoreFoundation 0x2fc6e45e __CFSocketManager + 482
2 libsystem_pthread.dylib 0x3a5b0c5a _pthread_body + 138
3 libsystem_pthread.dylib 0x3a5b0bca _pthread_start + 98
4 libsystem_pthread.dylib 0x3a5aeccc thread_start + 4
[12:37:06 PM] Devika Deshmukh: Thread 4:
0 libsystem_kernel.dylib 0x3a537a84 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3a53787c mach_msg + 36
2 CoreFoundation 0x2fc6a55c __CFRunLoopServiceMachPort + 152
3 CoreFoundation 0x2fc68c7c __CFRunLoopRun + 788
4 CoreFoundation 0x2fbd353c CFRunLoopRunSpecific + 520
5 CoreFoundation 0x2fbd331e CFRunLoopRunInMode + 102
6 Foundation 0x305c1822 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 Foundation 0x30612664 -[NSRunLoop(NSRunLoop) run] + 76
8 myapp 0x00197bdc +[AFURLConnectionOperation networkRequestThreadEntryPoint:] (AFURLConnectionOperation.m:160)
9 Foundation 0x30683dc2 __NSThread__main__ + 1058
10 libsystem_pthread.dylib 0x3a5b0c5a _pthread_body + 138
11 libsystem_pthread.dylib 0x3a5b0bca _pthread_start + 98
12 libsystem_pthread.dylib 0x3a5aeccc thread_start + 4
Thread 5:
0 libsystem_c.dylib 0x3a4fb09e __abort + 102
1 libsystem_c.dylib 0x3a4fb034 abort + 84
2 myapp 0x001bd8ea ___lldb_unnamed_function5196$$myapp + 22
3 CoreFoundation 0x2fca018a __handleUncaughtException + 578
4 libobjc.A.dylib 0x39f9a924 _objc_terminate() + 172
5 libc++abi.dylib 0x399601b0 std::__terminate(void (*)()) + 76
6 libc++abi.dylib 0x3995fa04 __cxa_throw + 112
7 libobjc.A.dylib 0x39f9a796 objc_exception_throw + 246
8 CoreFoundation 0x2fc9f974 __NSFastEnumerationMutationHandler + 124
9 Foundation 0x30604f32 -[NSISEngine substituteOutAllOccurencesOfBodyVar:withExpression:] + 438
10 Foundation 0x30607ba2 -[NSISEngine pivotToMakeBodyVar:newHeadOfRowWithHead:andDropRow:] + 334
11 Foundation 0x3060594c -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 232
12 Foundation 0x3060546e -[NSISEngine optimize] + 170
13 Foundation 0x306011a8 -[NSISEngine withBehaviors:performModifications:] + 312
14 UIKit 0x32424490 -[UIView(Hierarchy) _postMovedFromSuperview:] + 292
15 UIKit 0x3243114e -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1398
16 UIKit 0x32447a9c -[UIView(Hierarchy) insertSubview:atIndex:] + 32
17 UIKit 0x325fb888 -[UINavigationBar _wrapView:inClippingViewWithLeftBoundary:rightBoundary:leftMaskImage:leftMaskIsChevron:rightMaskImage:] + 240
18 UIKit 0x325b505e -[UINavigationBar _startPopAnimationFromItems:fromBarStyle:toItems:toBarStyle:] + 1982
19 UIKit 0x324f1b88 -[UINavigationBar popNavigationItem] + 1316
20 UIKit 0x324f14a0 -[UINavigationBar _popNavigationItemWithTransition:] + 556
21 UIKit 0x326f02ac ___popViewControllerNormal_block_invoke + 152
22 UIKit 0x324d43a2 -[UINavigationController _startDeferredTransitionIfNeeded:] + 870
23 UIKit 0x324d3fe4 -[UINavigationController __viewWillLayoutSubviews] + 40
24 UIKit 0x324d3f78 -[UILayoutContainerView layoutSubviews] + 180
25 UIKit 0x3242552e -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 342
26 QuartzCore 0x320acf3e -[CALayer layoutSublayers] + 138
27 QuartzCore 0x320a8762 CA::Layer::layout_if_needed(CA::Transaction*) + 346
28 QuartzCore 0x320a85f4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 12
29 QuartzCore 0x320a8008 CA::Context::commit_transaction(CA::Transaction*) + 224
30 QuartzCore 0x320a7e1a CA::Transaction::commit() + 310
31 QuartzCore 0x320d5436 CA::Transaction::release_thread(void*) + 158
32 libsystem_pthread.dylib 0x3a5af9b2 _pthread_tsd_cleanup + 162
33 libsystem_pthread.dylib 0x3a5af732 _pthread_exit + 82
34 libsystem_pthread.dylib 0x3a5b04b8 pthread_exit + 24
35 Foundation 0x305d7ac6 +[NSThread exit] + 6
36 Foundation 0x30683de0 __NSThread__main__ + 1088
37 libsystem_pthread.dylib 0x3a5b0c5a _pthread_body + 138
38 libsystem_pthread.dylib 0x3a5b0bca _pthread_start + 98
39 libsystem_pthread.dylib 0x3a5aeccc thread_start + 4
Thread 6:
0 libsystem_kernel.dylib 0x3a54ac7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x3a5aee06 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x3a5aecc0 start_wqthread + 4
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00280a00 r1: 0xfffff000 r2: 0x17f9a000 r3: 0x0000000c
r4: 0x17f99650 r5: 0x3c32fe08 r6: 0x3c32fe00 r7: 0x27d5cb50
r8: 0x00000001 r9: 0x00000fff r10: 0x17f99650 r11: 0x0000008a
ip: 0x17f99db0 sp: 0x27d5cb4c lr: 0x39f96e39 pc: 0x3a572596
cpsr: 0x20000030
Update:
Following is the code by which we are populating our datasource:
(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
viewWillAppearFlag = true;
if(dataFetched) {
[self setupDatasourceDetails:self.myData];
}
}
(void) setupDatasourceDetails:(NSArray *)data {
self.datasource = [MyDatasource new];
self.datasource.data=data;
[self.myTable setDataSource:self.datasource];
[self.myTable setDelegate:self.datasource];
[self.myTable reloadData];
}
//Callback from REST services
(void) onDataFetched:(NSArray *)data{
dataFetched=true;
self.myData=data;
if(viewWillAppearFlag){
[self setupDatasourceDetails:self.myData]; //the event which will occur later(either viewWillAppear or dataFetched) calls setupDatasourceDetails
}
}
Update:
The error is occurring while transition back from one view controller to another (in navigation controller).
We are using [self.navigationController popViewControllerAnimated:YES]; to transition back to the previous view controller. The transition is happening on the Main thread.
Let us know if any more information is required.
Update
It seems that our problem has been resolved. We moved the functionality from viewWillAppear to viewDidAppear. This fix seems to have resolved the issue. Does anyone know the reason why this fix worked? Please let us know. Thanks.
Two suggestions:
Check that self.datasource is defined as strong property (not
weak) (and the data property on MyDatasource)
Make sure
onDataFetched:is called on the main queue. If unsure, use this
dispatching mechanism instead:
dispatch_async(dispatch_get_main_queue(), ^{
// all update code here
});
I don't think the error is directly in the code you posted, but:
NSFastEnumerationMutationHandler
is raised when you are editing an array or dictionary while enumerating it.
For example this is wrong:
for ( id obj in anArray ) {
if ( [obj shouldRemove == YES ) {
[anArray removeObject:obj];
}
}
If you need to do that you should work with a copy of an array or use filteredArrayUsingPredicate.
Can't see all of your code, but I am thinking you need to call layoutIfNeeded before setting the constraints as the views are not calculated before ViewWillAppear. The fact that it succeeds in ViewDidAppear is because the elements have been calculated. Alternately, you could try your code in DidLayoutSubviews.

weird iPhone 0x8badf00d crash report

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

UITableView crash when selecting

I have a simple table view controller driven by the fetchedResultsController and it crashes very often when I select it and the crash log is like this;
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xc21eb7ad
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x3c0ce5d0 objc_msgSend + 16
1 UIKit 0x3623c564 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 404
2 UIKit 0x3622138c -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1312
3 UIKit 0x36238822 -[UITableView layoutSubviews] + 202
4 UIKit 0x361f48c2 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 254
5 QuartzCore 0x35fa050e -[CALayer layoutSublayers] + 210
6 QuartzCore 0x35fa00b0 CA::Layer::layout_if_needed(CA::Transaction*) + 456
7 QuartzCore 0x35fa0fd4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 12
8 QuartzCore 0x35fa09be CA::Context::commit_transaction(CA::Transaction*) + 234
9 QuartzCore 0x35fa07d0 CA::Transaction::commit() + 312
10 QuartzCore 0x35fa0634 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 56
11 CoreFoundation 0x343b793e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
12 CoreFoundation 0x343b5c34 __CFRunLoopDoObservers + 272
13 CoreFoundation 0x343b5f8e __CFRunLoopRun + 742
14 CoreFoundation 0x34329238 CFRunLoopRunSpecific + 352
15 CoreFoundation 0x343290c4 CFRunLoopRunInMode + 100
16 GraphicsServices 0x37f07336 GSEventRunModal + 70
17 UIKit 0x362452b4 UIApplicationMain + 1116
18 Introdex 0x0011e538 0xa3000 + 505144
19 Introdex 0x000a5a24 0xa3000 + 10788
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x3c5b75d0 kevent64 + 24
1 libdispatch.dylib 0x3c4f2d22 _dispatch_mgr_invoke + 806
2 libdispatch.dylib 0x3c4ee374 _dispatch_mgr_thread + 32
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x3c5b6e30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3c5b6fd0 mach_msg + 48
2 CoreFoundation 0x343b72b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x343b602c __CFRunLoopRun + 900
4 CoreFoundation 0x34329238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x343290c4 CFRunLoopRunInMode + 100
6 WebCore 0x3a328390 RunWebThread(void*) + 440
7 libsystem_c.dylib 0x3c5200de _pthread_start + 306
8 libsystem_c.dylib 0x3c51ffa4 thread_start + 4
Thread 3:
0 libsystem_kernel.dylib 0x3c5b6e30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3c5b6fd0 mach_msg + 48
2 CoreFoundation 0x343b72b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x343b602c __CFRunLoopRun + 900
4 CoreFoundation 0x34329238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x343290c4 CFRunLoopRunInMode + 100
6 Foundation 0x34c4d5be -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 Foundation 0x34cf0c40 -[NSRunLoop(NSRunLoop) run] + 76
8 Introdex 0x0021924c 0xa3000 + 1532492
9 Foundation 0x34cfa22c __NSThread__main__ + 968
10 libsystem_c.dylib 0x3c5200de _pthread_start + 306
11 libsystem_c.dylib 0x3c51ffa4 thread_start + 4
Thread 4 name: com.apple.NSURLConnectionLoader
Thread 4:
0 libsystem_kernel.dylib 0x3c5b6e30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3c5b6fd0 mach_msg + 48
2 CoreFoundation 0x343b72b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x343b602c __CFRunLoopRun + 900
4 CoreFoundation 0x34329238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x343290c4 CFRunLoopRunInMode + 100
6 Foundation 0x34c76888 +[NSURLConnection(Loader) _resourceLoadLoop:] + 304
7 Foundation 0x34cfa22c __NSThread__main__ + 968
8 libsystem_c.dylib 0x3c5200de _pthread_start + 306
9 libsystem_c.dylib 0x3c51ffa4 thread_start + 4
Thread 5 name: com.apple.CFSocket.private
Thread 5:
0 libsystem_kernel.dylib 0x3c5c7594 __select + 20
1 CoreFoundation 0x343bb474 __CFSocketManager + 676
2 libsystem_c.dylib 0x3c5200de _pthread_start + 306
3 libsystem_c.dylib 0x3c51ffa4 thread_start + 4
Thread 6 name: JavaScriptCore::BlockFree
Thread 6:
0 libsystem_kernel.dylib 0x3c5c708c __psynch_cvwait + 24
1 libsystem_c.dylib 0x3c518afc _pthread_cond_wait + 644
2 libsystem_c.dylib 0x3c518870 pthread_cond_timedwait + 40
3 JavaScriptCore 0x382fddf6 WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 102
4 JavaScriptCore 0x38410532 JSC::BlockAllocator::blockFreeingThreadMain() + 78
5 JavaScriptCore 0x38423030 WTF::wtfThreadEntryPoint(void*) + 12
6 libsystem_c.dylib 0x3c5200de _pthread_start + 306
7 libsystem_c.dylib 0x3c51ffa4 thread_start + 4
Thread 7 name: JavaScriptCore::Marking
Thread 7:
0 libsystem_kernel.dylib 0x3c5c708c __psynch_cvwait + 24
1 libsystem_c.dylib 0x3c518afc _pthread_cond_wait + 644
2 libsystem_c.dylib 0x3c522cf8 pthread_cond_wait + 36
3 JavaScriptCore 0x383a36dc JSC::SlotVisitor::drainFromShared(JSC::SlotVisitor::SharedDrainMode) + 140
4 JavaScriptCore 0x383a3620 JSC::MarkStackThreadSharedData::markingThreadMain() + 140
5 JavaScriptCore 0x38423030 WTF::wtfThreadEntryPoint(void*) + 12
6 libsystem_c.dylib 0x3c5200de _pthread_start + 306
7 libsystem_c.dylib
Can somebody please explain me what this crash log means. I could not read it properly and do not know what this actually means. It would be really great if anyone could help me.
Without looking at your code, its hard to know where you going wrong.
But still as I know If you are able show the data on Table successfully and getting crash while click on particular row.
Below are some possibilities.
1). make sure you have declared UITableViewDelegate in your controller's header file.
Solution : make sure you have this (in .h file)
#interface FavViewController : UIViewController<UITableViewDataSource,UITableViewDelegate>
2). forgot to hook-up delegate with File owner
Solution : Open Layout's XIB file --> select UITableView --> in Connection Inspector --> drag delegate to the File's Owner (as per the below image)
you can achieve same by doing it programmatically in your .m file's viewDidLoad method
favourite_tbl.delegate=self;//favourite_tbl is instance of myTableView
3). your didSelectRowAtIndexPath method (for click on row) should be like
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
selectedIndex = indexPath.row;
NSLog(#"you have selected %d",selectedIndex);
}
Feel free to drop me a comment if you have any trouble in this.

how to debug EXC_CRASH (SIGTRAP)

i'm running my app are running fine until i resume from background or with out location services, the app will crash.
the crash log shows Exception Type: EXC_CRASH (SIGTRAP)
Anybody know how to debug it ?
Exception Type: EXC_CRASH (SIGTRAP)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x36398848 __kill + 8
1 FrogFinder 0x000b5034 0x69000 + 311348
2 CoreFoundation 0x3447e980 __handleUncaughtException + 68
3 libobjc.A.dylib 0x346ce2ca _objc_terminate + 122
4 libc++abi.dylib 0x338a33be _ZL19safe_handler_callerPFvvE + 70
5 libc++abi.dylib 0x338a344a std::terminate() + 14
6 libc++abi.dylib 0x338a481e __cxa_rethrow + 82
7 libobjc.A.dylib 0x346ce22e objc_exception_rethrow + 6
8 CoreFoundation 0x343d453e CFRunLoopRunSpecific + 398
9 CoreFoundation 0x343d439e CFRunLoopRunInMode + 98
10 GraphicsServices 0x30c58fc6 GSEventRunModal + 150
11 UIKit 0x3785573c UIApplicationMain + 1084
12 FrogFinder 0x0006a7e6 0x69000 + 6118
13 FrogFinder 0x0006a7a4 0x69000 + 6052
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x363893b4 kevent + 24
1 libdispatch.dylib 0x370b3e78 _dispatch_mgr_invoke + 708
2 libdispatch.dylib 0x370b3b96 _dispatch_mgr_thread + 30
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x36389010 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x36389206 mach_msg + 50
2 CoreFoundation 0x3445241c __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x34451154 __CFRunLoopRun + 876
4 CoreFoundation 0x343d44d6 CFRunLoopRunSpecific + 294
5 CoreFoundation 0x343d439e CFRunLoopRunInMode + 98
6 WebCore 0x368a8128 _ZL12RunWebThreadPv + 396
7 libsystem_c.dylib 0x33224c16 _pthread_start + 314
8 libsystem_c.dylib 0x33224ad0 thread_start + 0
Thread 3 name: com.apple.NSURLConnectionLoader
Thread 3:
0 libsystem_kernel.dylib 0x36389010 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x36389206 mach_msg + 50
2 CoreFoundation 0x3445241c __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x34451154 __CFRunLoopRun + 876
4 CoreFoundation 0x343d44d6 CFRunLoopRunSpecific + 294
5 CoreFoundation 0x343d439e CFRunLoopRunInMode + 98
6 Foundation 0x35dd4bc2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 302
7 Foundation 0x35dd4a8a -[NSThread main] + 66
8 Foundation 0x35e6859a __NSThread__main__ + 1042
9 libsystem_c.dylib 0x33224c16 _pthread_start + 314
10 libsystem_c.dylib 0x33224ad0 thread_start + 0
Thread 4:
0 libsystem_kernel.dylib 0x36389010 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x36389206 mach_msg + 50
2 CoreFoundation 0x3445241c __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x34451154 __CFRunLoopRun + 876
4 CoreFoundation 0x343d44d6 CFRunLoopRunSpecific + 294
5 CoreFoundation 0x343d439e CFRunLoopRunInMode + 98
6 Foundation 0x35dc8b7e -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 Foundation 0x35de252c -[NSRunLoop(NSRunLoop) run] + 72
8 FrogFinder 0x000c8da6 0x69000 + 392614
9 Foundation 0x35dd4a8a -[NSThread main] + 66
10 Foundation 0x35e6859a __NSThread__main__ + 1042
11 libsystem_c.dylib 0x33224c16 _pthread_start + 314
12 libsystem_c.dylib 0x33224ad0 thread_start + 0
Thread 5 name: NetworkIO
Thread 5:
0 libsystem_kernel.dylib 0x36389010 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x36389206 mach_msg + 50
2 CoreFoundation 0x3445241c __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x34451154 __CFRunLoopRun + 876
4 CoreFoundation 0x343d44d6 CFRunLoopRunSpecific + 294
5 CoreFoundation 0x343d439e CFRunLoopRunInMode + 98
6 MapKit 0x38030412 0x38022000 + 58386
7 Foundation 0x35dd4a8a -[NSThread main] + 66
8 Foundation 0x35e6859a __NSThread__main__ + 1042
9 libsystem_c.dylib 0x33224c16 _pthread_start + 314
10 libsystem_c.dylib 0x33224ad0 thread_start + 0
You can also turn on Exception breakpoints. In XCode 4 click your project and choose the breakpoints tab. At the bottom of that tab is | + | - | search bar. Choose the + item and "Add Exeception Breakpoint". You can leave it at All or choose Objective-C. This way you will break in the debugger and be able to see what caused the exeception.
With Xcode 4.2 and iOS 5 uncaught exceptions do not seem to show in the console anymore. I would recommend adding the following or modifying your existing uncaught exception handler to dump the exceptions callstack for you.
#ifdef DEBUG
void eHandler(NSException *);
void eHandler(NSException *exception) {
NSLog(#"%#", exception);
NSLog(#"%#", [exception callStackSymbols]);
}
#endif
int main(int argc, char *argv[]) {
#ifdef DEBUG
NSSetUncaughtExceptionHandler(&eHandler);
#endif
...rest of your main function here...
}
The easiest way for this kind of crashes which are occuring during development is to add exception break points.
You can add exception breakpoint like below
Select the break points option in left menu in XCode
Add the exception break point
Add breakpoint for all the exceptions
Run the app. In most of the cases when exception occurs XCode will stop the execution and show you the line which caused the exception.