EXC_BREAKPOINT on different versions of iOS - ios

My app keeps crashing in 2 different places in any version that is lower than iOS 11.
One of the crashes is an EXC_BREAKPOINT that breaks on the appDelegate class defining line - class AppDelegate: UIResponder, UIApplicationDelegate {}
While the other crashes with EXC_BREAKPOINT on a simple segmentedControl?.removeAllSegments() (and yes I checked if the segmentedControl is empty; its not).
Whats interesting is that I never had this issue so much as 2/3 weeks ago, and I know for a fact that I changed no line of code from those 2 places.
The debugger just says this : "-[UILayoutGuide nsli_superitem]: message sent to deallocated instance 0x600000386db0"
Here is the stack trace:
0 0x000000010a79c92e _T09 30SegmentedControlViewControllerC05setupcD0yyF + 126
1 0x000000010a79c6df _T0930SegmentedControlViewControllerC05setupE0yyF + 511
2 0x000000010a5dba30 _T0929MasterStockInfoViewControllerC11viewDidLoadyyF + 624
3 0x000000010a5dbb04 _T0929MasterStockInfoViewControllerC11viewDidLoadyyFTo + 36
4 UIKit 0x000000010bec101a -[UIViewController loadViewIfRequired] + 1235
5 UIKit 0x000000010bec73a6 -[UIViewController viewWillAppear:] + 118
6 UIKit 0x000000010bef13c8 -[UINavigationController _startCustomTransition:] + 1305
7 UIKit 0x000000010bf01967 -[UINavigationController _startDeferredTransitionIfNeeded:] + 687
8 UIKit 0x000000010bf02b41 -[UINavigationController __viewWillLayoutSubviews] + 58
9 UIKit 0x000000010c0f460c -[UILayoutContainerView layoutSubviews] + 231
10 UIKit 0x000000010bde155b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1268
11 QuartzCore 0x000000010ec60904 -[CALayer layoutSublayers] + 146
12 QuartzCore 0x000000010ec54526 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 370
13 QuartzCore 0x000000010ec543a0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
14 QuartzCore 0x000000010ebe3e92 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
15 QuartzCore 0x000000010ec10130 _ZN2CA11Transaction6commitEv + 468
16 QuartzCore 0x000000010ec10b37 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 115
17 CoreFoundation 0x000000010e00a717 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23
18 CoreFoundation 0x000000010e00a687 __CFRunLoopDoObservers + 391
19 CoreFoundation 0x000000010dfef720 __CFRunLoopRun + 1200
20 CoreFoundation 0x000000010dfef016 CFRunLoopRunSpecific + 406
21 GraphicsServices 0x00000001117bba24 GSEventRunModal + 62
22 UIKit 0x000000010bd1e134 UIApplicationMain + 159
23 0x000000010a7c2257 main + 55
24 libdyld.dylib 0x000000010f6bd65d start + 1
Any information on this would be helpful, currently exploring all options. If you need more information on this, post a comment and I will get back to you instantly.
Thanks

Stupid, but I was finally able to figure it out.
I found that in my Interface Builder Document in storyboard, my deployment target was set at 11.0 for the pages I was trying to load.
I hope this helps someone :)

Related

EXC_BREAKPOINT due to a wrong conversion

