determining what originated a crash in my code - ios

I'm getting crashes in a user's device (I see it in Crashalytics)
The thing is that the core dump is all iOS internal stuff.
How can I see what peice of my code originated the draw that made the crash?
Terminating app due to an uncaught exception 'NSInvalidArgumentException', reason: '-[NSAttributeDictionary textContainerForAttributedString:containerSize:lineFragmentPadding:]: unrecognized selector sent to instance 0x15dc7f20'
0 CoreFoundation 0x30065f23 +154
1 libobjc.A.dylib 0x3a7fcce7 objc_exception_throw+38
2 CoreFoundation 0x30069837 +202
3 CoreFoundation 0x30068137 +706
4 CoreFoundation 0x2ffb7098 _CF_forwarding_prep_0+24
5 UIFoundation 0x37ce5915 +12252
6 UIFoundation 0x37ce2863 +150
7 UIKit 0x328ae2c9 +4224
8 UIKit 0x32914709 +500
9 UIKit 0x3291450b +78
10 UIKit 0x329144a9 +372
11 QuartzCore 0x32540189 +100
12 QuartzCore 0x32529c5b +1858
13 QuartzCore 0x32605c1d +52
14 QuartzCore 0x3252950b +82
15 QuartzCore 0x325291bf +1118
16 QuartzCore 0x3250cd41 +208
17 QuartzCore 0x3250c9d9 +24
18 QuartzCore 0x3250c3e5 +228
19 QuartzCore 0x3250c1f7 +314
20 QuartzCore 0x325398e3 +162
21 libsystem_pthread.dylib 0x3ae176d1 +164
22 libsystem_pthread.dylib 0x3ae17453 +86
23 libsystem_pthread.dylib 0x3ae181b9 pthread_exit+28
24 Foundation 0x309a2703 +10
25 Foundation 0x30a4ea2d +1092
26 libsystem_pthread.dylib 0x3ae18959 +140
27 libsystem_pthread.dylib 0x3ae188cb _pthread_start+102
** Edit **
A different thread that crashed in this run (which again gives me no hints to the original point in my code)
Thread : Crashed: Thread
0 libsystem_c.dylib 0x3ad6206a __abort + 101
1 libsystem_c.dylib 0x3ad6206b __abort + 102
2 libsystem_c.dylib 0x3ad62005 __abort
3 libc++abi.dylib 0x3a1b098f abort_message + 74
4 libc++abi.dylib 0x3a1c96e7 default_terminate_handler() + 254
5 libobjc.A.dylib 0x3a7fcf7d _objc_terminate() + 192
6 libc++abi.dylib 0x3a1c71b3 std::__terminate(void (*)()) + 78
7 libc++abi.dylib 0x3a1c6a09 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*)
8 libobjc.A.dylib 0x3a7fcdbb objc_exception_throw + 250
9 CoreFoundation 0x30069837 -[NSObject(NSObject) doesNotRecognizeSelector:] + 202
10 CoreFoundation 0x30068137 ___forwarding___ + 706
11 CoreFoundation 0x2ffb7098 _CF_forwarding_prep_0 + 24
12 UIFoundation 0x37ce5915 __NSStringDrawingEngine + 12252
13 UIFoundation 0x37ce2863 -[NSString(NSExtendedStringDrawing) drawWithRect:options:attributes:context:] + 150
14 UIKit 0x328ae2c9 -[UILabel _drawTextInRect:baselineCalculationOnly:] + 4224
15 UIKit 0x32914709 -[UILabel drawTextInRect:] + 500
16 UIKit 0x3291450b -[UILabel drawRect:] + 78
17 UIKit 0x329144a9 -[UIView(CALayerDelegate) drawLayer:inContext:] + 372
18 QuartzCore 0x32540189 -[CALayer drawInContext:] + 100
19 QuartzCore 0x32529c5b CABackingStoreUpdate_ + 1858
20 QuartzCore 0x32605c1d ___ZN2CA5Layer8display_Ev_block_invoke + 52
21 QuartzCore 0x3252950b x_blame_allocations + 82
22 QuartzCore 0x325291bf CA::Layer::display_() + 1118
23 QuartzCore 0x3250cd41 CA::Layer::display_if_needed(CA::Transaction*) + 208
24 QuartzCore 0x3250c9d9 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 24
25 QuartzCore 0x3250c3e5 CA::Context::commit_transaction(CA::Transaction*) + 228
26 QuartzCore 0x3250c1f7 CA::Transaction::commit() + 314
27 QuartzCore 0x325398e3 CA::Transaction::release_thread(void*) + 162
28 libsystem_pthread.dylib 0x3ae176d1 _pthread_tsd_cleanup + 164
29 libsystem_pthread.dylib 0x3ae17453 _pthread_exit + 86
30 libsystem_pthread.dylib 0x3ae181b9 pthread_exit + 28
31 Foundation 0x309a2703 +[NSThread exit] + 10
32 Foundation 0x30a4ea2d __NSThread__main__ + 1092
33 libsystem_pthread.dylib 0x3ae18959 _pthread_body + 140
34 libsystem_pthread.dylib 0x3ae188cb _pthread_start + 102

