6

I have an app out in the field that started crashing sometime in iOS 11 with the following message:

CRASH: Engine marked as needing optimization even though it's already in progress.

The crash is somewhere in UIKit -> Foundation -> CoreFoundation -> libocj.A.dylib -> CoreFoundation, but the crash logs I get are redacted, so I don't know much more than that. I normally symbolicate them, but the symbolication only works for my app, not for library code, so I'll need to get a device from the field shipped here to get the full crash log from the device.

Until then, does anyone have any clues to what would cause this kind of crash, or any good starting points to begin investigation?

0 CoreFoundation exceptionPreprocess (in CoreFoundation) + 148
1 libobjc.A.dylib objc_exception_throw + 56
2 CoreFoundation +[NSException raise:format:] (in CoreFoundation) + 0
3 Foundation -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] (in Foundation) + 112
4 Foundation -[NSISEngine _optimizeIfNotDisabled] (in Foundation) + 320
5 Foundation -[NSISEngine tryToAddConstraintWithMarker:expression:integralizationAdjustment:mutuallyExclusiveConstraints:] (in Foundation) + 664
6 Foundation -[NSLayoutConstraint _addLoweredExpression:toEngine:integralizationAdjustment:lastLoweredConstantWasRounded:mutuallyExclusiveConstraints:] (in Foundation) + 284
7 Foundation -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] (in Foundation) + 272
8 UIKit -[UIView(UIConstraintBasedLayout) _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:] (in UIKit) + 488
9 UIKit -[UIView(UIConstraintBasedLayout) _tryToAddConstraintWithoutUpdatingConstraintsArray:roundingAdjustment:mutuallyExclusiveConstraints:] (in UIKit) + 36
10 UIKit -[UIView(UIConstraintBasedLayout) _updateContentSizeConstraints] (in UIKit) + 696
11 UIKit -[UIView(AdditionalLayoutSupport) _updateSystemConstraints] (in UIKit) + 112
12 UIKit -[UIView(AdditionalLayoutSupport) _sendUpdateConstraintsIfNecessaryForSecondPass:] (in UIKit) + 188
13 UIKit -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] (in UIKit) + 1008
14 UIKit -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] (in UIKit) + 712
15 UIKit -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] (in UIKit) + 712
16 UIKit -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] (in UIKit) + 712
17 Foundation -[NSISEngine withBehaviors:performModifications:] (in Foundation) + 168
18 UIKit 100-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]_block_invoke (in UIKit) + 92
19 UIKit -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] (in UIKit) + 116
20 UIKit -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] (in UIKit) + 168
21 UIKit -[UIWindow(UIConstraintBasedLayout) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] (in UIKit) + 104
22 UIKit -[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeededWithViewForVariableChangeNotifications:] (in UIKit) + 428
23 UIKit -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] (in UIKit) + 180
24 UIKit -[UIView(CALayerDelegate) layoutSublayersOfLayer:] (in UIKit) + 1276
25 QuartzCore -[CALayer layoutSublayers] (in QuartzCore) + 184
26 QuartzCore CA::Layer::layout_if_needed(CA::Transaction*) (in QuartzCore) + 332
27 QuartzCore CA::Context::commit_transaction(CA::Transaction*) (in QuartzCore) + 336
28 QuartzCore CA::Transaction::commit() (in QuartzCore) + 540
29 QuartzCore CA::Transaction::observer_callback(CFRunLoopObserver*, unsigned long, void*) (in QuartzCore) + 92
30 CoreFoundation CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ (in CoreFoundation) + 32
31 CoreFoundation CFRunLoopDoObservers (in CoreFoundation) + 412
32 CoreFoundation CFRunLoopRun (in CoreFoundation) + 1292
33 CoreFoundation CFRunLoopRunSpecific + 436
34 GraphicsServices GSEventRunModal + 100
35 UIKit UIApplicationMain + 208
36 ios-app main (main.m:27)
37 libdyld.dylib start (in libdyld.dylib) + 4
1
  • 1
    This showed up for us on a 11.1.2 device.
    – E. Rivera
    Jan 12, 2018 at 14:18

1 Answer 1

4

This question made made me double check my crash logs. And it seems that it all comes from UIKit calls made from background threads.

Xcode 9 points you out now when debugging your app and a call from a non-main thread is made to these kind of calls. Try it.

In my case it is easier as I see UIAlertController in the crashed thread, so I can narrow my search for these calls.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.