While checking the issues reported by Crashlytics, it seems that I have a EXC_BREAKPOINT error for the following line:
self.caloriesFor100 = Int((cartFood.nbCalories.floatValue / 100) * cartFood.quantite.floatValue)
caloriesFor100 is a Int.
cartFood.nbCalories is an NSNumber which is supposed to have float values.
cartFood.quantite is also an NSNumber which is supposed to have float values.
I did not succeed to reproduce the issue. What could possibly cause an EXC_BREAKPOINT in this code?
Full stack trace:
Crashed: com.apple.main-thread
0 LSDP 0x10269ccbc specialized CartFoodModelinit(_:) (CartFoodModel.swift:88)
1 LSDP 0x10268a570 specialized CartFoodCell.cartFoodObjc (CartFoodModel.swift)
2 LSDP 0x102689600 #objc CartFoodCell.cartFoodObjc (<compiler-generated>)
3 LSDP 0x102664c7c -[PanierDuJourViewController tableView:cellForRowAtIndexPath:] (PanierDuJourViewController.m:156)
4 UIKit 0x18bf10148 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 668
5 UIKit 0x18bf0fe00 -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 80
6 UIKit 0x18bf0eb1c -[UITableView _updateVisibleCellsNow:isRecursive:] + 2280
7 UIKit 0x18bf0a668 -[UITableView layoutSubviews] + 140
8 UIKit 0x18be47770 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1420
9 QuartzCore 0x1863e925c -[CALayer layoutSublayers] + 184
10 QuartzCore 0x1863ed3ec CA::Layer::layout_if_needed(CA::Transaction*) + 324
11 QuartzCore 0x186359aa0 CA::Context::commit_transaction(CA::Transaction*) + 320
12 QuartzCore 0x1863815d0 CA::Transaction::commit() + 580
13 UIKit 0x18c22054c _UIApplicationFlushRunLoopCATransactionIfTooLate + 172
14 UIKit 0x18c7fd4c0 __handleEventQueueInternal + 5520
15 UIKit 0x18c7f6258 __handleHIDEventFetcherDrain + 152
16 CoreFoundation 0x18221b404 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
17 CoreFoundation 0x18221ac2c __CFRunLoopDoSources0 + 276
18 CoreFoundation 0x18221879c __CFRunLoopRun + 1204
19 CoreFoundation 0x182138da8 CFRunLoopRunSpecific + 552
20 GraphicsServices 0x18411b020 GSEventRunModal + 100
21 UIKit 0x18c11978c UIApplicationMain + 236
22 LSDP 0x1025fce28 main (main.m:16)
23 libdyld.dylib 0x181bc9fc0 start + 4
You may catch this exception in case if NSNumber property will be nil. So maybe it is better to change nbCalories to has an option value.
I found a similar problem and its solution here.
Since your app crashes at tableView:cellForRowAtIndexPath:, it might be that the cell should display an entry of your table (CartFoodCell.cartFoodObjc) that no longer exists.
But without more code, this is just a guess. Please double check it in your code.

When i run my app on simulator it doesn't show my app under both simulator settings and location services

It is the error shown in the Xcode when i switch back to settings in simulator .if somebody knows please kindly notify me. Thanks in advance
GeoNet[2325:41287] This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release.
Stack:(
0 CoreFoundation 0x00c5ba14 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0071ce02 objc_exception_throw + 50
2 CoreFoundation 0x00c5b93d +[NSException raise:format:] + 141
3 Foundation 0x004ee74b _AssertAutolayoutOnMainThreadOnly + 96
4 Foundation 0x003164c1 -[NSISEngine optimize] + 67
5 Foundation 0x00316f84 -[NSISEngine withBehaviors:performModifications:] + 245
6 Foundation 0x0031a404 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
7 UIKit 0x01dd9b08 -[UIView(AdditionalLayoutSupport) _withAutomaticEngineOptimizationDisabledIfEngineExists:] + 75
8 UIKit 0x01dda781 -[UIView(AdditionalLayoutSupport) updateConstraintsIfNeeded] + 278
9 UIKit 0x01aa48b8 -[UITableViewCellContentView updateConstraintsIfNeeded] + 185
10 UIKit 0x01ddb66c -[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeeded] + 372
11 UIKit 0x014a919a -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 173
12 UIKit 0x014a9929 -[UIView(Hierarchy) layoutSubviews] + 184
13 UIKit 0x014bb008 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 810
14 libobjc.A.dylib 0x00731059 -[NSObject performSelector:withObject:] + 70
15 QuartzCore 0x0603480a -[CALayer layoutSublayers] + 144
16 QuartzCore 0x060284ee _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 388
17 QuartzCore 0x06028352 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
18 QuartzCore 0x0601ae8b _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 317
19 QuartzCore 0x0604ee03 _ZN2CA11Transaction6commitEv + 561
20 QuartzCore 0x0604f1ab _ZN2CA11Transaction14release_threadEPv + 289
21 libsystem_pthread.dylib 0x0308d2f7 _pthread_tsd_cleanup + 93
22 libsystem_pthread.dylib 0x0308d051 _pthread_exit + 108
23 libsystem_pthread.dylib 0x0308d734 pthread_get_stackaddr_np + 0
24 libsystem_pthread.dylib 0x0308ae0e start_wqthread + 30
)
This is happening since iOS 9, on earlier version your code could have working fine. This is because, some of your functions must executing on the background thread and after view load trying to change the appearance of view. So, you must have put that function on main thread and load it asynchronously. Please share the code of ViewController, which you are trying to load for more specific answer.
dispatch_async(dispatch_get_main_queue(), ^{
// your code here
})
Been encountering this error a lot in my OS X using swift: "This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release."
See this link, You can find solution.