What's unusual is that you are only getting this crash in production and not in development. That's probably due to poor testing, however another possible reason is making assumptions about the type of data you are working with, and this data is difficult to replicate in development.
JSON is a common and classic example of this, where a server can provide a string response that is magically turned into a hierarchy of objects. The code then assumes the top-level objects is a dictionary or array and starts calling methods which are unrecognised.
In your case though, you are not testing properly before release.
(this doesn't really provide an answer, but I feel you have everything you need to provide yourself with the answer, if you can be bothered to use it).

Related

SwiftUI - Fatal Exception: NSInternalInconsistencyException

Fatal Exception: NSInternalInconsistencyException
Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.
I am getting these occasional crashes in Firebase Crashlytics which I can't fathom out or reproduce (I'm new to debugging). Here is some of the info logged in Crashlytics but I can't see anything that looks familiar or that points to where its happening.
I'm guessing that something has happened in the background thread that shouldn't have but I have no idea where this is occurring in the app, hence I have not included any code.
Is there anything hidden in this list that I am missing that may give more of a clue? There are more threads listed in Crashlytics if needed but not much is in them.
Thanks in advance.
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0xa248 __exceptionPreprocess
1 libobjc.A.dylib 0x17a68 objc_exception_throw
2 CoreAutoLayout 0xde84 NSISLinExpReplaceVarWithVarPlusDelta
3 CoreAutoLayout 0x4e60 -[NSISEngine withBehaviors:performModifications:]
4 UIKitCore 0xac03c __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke
5 UIKitCore 0xd4544 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]
6 UIKitCore 0xd4154 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke
7 UIKitCore 0x1022750 -[UIView _postMovedFromSuperview:]
8 UIKitCore 0x1ed38 -[UIView(Internal) _addSubview:positioned:relativeTo:]
9 UIKitCore 0x508b88 -[_UITextLayoutCanvasView textViewportLayoutController:configureRenderingSurfaceForTextLayoutFragment:]
10 UIFoundation 0xb299c __48-[NSTextViewportLayoutController layoutViewport]_block_invoke_4
11 UIFoundation 0x5f720 __80-[NSTextLayoutManager enumerateViewportElementsFromLocation:options:usingBlock:]_block_invoke
12 UIFoundation 0x36ea8 __83-[NSTextLayoutManager enumerateTextLayoutFragmentsFromLocation:options:usingBlock:]_block_invoke_2
13 CoreFoundation 0xa760 __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__
14 CoreFoundation 0x378ec -[__NSSingleObjectArrayI enumerateObjectsWithOptions:usingBlock:]
15 UIFoundation 0x36b78 __83-[NSTextLayoutManager enumerateTextLayoutFragmentsFromLocation:options:usingBlock:]_block_invoke
16 UIFoundation 0x20210 -[NSTextLayoutManager enumerateTextLayoutFragmentsFromLocation:options:usingBlock:]
17 UIFoundation 0x1ff70 -[NSTextLayoutManager enumerateViewportElementsFromLocation:options:usingBlock:]
18 UIFoundation 0x1fa88 -[NSTextViewportLayoutController layoutViewport]
19 UIKitCore 0x316d0 +[UIView(Animation) performWithoutAnimation:]
20 UIKitCore 0x8af4 -[_UITextLayoutCanvasView layoutSubviews]
21 UIKitCore 0x4cec -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
22 QuartzCore 0xa4e8 CA::Layer::layout_if_needed(CA::Transaction*)
23 QuartzCore 0x1db9c CA::Layer::layout_and_display_if_needed(CA::Transaction*)
24 QuartzCore 0x2f098 CA::Context::commit_transaction(CA::Transaction*, double, double*)
25 QuartzCore 0x663c4 CA::Transaction::commit()
26 QuartzCore 0xb6658 CA::Transaction::release_thread(void*)
27 libsystem_pthread.dylib 0x1bd8 _pthread_tsd_cleanup
28 libsystem_pthread.dylib 0x4674 _pthread_exit
29 libsystem_pthread.dylib 0x10e0 pthread_main_np
30 libsystem_pthread.dylib 0xe80 _pthread_wqthread
31 libsystem_pthread.dylib 0xb98 start_wqthread
com.apple.main-thread
0 libsystem_kernel.dylib 0xb48 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x13008 mach_msg2_internal + 80
2 libsystem_kernel.dylib 0x13248 mach_msg_overwrite + 388
3 libsystem_kernel.dylib 0x108c mach_msg + 24
4 CoreFoundation 0x7ae00 __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x7c044 __CFRunLoopRun + 1232
6 CoreFoundation 0x811e4 CFRunLoopRunSpecific + 612
7 GraphicsServices 0x1368 GSEventRunModal + 164
8 UIKitCore 0x3a2d88 -[UIApplication _run] + 888
9 UIKitCore 0x3a29ec UIApplicationMain + 340
10 SwiftUI 0x1dace8 OUTLINED_FUNCTION_895 + 2424
11 SwiftUI 0x137c24 block_copy_helper.1 + 388
12 SwiftUI 0x120b44 OUTLINED_FUNCTION_901 + 2804
13 MyApp 0x496c main + 4372253036 (<compiler-generated>:4372253036)
14 ??? 0x1d3e95948 (Missing)

