I have been getting a rare crash in my app. I am able to track it via hockey app tool integrated with the app. But, unfortunately i am not able to find out any clue about it so as to resolve it.
The crash is happening in the main method of my application in thread 0. I would like to post the stack trace for better analysis. Here it is.
Thread 0 Crashed:
0 libobjc.A.dylib 0x34ed7f46 _objc_msgSend + 6
1 UIKit 0x2ac884cf -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 472
2 UIKit 0x2ac88593 -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 52
3 UIKit 0x2ac7dd21 -[UITableView _updateVisibleCellsNow:isRecursive:] + 2266
4 UIKit 0x2aa962df -[UITableView layoutSubviews] + 184
5 UIKit 0x2a9c0677 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 512
6 QuartzCore 0x2a3e8ccd -[CALayer layoutSublayers] + 134
7 QuartzCore 0x2a3e46b5 CA::Layer::layout_if_needed(CA::Transaction*) + 358
8 QuartzCore 0x2a3e453d CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 14
9 QuartzCore 0x2a3e3f21 CA::Context::commit_transaction(CA::Transaction*) + 222
10 QuartzCore 0x2a3e3d25 CA::Transaction::commit() + 322
11 UIKit 0x2ac0bc43 _UIWindowUpdateVisibleContextOrder + 208
12 UIKit 0x2ac0bad5 +[UIWindow _prepareWindowsPassingTestForAppResume:] + 14
13 UIKit 0x2ac2c8f3 -[UIApplication _updateSnapshotAndStateRestorationArchiveForBackgroundEvent:saveState:exitIfCouldNotRestoreState:] + 200
14 UIKit 0x2ac2bda3 __80-[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:]_block_invoke_2 + 112
15 libdispatch.dylib 0x3542b8cb _dispatch_call_block_and_release + 8
16 libdispatch.dylib 0x3542b8b7 _dispatch_client_callout + 20
17 libdispatch.dylib 0x3542f0bf __dispatch_main_queue_callback_4CF + 723
18 CoreFoundation 0x274eabe9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 6
19 CoreFoundation 0x274e92e9 __CFRunLoopRun + 1510
20 CoreFoundation 0x27437621 _CFRunLoopRunSpecific + 477
21 CoreFoundation 0x27437433 _CFRunLoopRunInMode + 107
22 GraphicsServices 0x2e7bd0a9 _GSEventRunModal + 137
23 UIKit 0x2aa22359 _UIApplicationMain + 1441
The crash being in the main thread, i don't get any clue of where and how to start tracing this crash.
Any help would be highly appreciated.
Related
I seem to be getting this error after my new release and its only happening on iOS 13 with most cases of upto 83% of the crash happening on iOS 13.3.1. I am not sure how to fix this error and I have been going through the code and cannot seem to figure out the change in iOS 13 that causes scrollViewDidScroll delegate method to crash the app.
Any help is greatly appreciated. It is also important to note that I haven't been able to reproduce this error, it only happens to users in production.
Crashed: com.apple.main-thread
EXC_BREAKPOINT 0x0000000104620bb0
Crashed: com.apple.main-thread
0 Motoz-AppStore 0x104620bb0 ProfileBrowserViewController.scrollViewDidScroll(_:) + 4299967408 (<compiler-generated>:4299967408)
1 Motoz-AppStore 0x104620d54 #objc ProfileBrowserViewController.scrollViewDidScroll(_:) + 4299967828 (<compiler-generated>:4299967828)
2 UIKitCore 0x1be3c6a24 -[UIScrollView _notifyDidScroll] + 76
3 UIKitCore 0x1be3b0c34 -[UIScrollView setContentOffset:] + 1016
4 UIKitCore 0x1bd8153d4 -[UICollectionView setContentOffset:] + 48
5 UIKitCore 0x1be3cdd28 -[UIScrollView _adjustContentOffsetIfNecessary] + 60
6 UIKitCore 0x1be3af1cc -[UIScrollView setFrame:] + 484
7 UIKitCore 0x1bd802e7c -[UICollectionView setFrame:] + 460
8 UIKitCore 0x1be41b878 -[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 576
9 UIKitCore 0x1be41c510 -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 236
10 UIKitCore 0x1be355b84 -[UIScrollView(_UIOldConstraintBasedLayoutSupport) _resizeWithOldSuperviewSize:] + 52
11 CoreFoundation 0x1b9eed95c __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 16
12 CoreFoundation 0x1b9df0fb0 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 416
13 UIKitCore 0x1be41b5e4 -[UIView(Geometry) resizeSubviewsWithOldSize:] + 156
14 UIKitCore 0x1be419938 -[UIView(Geometry) setFrame:] + 700
15 UIKitCore 0x1bd8e519c -[UINavigationController _startCustomTransition:] + 1212
16 UIKitCore 0x1bd8f9168 -[UINavigationController _startDeferredTransitionIfNeeded:] + 680
17 UIKitCore 0x1bd8fa55c -[UINavigationController __viewWillLayoutSubviews] + 164
18 UIKitCore 0x1bd8dd9e0 -[UILayoutContainerView layoutSubviews] + 224
19 UIKitCore 0x1be43617c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2140
20 QuartzCore 0x1c099e2c0 -[CALayer layoutSublayers] + 284
21 QuartzCore 0x1c09a443c CA::Layer::layout_if_needed(CA::Transaction*) + 480
22 QuartzCore 0x1c09af140 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 136
23 QuartzCore 0x1c08f7884 CA::Context::commit_transaction(CA::Transaction*, double) + 304
24 QuartzCore 0x1c0921574 CA::Transaction::commit() + 676
25 QuartzCore 0x1c0921f68 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
26 CoreFoundation 0x1b9e97e68 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
27 CoreFoundation 0x1b9e92d54 __CFRunLoopDoObservers + 416
28 CoreFoundation 0x1b9e93320 __CFRunLoopRun + 1308
29 CoreFoundation 0x1b9e92adc CFRunLoopRunSpecific + 464
30 GraphicsServices 0x1c3e33328 GSEventRunModal + 104
31 UIKitCore 0x1bdfa063c UIApplicationMain + 1936
32 Motoz-AppStore 0x1043fed70 main + 17 (TeraHeaderView.swift:17)
33 libdyld.dylib 0x1b9d1c360 start + 4
I can not say a concrete answer unless you show a piece of code but there is a possibility that error might occur because of delegation structure. Just in case check your delegation of scrollviews(tableviews, collection views, embedded web-views as well). Please check the link link for more info.
I'm looking into a crash report in Fabric, and I have no idea what might have caused it. The stack trace is not particularly helpful, however it looks the app was preparing to be suspended in the background. Here is the crash message:
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x444444444444445
Here's the stack trace:
Crashed: com.apple.main-thread
0 QuartzCore 0x18680fdf0 CALayerGetLayer + 12
1 QuartzCore 0x186810540 CA::Context::invalidate() + 68
2 QuartzCore 0x1868104cc -[CAContextImpl dealloc] + 64
3 UIKit 0x188f04bc4 -[UIWindow _destroyContext] + 324
4 UIKit 0x188f049e4 +[UIWindow _prepareWindowsForAppSuspend] + 172
5 UIKit 0x188f0491c -[UIApplication _destroyContextsAndNotifySpringBoard] + 28
6 UIKit 0x189124244 __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]_block_invoke_2 + 240
7 UIKit 0x1891280f0 __65-[UIApplication _performSnapshotsWithAction:forScene:completion:]_block_invoke2283 + 148
8 FrontBoardServices 0x1856c9fc0 -[FBSSceneSnapshotAction _finishAllRequests] + 80
9 FrontBoardServices 0x1856c9d38 -[FBSSceneSnapshotAction executeRequestsWithHandler:completionHandler:expirationHandler:] + 224
10 UIKit 0x189127ee0 __65-[UIApplication _performSnapshotsWithAction:forScene:completion:]_block_invoke + 272
11 UIKit 0x1891274e0 -[UIApplication _beginSnapshotSessionForScene:withSnapshotBlock:] + 900
12 UIKit 0x189127d7c -[UIApplication _performSnapshotsWithAction:forScene:completion:] + 560
13 UIKit 0x189127ad0 -[UIApplication _handleSnapshotAction:forScene:completion:] + 156
14 UIKit 0x1891243dc __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]_block_invoke2031 + 272
15 UIKit 0x189123ffc __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]_block_invoke2017 + 1040
16 UIKit 0x189126fd8 _runAfterCACommitDeferredBlocks + 292
17 UIKit 0x189134990 _cleanUpAfterCAFlushAndRunDeferredBlocks + 92
18 UIKit 0x188e664a4 _afterCACommitHandler + 96
19 CoreFoundation 0x183ce07b0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
20 CoreFoundation 0x183cde554 __CFRunLoopDoObservers + 372
21 CoreFoundation 0x183cde984 __CFRunLoopRun + 928
22 CoreFoundation 0x183c08d10 CFRunLoopRunSpecific + 384
23 GraphicsServices 0x1854f0088 GSEventRunModal + 180
24 UIKit 0x188eddf70 UIApplicationMain + 204
25 HDWR 0x1000706dc main (AppDelegate.swift:37)
26 libdispatch.dylib 0x1837a68b8 (Missing)
Any idea how I can get to the bottom of this?
Does this seem like it might be a bug in UIKit or QuartzCore, or is it more likely to be a bug in our own code?
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x444444444444445
i think you are using nil object which is not insalized
I have my app in alpha test, and using fabric to capture the crash logs. I had encountered a crash, and I have the below trace but have no idea what is going on. I tried to reproduce it with Xcode, but hardly can reproduce.
Could any one help on this? or share some ideas?
Thread : Crashed: com.apple.main-thread
0 libsystem_platform.dylib 0x0000000197c7d8d4 OSAtomicCompareAndSwap32Barrier + 12
1 libobjc.A.dylib 0x0000000197468120 realizeClass(objc_class*) + 100
2 libobjc.A.dylib 0x000000019746c930 lookUpImpOrForward + 224
3 libobjc.A.dylib 0x0000000197477db8 _objc_msgSend_uncached_impcache + 56
4 UIKit 0x000000018b66bef4 -[UINavigationController _startCustomTransition:] + 972
5 UIKit 0x000000018b57d630 -[UINavigationController _startDeferredTransitionIfNeeded:] + 468
6 UIKit 0x000000018b57d3fc -[UINavigationController __viewWillLayoutSubviews] + 56
7 UIKit 0x000000018b57d37c -[UILayoutContainerView layoutSubviews] + 200
8 UIKit 0x000000018b4c5d2c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 572
9 QuartzCore 0x000000018ae1d994 -[CALayer layoutSublayers] + 168
10 QuartzCore 0x000000018ae18564 CA::Layer::layout_if_needed(CA::Transaction*) + 320
11 QuartzCore 0x000000018ae18408 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
12 QuartzCore 0x000000018ae17c08 CA::Context::commit_transaction(CA::Transaction*) + 276
13 QuartzCore 0x000000018ae1798c CA::Transaction::commit() + 436
14 UIKit 0x000000018b4c7c48 _UIApplicationHandleEventQueue + 1700
15 CoreFoundation 0x0000000186cd29ec __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
16 CoreFoundation 0x0000000186cd1c90 __CFRunLoopDoSources0 + 264
17 CoreFoundation 0x0000000186ccfd40 __CFRunLoopRun + 712
18 CoreFoundation 0x0000000186bfd0a4 CFRunLoopRunSpecific + 396
19 GraphicsServices 0x000000018fd975a4 GSEventRunModal + 168
20 UIKit 0x000000018b52eaa4 UIApplicationMain + 1488
21 MCompass 0x00000001001631c8 main (main.m:16)
22 libdyld.dylib 0x0000000197ad2a08 start + 4
It is hard to tell without seeing some more details, but maybe this can help: http://aplus.rs/2013/beware-a-crashing-bug-lurks-with-uinavigationcontroller-transitions/
I have a side panel view (like side drawer) in my iPad app which contains tabbar having 2 tabs. This view is beyond the ipad visible screen and become visible once we pull it from left side. This get initialize always on app launch. It crashes randomly on iOS 7.0.3 and 7.0.4 mostly on iPad 4 models. I can't reproduce it in debug mode while debugger is attached and reproducing frequency is 1% or less on release build.
It will not an iOS issue but any guess or anybody faced and solved similar problem?
Crash report:
Hardware Model: iPad3,4
Code Type: ARM (Native)
OS Version: iOS 7.0.4 (11B554a)
Crash report:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 12
Thread 0:
0 libsystem_kernel.dylib 0x38d7ebb4 syscall_thread_switch + 8
1 libsystem_platform.dylib 0x38df349c _os_lock_handoff_lock_slow + 48
2 libsystem_malloc.dylib 0x38db90f8 szone_free_definite_size + 328
3 libRIP.A.dylib 0x2e4ffb72 ripc_ReleaseClipState + 34
4 libRIP.A.dylib 0x2e503438 ripc_EndLayer + 80
5 CoreGraphics 0x2e1c25e8 CGContextEndTransparencyLayer + 36
6 UIKit 0x309e4d2a -[UIImage(TabBarItemImages) _tabBarItemImageWithTintColor:selected:metrics:style:forScreenScale:] + 902
7 UIKit 0x309e5070 -[UIImage(TabBarItemImages) _unselectedTabBarItemImageWithTintColor:metrics:style:forScreenScale:] + 36
8 UIKit 0x309e4748 -[UITabBarItem(Static) _updateImageWithTintColor:isSelected:getImageOffset:] + 552
9 UIKit 0x309e414c -[UITabBarItem(Static) _createViewForTabBar:showingBadge:withTint:idiom:] + 956
10 UIKit 0x309e3d82 -[UITabBarItem(Static) _createViewForTabBar:showingBadge:idiom:] + 34
11 UIKit 0x309e0028 -[UITabBarItem(Static) _updateViewForIdiom:positionItems:] + 156
12 UIKit 0x309e74ca -[UITabBar(Static) _configureItems:] + 402
13 UIKit 0x309e6b7e -[UITabBar(Static) _positionTabBarButtons:ignoringItem:] + 1270
14 UIKit 0x309e3b38 -[UITabBar setItems:animated:] + 1352
15 UIKit 0x309e3522 -[UITabBarController _rebuildTabBarItemsAnimated:] + 798
16 UIKit 0x309e7a74 -[UITabBarController _setSelectedViewController:] + 72
17 UIKit 0x308cdcf2 +[UIView(Animation) performWithoutAnimation:] + 70
18 UIKit 0x309eb470 -[UITabBarController _selectDefaultViewControllerIfNecessaryWithAppearanceTransitions:] + 216
19 UIKit 0x309ea8e6 -[UITabBarController viewWillAppear:] + 130
20 UIKit 0x308d66fa -[UIViewController _setViewAppearState:isAnimating:] + 342
21 CoreFoundation 0x2e080800 __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 48
22 CoreFoundation 0x2e07a21a -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 218
23 UIKit 0x308d6876 -[UIViewController _setViewAppearState:isAnimating:] + 722
24 UIKit 0x30a4ccfa -[UINavigationController _startCustomTransition:] + 842
25 UIKit 0x3096aa12 -[UINavigationController _startDeferredTransitionIfNeeded:] + 414
26 UIKit 0x3096a81c -[UINavigationController __viewWillLayoutSubviews] + 40
27 UIKit 0x3096a7b4 -[UILayoutContainerView layoutSubviews] + 180
28 UIKit 0x308bc34e -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 342
29 QuartzCore 0x3054293e -[CALayer layoutSublayers] + 138
30 QuartzCore 0x3053e162 CA::Layer::layout_if_needed(CA::Transaction*) + 346
31 QuartzCore 0x3053dff4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 12
32 QuartzCore 0x3053da08 CA::Context::commit_transaction(CA::Transaction*) + 224
33 QuartzCore 0x3053d81a CA::Transaction::commit() + 310
34 QuartzCore 0x30537548 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 52
35 CoreFoundation 0x2e102f66 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
36 CoreFoundation 0x2e1008f2 __CFRunLoopDoObservers + 282
37 CoreFoundation 0x2e100c3e __CFRunLoopRun + 734
38 CoreFoundation 0x2e06b46c CFRunLoopRunSpecific + 520
39 CoreFoundation 0x2e06b24e CFRunLoopRunInMode + 102
40 GraphicsServices 0x32d722e6 GSEventRunModal + 134
41 UIKit 0x30920840 UIApplicationMain + 1132
42 MyApp 0x0006b5f2 0x64000 + 30194
43 libdyld.dylib 0x38cdaab4 start + 0
Thread 12 Crashed:
0 libsystem_kernel.dylib 0x38d911fc __pthread_kill + 8
1 libsystem_pthread.dylib 0x38df8a4e pthread_kill + 54
2 libsystem_c.dylib 0x38d42082 __abort + 74
3 libsystem_c.dylib 0x38d42034 abort + 84
4 libsystem_malloc.dylib 0x38dbf758 szone_error + 312
5 libsystem_malloc.dylib 0x38dbf9d4 free_list_checksum_botch + 24
6 libsystem_malloc.dylib 0x38dba1a4 tiny_free_list_remove_ptr + 76
7 libsystem_malloc.dylib 0x38db9770 szone_free_definite_size + 1984
8 libsystem_blocks.dylib 0x38cf7ac2 _Block_release + 214
9 libdispatch.dylib 0x38ccae76 _dispatch_queue_drain + 370
10 libdispatch.dylib 0x38cc7f8e _dispatch_queue_invoke + 38
11 libdispatch.dylib 0x38ccb742 _dispatch_root_queue_drain + 74
12 libdispatch.dylib 0x38ccb9c0 _dispatch_worker_thread2 + 52
13 libsystem_pthread.dylib 0x38df5dfc _pthread_wqthread + 296
14 libsystem_pthread.dylib 0x38df5cc0 start_wqthread + 4
Another random crash in similar case:
Thread 0 Crashed:
0 CoreFoundation 0x311e9728 -[__NSDictionaryM objectForKey:] + 100
1 UIKit 0x33a3e855 -[UILabel _setFont:] + 209
2 UIKit 0x33b5a411 -[UITabBarButton initWithImage:selectedImage:label:withInsets:] + 293
3 UIKit 0x33b59223 -[UITabBarItem(Static) _createViewForTabBar:showingBadge:withTint:idiom:] + 1171
4 UIKit 0x33b58d87 -[UITabBarItem(Static) _createViewForTabBar:showingBadge:idiom:] + 39
5 UIKit 0x33b5502d -[UITabBarItem(Static) _updateViewForIdiom:positionItems:] + 161
6 UIKit 0x33b5c4cf -[UITabBar(Static) _configureItems:] + 407
7 UIKit 0x33b5bb83 -[UITabBar(Static) _positionTabBarButtons:ignoringItem:] + 1275
8 UIKit 0x33b58b3d -[UITabBar setItems:animated:] + 1357
9 UIKit 0x33b58527 -[UITabBarController _rebuildTabBarItemsAnimated:] + 803
10 UIKit 0x33b5ca79 -[UITabBarController _setSelectedViewController:] + 77
11 UIKit 0x33a42cf5 +[UIView(Animation) performWithoutAnimation:] + 73
12 UIKit 0x33b60475 -[UITabBarController _selectDefaultViewControllerIfNecessaryWithAppearanceTransitions:] + 221
13 UIKit 0x33b5f8eb -[UITabBarController viewWillAppear:] + 135
14 UIKit 0x33a4b6ff -[UIViewController _setViewAppearState:isAnimating:] + 347
15 CoreFoundation 0x311f5803 __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 51
16 CoreFoundation 0x311ef21d -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 221
17 UIKit 0x33a4b87b -[UIViewController _setViewAppearState:isAnimating:] + 727
18 UIKit 0x33bc1cff -[UINavigationController _startCustomTransition:] + 847
19 UIKit 0x33adfa17 -[UINavigationController _startDeferredTransitionIfNeeded:] + 419
20 UIKit 0x33adf821 -[UINavigationController __viewWillLayoutSubviews] + 45
21 UIKit 0x33adf7b9 -[UILayoutContainerView layoutSubviews] + 185
22 UIKit 0x33a31353 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 347
23 QuartzCore 0x336b7943 -[CALayer layoutSublayers] + 143
24 QuartzCore 0x336b3167 CA::Layer::layout_if_needed(CA::Transaction*) + 351
25 QuartzCore 0x336b2ff9 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 17
26 QuartzCore 0x336b2a0d CA::Context::commit_transaction(CA::Transaction*) + 229
27 QuartzCore 0x336b281f CA::Transaction::commit() + 315
28 QuartzCore 0x336ac54d CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 57
29 CoreFoundation 0x31277f69 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 21
30 CoreFoundation 0x312758f7 __CFRunLoopDoObservers + 287
31 CoreFoundation 0x31275c43 __CFRunLoopRun + 739
32 CoreFoundation 0x311e0471 CFRunLoopRunSpecific + 525
33 CoreFoundation 0x311e0253 CFRunLoopRunInMode + 107
34 GraphicsServices 0x35ee12eb GSEventRunModal + 139
35 UIKit 0x33a95845 UIApplicationMain + 1137
36 SofTestM 0x000545f7 0x4d000 + 30199
The second crash is at time of setting font at
UITabBar-->UITabBarButton->UILabel (of UITabBarButton) _setFont:
I feel this random crashes might be due to memory leaks in your application.Pardon me if i am wrong.
In your logs it is seen that you use CoreGraphics.Releasing Core Graphics( even if you have ARC) is a bit tricky as it is not 100% memory leaf proof .That is it at times takes a while to get released.
So suppose you are using core graphic objects whithin a loop then it is certain that your ipad memory will go out of bounds.
I have been trying to figure out what is causing one of the top crashes in my iOS application. It looks like there is some layout happening on a background thread which is causing it to crash. Is there any way to determine what I might be doing that is triggering this relayout? I assume from the stack that it is related to a UIWebView when my app is being brought back into the foreground.
Other stackoverflow threads on the topic seem to mention things like triggering a table reload on a background thread. As far as I can see all the webView delegate methods get called on the main thread. Is there some case where this is not true or are there some other methods which get called on a background thread and I'm just not aware?
Web Thread - Crashed.
0 WebCore _WebTryThreadLock(bool) + 297
1 WebCore _WebTryThreadLock(bool) + 288
2 WebCore WebThreadLock + 66
3 UIKit -[UIWebDocumentView(UIWebDocumentViewTextSelecting) selectionBaseWritingDirection] + 10
4 UIKit -[UITextField _currentTextAlignment] + 86
5 UIKit -[UITextField _showsClearButtonWhenNonEmpty:] + 58
6 UIKit -[UITextField _textRectForBounds:forEditing:] + 678
7 UIKit -[UITextField editingRectForBounds:] + 52
8 UIKit -[UITextField editRect] + 70
9 UIKit -[UITextField layoutSubviews] + 1320
10 UIKit -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 258
11 QuartzCore -[CALayer layoutSublayers] + 214
12 QuartzCore CA::Layer::layout_if_needed(CA::Transaction*) + 460
13 QuartzCore CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 16
14 QuartzCore CA::Context::commit_transaction(CA::Transaction*) + 238
15 QuartzCore CA::Transaction::commit() + 316
16 QuartzCore CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 60
17 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
18 CoreFoundation __CFRunLoopDoObservers + 276
19 CoreFoundation CFRunLoopRunSpecific + 394
20 CoreFoundation CFRunLoopRunInMode + 104
21 WebCore RunWebThread(void*) + 444
22 libsystem_c.dylib pthread_start + 308
Main - Thread
0 libsystem_kernel.dylib __psynch_mutexwait + 24
1 libsystem_c.dylib pthread_mutex_lock + 392
2 WebCore _WebTryThreadLock(bool) + 336
3 WebCore WebThreadLock + 66
4 WebKit -[WebDatabasePauser applicationWillEnterForeground] + 16
5 CoreFoundation _CFXNotificationPost + 1426
6 Foundation -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
7 UIKit -[UIApplication _sendWillEnterForegroundCallbacks] + 154
8 UIKit -[UIApplication _handleApplicationResumeEvent:] + 1094
9 UIKit -[UIApplication handleEvent:withNewEvent:] + 1292
10 UIKit -[UIApplication sendEvent:] + 72
11 UIKit _UIApplicationHandleEvent + 6154
12 GraphicsServices _PurpleEventCallback + 590
13 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
14 CoreFoundation __CFRunLoopDoSources0 + 212
15 CoreFoundation __CFRunLoopRun + 646
16 CoreFoundation CFRunLoopRunSpecific + 356
17 CoreFoundation CFRunLoopRunInMode + 104
18 GraphicsServices GSEventRunModal + 74
19 UIKit UIApplicationMain + 1120
20 AppName main.m line 23
It seems you are updating UI on the background thread, in your code add this line wherever you are updating your UI and you are fetching data on the background thread:
dispatch_async(dispatch_get_main_queue(), ^{
// Update data here
});
As soon as you, rather code feels that data is there on device and it's time to update the UI corresponding to new data then try and bring back main thread in action.
Hope it helps.