1

I have noticed that some exceptions, like NSGenericException or NSManagedObject Exceptions do not contain a lot of details in output when app crashes on iOS 11. But in the same time if I run and make it crashed on iOS 9 or 10, it will contain a lot of useful details.

For example. Same app, same crash, on iOS 11:

libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

On iOS 9-10:

2018-01-02 23:51:22.967 CafeManager[3726:130232] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Your application has presented a UIAlertController (<UIAlertController: 0x7f959a7634c0>) of style UIAlertControllerStyleActionSheet. The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem.  If this information is not known when you present the alert controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010f61eb0b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x000000010ec6f141 objc_exception_throw + 48
    2   UIKit                               0x0000000110c04d67 -[UIPopoverPresentationController presentationTransitionWillBegin] + 3291
    3   UIKit                               0x00000001102ac3c2 __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 2278
    4   UIKit                               0x00000001102a9d20 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 426
    5   UIKit                               0x0000000110137853 _runAfterCACommitDeferredBlocks + 318
    6   UIKit                               0x000000011012481c _cleanUpAfterCAFlushAndRunDeferredBlocks + 532
    7   UIKit                               0x0000000110156560 _afterCACommitHandler + 137
    8   CoreFoundation                      0x000000010f5c4717 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    9   CoreFoundation                      0x000000010f5c4687 __CFRunLoopDoObservers + 391
    10  CoreFoundation                      0x000000010f5a9720 __CFRunLoopRun + 1200
    11  CoreFoundation                      0x000000010f5a9016 CFRunLoopRunSpecific + 406
    12  GraphicsServices                    0x0000000114cc1a24 GSEventRunModal + 62
    13  UIKit                               0x000000011012b134 UIApplicationMain + 159
    14  CafeManager                         0x000000010dd37747 main + 55
    15  libdyld.dylib                       0x0000000113d1c65d start + 1
    16  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

As you can see, it really makes the difference. What have I missed? Any debugger settings or is it iOS 11-related issue?

UPDATE: Raised the same question on Apple Developer Forums and Apple Bug reporter. No answer so far.

DJ-Glock
  • 1,277
  • 2
  • 12
  • 39
  • This might be due to Swift version of the code. It depends on that It is code and Xcode compatibility, I think you are using swift 2.3 or lesser and running on xCode 9.0 or higher. – Sucharu Hasija Jan 31 '18 at 08:32
  • This is not correct. I was using swift 3 and migrated project to swift 4. Xcode 9 Release. – DJ-Glock Jan 31 '18 at 08:36

1 Answers1

4

Did you set the OS_ACTIVITY_MODE variable by any chance?

To check if you have this variable set (and turn it off), in Xcode 9, do the following:

Select from Xcode menu Product -> Scheme -> Edit Scheme.. Select the Run scheme and look under Arguments. If you see the OS_ACTIVITY_MODE variable checked, deselect it.

Igor Rutmb
  • 56
  • 4