iOS App Crash On PushViewController, but only in TestFlight

In my app, I have a TestFlight beta. It loads fine, and all the buttons and actions work, except for clicking on one section of the TableView, when I click that, it crashes every time. But, only in TestFlight beta installs. On Xcode Simulator it runs fine, if debugging on my phone by plugging into computer and running, it works fine. When I open the crash log in Xcode, I get the image below, but it doesn't really tell me anything. Here is the crash log:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x195260164 __exceptionPreprocess + 228 (NSException.m:199)
1 libobjc.A.dylib 0x194f74c1c objc_exception_throw + 60 (objc-exception.mm:565)
2 CoreFoundation 0x19514fbb8 +[NSException raise:format:] + 112 (NSException.m:155)
3 UIKitCore 0x198cf0d14 -[UISearchDisplayController initWithCoder:] + 88 (UISearchDisplayController.m:350)
4 UIFoundation 0x1988c793c UINibDecoderDecodeObjectForValue + 728 (UINibDecoder.m:717)
5 UIFoundation 0x198862d50 -[UINibDecoder decodeObjectForKey:] + 312 (UINibDecoder.m:811)
6 UIKitCore 0x199029668 -[UIRuntimeConnection initWithCoder:] + 132 (UIRuntimeConnection.m:22)
7 UIFoundation 0x1988c793c UINibDecoderDecodeObjectForValue + 728 (UINibDecoder.m:717)
8 UIFoundation 0x1988c7b5c UINibDecoderDecodeObjectForValue + 1272 (UINibDecoder.m:611)
9 UIFoundation 0x198862d50 -[UINibDecoder decodeObjectForKey:] + 312 (UINibDecoder.m:811)
10 UIKitCore 0x199024638 -[NSCoder(UIIBDependencyInjectionInternal) _decodeObjectsWithSourceSegueTemplate:creator:sender:f... + 492 (UIClassSwapper.m:57)
11 UIKitCore 0x199027200 -[UINib instantiateWithOwner:options:] + 1068 (UINib.m:347)
12 UIKitCore 0x198d3dea4 -[UIViewController _loadViewFromNibNamed:bundle:] + 368 (UIViewController.m:3105)
13 UIKitCore 0x198d3e954 -[UIViewController loadView] + 180 (UIViewController.m:3247)
14 UIKitCore 0x198d3ec24 -[UIViewController loadViewIfRequired] + 188 (UIViewController.m:3346)
15 UIKitCore 0x198d3f30c -[UIViewController view] + 32 (UIViewController.m:3404)
16 UIKitCore 0x198c9afa4 -[UINavigationController _startCustomTransition:] + 1148 (UINavigationController.m:1893)
17 UIKitCore 0x198caf478 -[UINavigationController _startDeferredTransitionIfNeeded:] + 692 (UINavigationController.m:6719)
18 UIKitCore 0x198cb0818 -[UINavigationController __viewWillLayoutSubviews] + 176 (UINavigationController.m:6988)
19 UIKitCore 0x198c934fc -[UILayoutContainerView layoutSubviews] + 228 (UILayoutContainerView.m:86)
20 UIKitCore 0x1998766a0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2168 (UIView.m:17176)
21 QuartzCore 0x19bec94a0 -[CALayer layoutSublayers] + 292 (CALayer.mm:9644)
22 QuartzCore 0x19bec98e0 CA::Layer::layout_if_needed(CA::Transaction*) + 472 (CALayer.mm:9518)
23 QuartzCore 0x19bedbdc4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 144 (CALayer.mm:2468)
24 QuartzCore 0x19be20884 CA::Context::commit_transaction(CA::Transaction*, double) + 304 (CAContextInternal.mm:1992)
25 QuartzCore 0x19be4b3d0 CA::Transaction::commit() + 656 (CATransactionInternal.mm:438)
26 UIKitCore 0x1993d48cc _afterCACommitHandler + 144 (UIApplication.m:3120)
27 CoreFoundation 0x1951dac54 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36 (CFRunLoop.c:1758)
28 CoreFoundation 0x1951d58e4 __CFRunLoopDoObservers + 420 (CFRunLoop.c:1868)
29 CoreFoundation 0x1951d5d84 __CFRunLoopRun + 1020 (CFRunLoop.c:2910)
30 CoreFoundation 0x1951d5660 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)
31 GraphicsServices 0x19f5e6604 GSEventRunModal + 164 (GSEvent.c:2246)
32 UIKitCore 0x1993aa15c UIApplicationMain + 1944 (UIApplication.m:4820)
33 Ministry League 0x104093b48 main + 76 (main.m:16)
34 libdyld.dylib 0x1950511ec start + 4
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000195046df0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x0000000194f66930 pthread_kill + 228 (pthread.c:1458)
2 libsystem_c.dylib 0x0000000194ef48b4 abort + 104 (abort.c:110)
3 libc++abi.dylib 0x0000000195019f40 abort_message + 132 (abort_message.cpp:76)
4 libc++abi.dylib 0x000000019500b8c8 demangling_terminate_handler() + 308 (cxa_default_handlers.cpp:65)
5 libobjc.A.dylib 0x0000000194f74f0c _objc_terminate() + 132 (objc-exception.mm:701)
6 libc++abi.dylib 0x00000001950193cc std::__terminate(void (*)()) + 20 (cxa_handlers.cpp:59)
7 libc++abi.dylib 0x000000019501c154 __cxa_rethrow + 148 (cxa_exception.cpp:617)
8 libobjc.A.dylib 0x0000000194f74de8 objc_exception_rethrow + 44 (objc-exception.mm:604)
9 CoreFoundation 0x00000001951d56d0 CFRunLoopRunSpecific + 592 (CFRunLoop.c:3206)
10 GraphicsServices 0x000000019f5e6604 GSEventRunModal + 164 (GSEvent.c:2246)
11 UIKitCore 0x00000001993aa15c UIApplicationMain + 1944 (UIApplication.m:4820)
12 Ministry League 0x0000000104093b48 main + 76 (main.m:16)
13 libdyld.dylib 0x00000001950511ec start + 4
What this crash log tells me is that the app is loading a NIB that includes a UISearchDisplayController when it throws an exception. UISearchDisplayController is deprecated, and should be replaced with a UISearchController. The first thing I'd try is making that replacement.