Understanding the Crash Log

I am an Android Developer and trying some dummy for the iOS development.
I am trying a tutorial for AMSlideMenu and it was working well at a certain point of development.
I followed the complete tutorial and it worked well. After sometime while I was experimenting some other functionality the code breaked.
I undo and reverted back the changes but something still looks wrong.
below is the crash log, but i cant understand what went wrong
*** First throw call stack:
(
0 CoreFoundation 0x000000010bdf93f5 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010b6e9bb7 objc_exception_throw + 45
2 UIKit 0x000000010c7bd43b -[UIViewController shouldPerformSegueWithIdentifier:sender:] + 0
3 Pranshu1 0x000000010b1a0d4f -[AMSlideMenuMainViewController setup] + 1071
4 Pranshu1 0x000000010b19dc63 -[AMSlideMenuMainViewController viewDidLoad] + 419
5 Pranshu1 0x000000010b19d1b6 -[MainViewController viewDidLoad] + 54
6 UIKit 0x000000010c7bb190 -[UIViewController loadViewIfRequired] + 738
7 UIKit 0x000000010c7e95db -[UINavigationController _layoutViewController:] + 44
8 UIKit 0x000000010c7e9b25 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 216
9 UIKit 0x000000010c7e9c24 -[UINavigationController _startTransition:fromViewController:toViewController:] + 92
10 UIKit 0x000000010c7ea9f7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 523
11 UIKit 0x000000010c7eb4b7 -[UINavigationController __viewWillLayoutSubviews] + 43
12 UIKit 0x000000010c92f399 -[UILayoutContainerView layoutSubviews] + 202
13 UIKit 0x000000010c70f199 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 521
14 QuartzCore 0x000000010c521f98 -[CALayer layoutSublayers] + 150
15 QuartzCore 0x000000010c516bbe _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
16 QuartzCore 0x000000010c516a2e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
17 QuartzCore 0x000000010c484ade _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
18 QuartzCore 0x000000010c485bea _ZN2CA11Transaction6commitEv + 390
19 UIKit 0x000000010c69467d -[UIApplication _reportMainSceneUpdateFinished:] + 44
20 UIKit 0x000000010c695368 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2642
21 UIKit 0x000000010c693d22 -[UIApplication workspaceDidEndTransaction:] + 179
22 FrontBoardServices 0x00000001114912a3 __31-[FBSSerialQueue performAsync:]_block_invoke + 16
23 CoreFoundation 0x000000010bd2eabc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
24 CoreFoundation 0x000000010bd24805 __CFRunLoopDoBlocks + 341
25 CoreFoundation 0x000000010bd245c5 __CFRunLoopRun + 2389
26 CoreFoundation 0x000000010bd23a06 CFRunLoopRunSpecific + 470
27 UIKit 0x000000010c693799 -[UIApplication _run] + 413
28 UIKit 0x000000010c696550 UIApplicationMain + 1282
29 Pranshu1 0x000000010b1ad003 main + 115
30 libdyld.dylib 0x000000010e822145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Thanks in Advance
Looking up from the top (0) entry the last of your methods is: Pranshu1 so you need to look there.
The last method is: -[UIViewController shouldPerformSegueWithIdentifier:sender:]
so it looks like you are performing a Segue, check the identifier.
Before that is the method AMSlideMenuMainViewController so it looks like you are probably using the 3rd party code AMSlideMenu, check for correct usage.
Here is how to catch the exceptions at the point of the error:
To see the actual statement that is causing the error add an exception breakpoint:
From the Main Menu Debug:Breakpoints:Create Exception Breakpoint.
Right-click the breakpoint and set the exception to Objective-C.
Add an action: "po $arg1".
Run the app to get the breakpoint and you will be at the line that causes the exception and the error message will be in the debugger console.
Creating the breakpoint example:

iOS app odd crashes [UINavigationController _startCustomTransition:]

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/

Application crash after updated to IOS7

I have updated my app to IOS7 and now I have very strange issue.
When I start app it start to do what it suppose to do and after 3-5 minutes app stops to work. But not completely. It stops to send notifications, track location etc.
And if I try to make some action I get this in console:
*** First throw call stack:
(
0 CoreFoundation 0x0305f5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0276e8b6 objc_exception_throw + 44
2 CoreFoundation 0x0305f3bb +[NSException raise:format:] + 139
3 UIKit 0x0157465c -[UINib instantiateWithOwner:options:] + 951
4 UIKit 0x013e6c95 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
5 UIKit 0x013e743d -[UIViewController loadView] + 302
6 UIKit 0x013e773e -[UIViewController loadViewIfRequired] + 78
7 UIKit 0x0140d1a5 -[UINavigationController _layoutViewController:] + 39
8 UIKit 0x0140d6bb -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 235
9 UIKit 0x0140d7b3 -[UINavigationController _startTransition:fromViewController:toViewController:] + 78
10 UIKit 0x0140e72c -[UINavigationController _startDeferredTransitionIfNeeded:] + 645
11 UIKit 0x0140f349 -[UINavigationController __viewWillLayoutSubviews] + 57
12 UIKit 0x0154839d -[UILayoutContainerView layoutSubviews] + 213
13 UIKit 0x0cf0656f -[UILayoutContainerViewAccessibility(SafeCategory) layoutSubviews] + 50
14 UIKit 0x0133edd7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
15 libobjc.A.dylib 0x0278081f -[NSObject performSelector:withObject:] + 70
16 QuartzCore 0x00ef972a -[CALayer layoutSublayers] + 148
17 QuartzCore 0x00eed514 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
18 QuartzCore 0x00eed380 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
19 QuartzCore 0x00e55156 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
20 QuartzCore 0x00e564e1 _ZN2CA11Transaction6commitEv + 393
21 QuartzCore 0x00f12870 +[CATransaction flush] + 52
22 UIKit 0x012f0979 _afterCACommitHandler + 131
23 CoreFoundation 0x0302753e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
24 CoreFoundation 0x0302748f __CFRunLoopDoObservers + 399
25 CoreFoundation 0x030053b4 __CFRunLoopRun + 1076
26 CoreFoundation 0x03004b33 CFRunLoopRunSpecific + 467
27 CoreFoundation 0x0300494b CFRunLoopRunInMode + 123
28 GraphicsServices 0x03ce89d7 GSEventRunModal + 192
29 GraphicsServices 0x03ce87fe GSEventRun + 104
30 UIKit 0x012d494b UIApplicationMain + 1225
31 MyApp 0x0000759d main + 141
32 libdyld.dylib 0x02c53725 start + 0
33 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any idea what is this?
App works fine in IOS6.
Create an exception breakpoint in Xcode that stops on all exceptions. Then the debugger will stop when that exception is raised. It looks like it is in
[UINib instantiateWithOwner:options:]
But I can't tell if you are calling that or the system.
See here for a related issue:
Terminating app due to uncaught exception 'NSUnknownKeyException'
I must test this on real phone just to be sure.
I have a piece of code that refreshes some labels in the view every X seconds.
It works fine until IOS7. On IOS7 app crashes after 3 minutes and I get the error from the question.
Every time I refresh labels in the view I was opened a new connection to sqlite to get data.
In IOS7 I get error so I made one instance of data access class and init it only in viewDidLoad() and now it works fine.
If after test I confirm that I am right I will definitely make singleton pattern of my data access class.

Resources