Fatal Exception: NSInternalInconsistencyException how to find offending code?

I've this random crash in live app. I know how to fix it. I want to know how to find out offending code as the crashlytics log doesn't show any code in my app. Is this crashlytics crash?
Since it's random crash I can't debug it.
Any pointer to find out offending code will be appreciated.
Fatal Exception: NSInternalInconsistencyException
Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x196676a48 __exceptionPreprocess
1 libobjc.A.dylib 0x19639dfa4 objc_exception_throw
2 Foundation 0x196b4cf08 -[NSISEngine tryToOptimizeReturningMutuallyExclusiveConstraints]
3 Foundation 0x196957d34 -[NSISEngine _optimizeWithoutRebuilding]
4 Foundation 0x196957c4c -[NSISEngine optimize]
5 Foundation 0x1969578c0 -[NSISEngine performPendingChangeNotifications]
6 UIKitCore 0x19ab6c9e0 -[UIView(Hierarchy) layoutSubviews]
7 UIKitCore 0x19ab7f3d0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
8 QuartzCore 0x19d0e27dc -[CALayer layoutSublayers]
9 QuartzCore 0x19d0e8958 CA::Layer::layout_if_needed(CA::Transaction*)
10 QuartzCore 0x19d0f3578 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
11 QuartzCore 0x19d03bf1c CA::Context::commit_transaction(CA::Transaction*, double)
12 QuartzCore 0x19d065c08 CA::Transaction::commit()
13 QuartzCore 0x19d066b8c CA::Transaction::release_thread(void*)
14 libsystem_pthread.dylib 0x196394fb0 _pthread_tsd_cleanup
15 libsystem_pthread.dylib 0x196391de8 _pthread_exit
16 libsystem_pthread.dylib 0x196392e7c _pthread_wqthread_legacy_worker_wrap
17 libsystem_pthread.dylib 0x196392c18 _pthread_wqthread
18 libsystem_pthread.dylib 0x196395760 start_wqthread
Crashed: com.twitter.crashlytics.ios.exception
EXC_BREAKPOINT 0x00000001962dd8e0
Crashed: com.twitter.crashlytics.ios.exception
0 myApp 0x10101f028 CLSProcessRecordAllThreads + 376 (CLSProcess.c:376)
1 myApp 0x10101f410 CLSProcessRecordAllThreads + 407 (CLSProcess.c:407)
2 myApp 0x10100f114 CLSHandler + 26 (CLSHandler.m:26)
3 myApp 0x10101d63c __CLSExceptionRecord_block_invoke + 198 (CLSException.mm:198)
4 libdispatch.dylib 0x196343184 _dispatch_client_callout + 16
5 libdispatch.dylib 0x1962f5c04 _dispatch_lane_barrier_sync_invoke_and_complete + 56
6 myApp 0x10101d0e4 CLSExceptionRecord + 205 (CLSException.mm:205)
7 myApp 0x10101cf18 CLSExceptionRecordNSException + 102 (CLSException.mm:102)
8 myApp 0x10101cb3c CLSTerminateHandler() + 258 (CLSException.mm:258)
9 libc++abi.dylib 0x196443304 std::__terminate(void (*)()) + 16
10 libc++abi.dylib 0x196442c58 __cxa_get_exception_ptr + 30
11 libc++abi.dylib 0x196442c18 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 122
12 libobjc.A.dylib 0x19639e0d0 _objc_exception_destructor(void*) + 354
13 Foundation 0x196b4cf08 -[NSISEngine tryToOptimizeReturningMutuallyExclusiveConstraints] + 318
14 Foundation 0x196957d34 -[NSISEngine _optimizeWithoutRebuilding] + 68
15 Foundation 0x196957c4c -[NSISEngine optimize] + 112
16 Foundation 0x1969578c0 -[NSISEngine performPendingChangeNotifications] + 112
17 UIKitCore 0x19ab6c9e0 -[UIView(Hierarchy) layoutSubviews] + 308
18 UIKitCore 0x19ab7f3d0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2140
19 QuartzCore 0x19d0e27dc -[CALayer layoutSublayers] + 284
20 QuartzCore 0x19d0e8958 CA::Layer::layout_if_needed(CA::Transaction*) + 480
21 QuartzCore 0x19d0f3578 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 136
22 QuartzCore 0x19d03bf1c CA::Context::commit_transaction(CA::Transaction*, double) + 304
23 QuartzCore 0x19d065c08 CA::Transaction::commit() + 676
24 QuartzCore 0x19d066b8c CA::Transaction::release_thread(void*) + 228
25 libsystem_pthread.dylib 0x196394fb0 _pthread_tsd_cleanup + 580
26 libsystem_pthread.dylib 0x196391de8 _pthread_exit + 80
27 libsystem_pthread.dylib 0x196392e7c _pthread_wqthread_legacy_worker_wrap + 94
28 libsystem_pthread.dylib 0x196392c18 _pthread_wqthread + 420
29 libsystem_pthread.dylib 0x196395760 start_wqthread + 8
I've seen a similar stacktrace on crashes that come from Ads SDKs. Do you have and ads in your app? or WKWebviews? If yes, try to disable them and check if the crash still happens.

Puzzling crash at application launch

Many of my users get the crash describes in the below stack trace.
As you can read it seems to happen at the application launch and it does not involved any of our methods if we did not take into account the standard main call at line 28.
I do not know how to fix this bug as I do not manage to reproduce it and the below stack trace is not helpful for me.
The bug appears only on iOS9 (93% iOS9.2, 4% iOS 9.1.0, etc..)
Maybe someone know what to do in this case?
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x180911bd0 objc_msgSend + 16
1 Foundation 0x181b7b5f4 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 372
2 Foundation 0x181c2430c _NSSetPointValueAndNotify + 284
3 UIKit 0x18608e798 -[UIView(Geometry) _applyISEngineLayoutValues] + 656
4 UIKit 0x185f9b458 -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 136
5 CoreFoundation 0x181188370 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 132
6 CoreFoundation 0x181188268 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 308
7 UIKit 0x185f89f8c -[UIView(Geometry) resizeSubviewsWithOldSize:] + 148
8 UIKit 0x18608e8e0 -[UIView(AdditionalLayoutSupport) _is_layout] + 128
9 UIKit 0x1862931f0 -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 756
10 UIKit 0x185f7f778 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 656
11 QuartzCore 0x18398eb2c -[CALayer layoutSublayers] + 148
12 QuartzCore 0x183989738 CA::Layer::layout_if_needed(CA::Transaction*) + 292
13 QuartzCore 0x1839895f8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
14 QuartzCore 0x183988c94 CA::Context::commit_transaction(CA::Transaction*) + 252
15 QuartzCore 0x1839889dc CA::Transaction::commit() + 512
16 QuartzCore 0x1839820cc CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 80
17 CoreFoundation 0x181248588 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
18 CoreFoundation 0x18124632c __CFRunLoopDoObservers + 372
19 CoreFoundation 0x18124675c __CFRunLoopRun + 928
20 CoreFoundation 0x181175680 CFRunLoopRunSpecific + 384
21 GraphicsServices 0x182684088 GSEventRunModal + 180
22 UIKit 0x185fecd90 UIApplicationMain + 204
23 once 0x1000f0f00 main (main.m:14)
24 libdispatch.dylib 0x180d168b8 (Missing)
As an additional information I'm using AFNetworking. Here is the AFNetworking thread stack trace that does not crash:
Thread : AFNetworking
0 libsystem_kernel.dylib 0x180e194bc mach_msg_trap + 8
1 libsystem_kernel.dylib 0x180e19338 mach_msg + 72
2 CoreFoundation 0x181248ac0 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x1812467c4 __CFRunLoopRun + 1032
4 CoreFoundation 0x181175680 CFRunLoopRunSpecific + 384
5 Foundation 0x181b6d21c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 308
6 Foundation 0x181bc2874 -[NSRunLoop(NSRunLoop) run] + 88
7 once 0x1001ddf9c +[AFURLConnectionOperation networkRequestThreadEntryPoint:] (AFURLConnectionOperation.m:169)
8 Foundation 0x181c53c40 __NSThread__start__ + 1000
9 libsystem_pthread.dylib 0x180efbb28 _pthread_body + 156
Maybe it could help.
Thank you for your help!
I found another entry in SO with a stack that's eerily similar to yours. There was a resolution involving the removal of a setTranslatesAutoresizingMaskIntoConstraints:NO in a subview.
issue with reentering of view with [UIView(Geometry) _applyISEngineLayoutValues] in iOS8 but not iOS7
At application startup, this could only be your main view controller or the launchScreen if you have a xib/storyboard for it.

Strange iOS tableView/CALayer crashes

My app started crashing after long time in background right when I launch it again.
The problem of course is when it wasn't killed - only when it was in the background.
the log is:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x32858a1c __pthread_kill + 8
1 libsystem_c.dylib 0x337013b4 pthread_kill + 52
2 libsystem_c.dylib 0x336f9bf8 abort + 72
3 libstdc++.6.dylib 0x30504a64 __gnu_cxx::__verbose_terminate_handler() + 376
4 libobjc.A.dylib 0x3068f06c _objc_terminate + 104
5 libstdc++.6.dylib 0x30502e36 __cxxabiv1::__terminate(void (*)()) + 46
6 libstdc++.6.dylib 0x30502e8a std::terminate() + 10
7 libstdc++.6.dylib 0x30502f5a __cxa_throw + 78
8 libobjc.A.dylib 0x3068dc84 objc_exception_throw + 64
9 CoreFoundation 0x3351048a +[NSException raise:format:arguments:] + 62
10 Foundation 0x326ea56c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 56
11 UIKit 0x31bc3a82 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 666
12 UIKit 0x31bc3764 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 28
13 UIKit 0x31bbc0c6 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 930
14 UIKit 0x31bbb276 -[UITableView layoutSubviews] + 134
15 UIKit 0x31b675f4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 20
16 CoreFoundation 0x3347defc -[NSObject(NSObject) performSelector:withObject:] + 16
17 QuartzCore 0x33351bae -[CALayer layoutSublayers] + 114
18 QuartzCore 0x33351966 CALayerLayoutIfNeeded + 178
19 QuartzCore 0x333571be CA::Context::commit_transaction(CA::Transaction*) + 206
20 QuartzCore 0x33356fd0 CA::Transaction::commit() + 184
21 QuartzCore 0x3335004e CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 50
22 CoreFoundation 0x334e7a2e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 10
23 CoreFoundation 0x334e945e __CFRunLoopDoObservers + 406
24 CoreFoundation 0x334ea754 __CFRunLoopRun + 848
25 CoreFoundation 0x3347aebc CFRunLoopRunSpecific + 224
26 CoreFoundation 0x3347adc4 CFRunLoopRunInMode + 52
27 GraphicsServices 0x311a5418 GSEventRunModal + 108
28 GraphicsServices 0x311a54c4 GSEventRun + 56
29 UIKit 0x31b90d62 -[UIApplication _run] + 398
30 UIKit 0x31b8e800 UIApplicationMain + 664
31 Vento 0x00002c64 main (main.m:14)
32 Vento 0x00002c0c start + 32
Any idea where to start digging?
Thank you!
Look at the log to see the exception detail.
Run the static code analyzer over your code. It may find the bug for you.

Resources