[NSNull length]: unrecognized selector sent to instance on keyboard keystroke? - ios

I have added some textField and textView on static table view. the code was fine and running on xcode 6.4 / ios 8. * but it is throwing exception which i am not able to track. now i am debugging code on xcode 7.2 (swift2.2)
I tried putting symbolic and and exceptional break point too but no luck :(
following is stack trace of crash, Thanks in advance for your valuable help.
2015-12-14 16:07:07.989 TuteMate[3380:90711] -[NSNull length]: unrecognized selector sent to instance 0x10ccc6af0
from exceptional breakpoint :
CoreFoundation`-[NSObject(NSObject) doesNotRecognizeSelector:]:
-> 0x10504e3c0 <+0>: pushq %rbp
0x10504e3c1 <+1>: movq %rsp, %rbp
0x10504e3c4 <+4>: pushq %r15
0x10504e3c6 <+6>: pushq %r14
0x10504e3c8 <+8>: pushq %rbx
0x10504e3c9 <+9>: pushq %rax
0x10504e3ca <+10>: movq %rdx, %r14
0x10504e3cd <+13>: movq %rdi, %rbx
0x10504e3d0 <+16>: movq 0x216c79(%rip), %rsi ; "class"
0x10504e3d7 <+23>: callq *0x229e1b(%rip) ; (void *)0x000000010730b800: objc_msgSend
0x10504e3dd <+29>: movq %rax, %rdi
0x10504e3e0 <+32>: movq %rbx, %rsi
0x10504e3e3 <+35>: movq %r14, %rdx
0x10504e3e6 <+38>: callq 0x10504ed00 ; __CFFullMethodName
0x10504e3eb <+43>: movq %rax, %r14
0x10504e3ee <+46>: leaq 0x23fdeb(%rip), %r15 ; #"%#: unrecognized selector sent to instance %p"
0x10504e3f5 <+53>: movl $0x3, %edi
0x10504e3fa <+58>: xorl %eax, %eax
0x10504e3fc <+60>: movq %r15, %rsi
0x10504e3ff <+63>: movq %r14, %rdx
0x10504e402 <+66>: movq %rbx, %rcx
0x10504e405 <+69>: callq 0x104fe2560 ; CFLog
0x10504e40a <+74>: leaq 0x22b90f(%rip), %rax ; kCFAllocatorSystemDefault
0x10504e411 <+81>: movq (%rax), %rdi
0x10504e414 <+84>: xorl %esi, %esi
0x10504e416 <+86>: xorl %eax, %eax
0x10504e418 <+88>: movq %r15, %rdx
0x10504e41b <+91>: movq %r14, %rcx
0x10504e41e <+94>: movq %rbx, %r8
0x10504e421 <+97>: callq 0x104f35190 ; CFStringCreateWithFormat
0x10504e426 <+102>: movq %rax, %rdi
0x10504e429 <+105>: callq 0x104f33580 ; CFMakeCollectable
0x10504e42e <+110>: movq %rax, %rbx
0x10504e431 <+113>: movq %rbx, %rdi
0x10504e434 <+116>: nop
0x10504e435 <+117>: nopl (%rax)
0x10504e439 <+121>: leaq 0x225300(%rip), %rax ; __CFOASafe
0x10504e440 <+128>: cmpb $0x0, (%rax)
0x10504e443 <+131>: je 0x10504e459 ; <+153>
0x10504e445 <+133>: movl $0x3, %edi
0x10504e44a <+138>: xorl %edx, %edx
0x10504e44c <+140>: xorl %ecx, %ecx
0x10504e44e <+142>: xorl %r8d, %r8d
0x10504e451 <+145>: movq %rbx, %rsi
0x10504e454 <+148>: callq 0x10501b150 ; __CFRecordAllocationEvent
0x10504e459 <+153>: movq %rbx, %rdi
0x10504e45c <+156>: callq 0x1050a3696 ; symbol stub for: _objc_rootAutorelease
0x10504e461 <+161>: movq 0x218370(%rip), %rdi ; (void *)0x00000001052690d0: NSException
0x10504e468 <+168>: leaq 0x234fb1(%rip), %rcx ; NSInvalidArgumentException
0x10504e46f <+175>: movq (%rcx), %rdx
0x10504e472 <+178>: movq 0x216c4f(%rip), %rsi ; "exceptionWithName:reason:userInfo:"
0x10504e479 <+185>: xorl %r8d, %r8d
0x10504e47c <+188>: movq %rax, %rcx
0x10504e47f <+191>: callq *0x229d73(%rip) ; (void *)0x000000010730b800: objc_msgSend
0x10504e485 <+197>: movq %rax, %rdi
0x10504e488 <+200>: callq 0x1050a3738 ; symbol stub for: objc_exception_throw
0x10504e48d <+205>: nopl (%rax)
update stack Trace
2015-12-14 16:45:58.932 TuteMate[4000:109943] -[NSNull length]: unrecognized selector sent to instance 0x105b72af0
2015-12-14 16:46:02.651 TuteMate[4000:109943] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 0x105b72af0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010594de65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000107bfddeb objc_exception_throw + 48
2 CoreFoundation 0x000000010595648d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00000001058a390a ___forwarding___ + 970
4 CoreFoundation 0x00000001058a34b8 _CF_forwarding_prep_0 + 120
5 CoreFoundation 0x0000000105825dfa CFStringCompareWithOptionsAndLocale + 202
6 Foundation 0x0000000106019e37 -[NSString compare:options:range:] + 29
7 UIKit 0x00000001069c4e6f -[UIPhysicalKeyboardEvent _matchesKeyCommand:] + 303
8 UIKit 0x00000001068e93fd -[UIResponder _keyCommandForEvent:target:] + 364
9 UIKit 0x00000001068e95b2 -[UIResponder _keyCommandForEvent:target:] + 801
10 UIKit 0x00000001068e95b2 -[UIResponder _keyCommandForEvent:target:] + 801
11 UIKit 0x00000001068e95b2 -[UIResponder _keyCommandForEvent:target:] + 801
12 UIKit 0x00000001068e95b2 -[UIResponder _keyCommandForEvent:target:] + 801
13 UIKit 0x00000001068e95b2 -[UIResponder _keyCommandForEvent:target:] + 801
14 UIKit 0x00000001068e95b2 -[UIResponder _keyCommandForEvent:target:] + 801
15 UIKit 0x00000001066fb91a -[UIApplication _handleKeyUIEvent:] + 948
16 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
17 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
18 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
19 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
20 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
21 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
22 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
23 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
24 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
25 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
26 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
27 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
28 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
29 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
30 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
31 UIKit 0x00000001068e9e53 -[UIResponder _handleKeyUIEvent:] + 79
32 UIKit 0x00000001066fb2cd -[UIApplication handleKeyUIEvent:] + 79
33 UIKit 0x0000000106991c83 -[UIKeyboardImpl _handleKeyEvent:executionContext:] + 66
34 UIKit 0x0000000106b91cde -[UIKeyboardLayoutStar completeRetestForTouchUp:timestamp:interval:executionContext:] + 3356
35 UIKit 0x00000001069a0bbd __28-[UIKeyboardLayout touchUp:]_block_invoke + 228
36 UIKit 0x00000001070ed724 -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 332
37 UIKit 0x00000001069a0ace -[UIKeyboardLayout touchUp:] + 236
38 UIKit 0x00000001069a1614 -[UIKeyboardLayout touchesEnded:withEvent:] + 348
39 UIKit 0x000000010674b49b -[UIWindow _sendTouchesForEvent:] + 835
40 UIKit 0x000000010674c1d0 -[UIWindow sendEvent:] + 865
41 UIKit 0x00000001066fab66 -[UIApplication sendEvent:] + 263
42 UIKit 0x00000001066d4d97 _UIApplicationHandleEventQueue + 6844
43 CoreFoundation 0x0000000105879a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
44 CoreFoundation 0x000000010586f95c __CFRunLoopDoSources0 + 556
45 CoreFoundation 0x000000010586ee13 __CFRunLoopRun + 867
46 CoreFoundation 0x000000010586e828 CFRunLoopRunSpecific + 488
47 GraphicsServices 0x000000010c9daad2 GSEventRunModal + 161
48 UIKit 0x00000001066da610 UIApplicationMain + 171
49 TuteMate 0x000000010500128d main + 109
50 libdyld.dylib 0x000000010932c92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
UPDATE
There are no other viewWillAppeaer, didAppear... methods implemented!
override func viewDidLoad() {
super.viewDidLoad()
title = "Profile Edit"
}
And table viewDelegates are
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// #warning Potentially incomplete method implementation.
// Return the number of sections.
return 1
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete method implementation.
// Return the number of rows in the section.
return 3
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = super.tableView(tableView, cellForRowAtIndexPath: indexPath)
return cell
}

#dip: From your comments it seems that you need to learn something very important about debugging, and that is: Everything you believe is false. When you say "I don't store null or anything like that", we know that is false. And the second most important rule: Trust the evidence.
The evidence is that a message "length:" which is an NSString method is sent to [NSNull null]. Somewhere you are storing [NSNull null] where you should store a string. Third rule of debugging: You did something wrong. There are no mysterious gremlins trying to upset you, it's your code that's wrong. So find out where you are storing an [NSNull null]. Anything coming from a JSON parser is always a good candidate.

Possible Solution:
My issue was caused because I inadvertently clicked on the Key Commands controls in the attribute inspector.
Check out my response here:
https://stackoverflow.com/a/36187611/5006807
I hope it helps....

Related

App Crashing (EXC_BAD_ACCESS) only in RTL Languages like Arabic

App is crashing with EXC_BAD_ACCESS exception only in RTL mode whereas the app is working fine in LTR mode. I'm running the app by forcing it in RTL mode as below,
Edit Scheme -> Run -> Option -> App Language -> Right to Left Pseudo Language.
It is crashing in UIApplicationMain with following stack trace
0x12495a1bb <+94>: movq 0x47896(%rip), %rsi ; "overflowEngineVarIndexForEngine:"
0x12495a1c2 <+101>: movq %r14, %rdi
0x12495a1c5 <+104>: movq %rbx, %rdx
0x12495a1c8 <+107>: callq *0x3d022(%rip) ; (void *)0x0000000113ecd7c0: objc_msgSend
0x12495a1ce <+113>: jmp 0x12495a1d5 ; <+120>
0x12495a1d0 <+115>: movl $0xffffffff, %eax ; imm = 0xFFFFFFFF
0x12495a1d5 <+120>: movq 0xc0(%rbx), %rcx
0x12495a1dc <+127>: movl %eax, %eax
0x12495a1de <+129>: movq %rax, %rdx
0x12495a1e1 <+132>: shrq $0x6, %rdx
-> 0x12495a1e5 <+136>: movq (%rcx,%rdx,8), %rcx Thread 1: EXC_BAD_ACCESS (code=2, address=0x6190201a4f78)
0x12495a1e9 <+140>: andl $0x3f, %eax
0x12495a1ec <+143>: shlq $0x5, %rax
0x12495a1f0 <+147>: leaq (%rcx,%rax), %r15
Crash Log Looks like this
Thread 0:: Dispatch queue: com.apple.main-thread
0 ??? 0x110739ad8 ???
1 ??? 0x111e93948 ???
2 CoreAutoLayout 0x128b4e3e9 -[NSISEngine negativeErrorVarForBrokenConstraintWithMarker:errorVar:] + 89
3 CoreAutoLayout 0x128b5716f -[NSISEngine removeConstraintWithMarker:] + 1102
4 CoreAutoLayout 0x128b6ca30 -[NSLayoutConstraint _removeFromEngine:] + 209
5 UIKitCore 0x13ecd4dd0 -[UIView _layoutEngine_willRemoveLayoutConstraint:] + 80
6 UIKitCore 0x13ecd589c -[UIView(UIConstraintBasedLayout) nsli_removeConstraint:] + 90
7 CoreAutoLayout 0x128b6de31 __55+[NSLayoutConstraint _addOrRemoveConstraints:activate:]_block_invoke + 53
8 CoreAutoLayout 0x128b5458f -[NSISEngine withBehaviors:performModifications:] + 84
9 CoreAutoLayout 0x128b6dd0a +[NSLayoutConstraint _addOrRemoveConstraints:activate:] + 398
10 UIKitCore 0x13ece22f8 -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 580
11 UIKitCore 0x13ece344d -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 154
12 UIKitCore 0x13ece4556 -[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeededWithViewForVariableChangeNotifications:] + 374
13 UIKitCore 0x13ede1561 -[UIView _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 352
14 UIKitCore 0x13edf559f -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2305
15 QuartzCore 0x11b49302c CA::Layer::layout_if_needed(CA::Transaction*) + 526
16 QuartzCore 0x11b49e5b9 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 65
17 QuartzCore 0x11b3afb0c CA::Context::commit_transaction(CA::Transaction*, double, double*) + 626
18 QuartzCore 0x11b3e769b CA::Transaction::commit() + 735
19 QuartzCore 0x11b3e8b64 CA::Transaction::flush_as_runloop_observer(bool) + 60
20 CoreFoundation 0x11f3df055 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
21 CoreFoundation 0x11f3d99c2 __CFRunLoopDoObservers + 515
22 CoreFoundation 0x11f3d9f0d __CFRunLoopRun + 1161
23 CoreFoundation 0x11f3d96a7 CFRunLoopRunSpecific + 560
24 GraphicsServices 0x12793128a GSEventRunModal + 139
25 UIKitCore 0x13e7c2ad3 -[UIApplication _run] + 994
26 UIKitCore 0x13e7c79ef UIApplicationMain + 123
27 libswiftUIKit.dylib 0x1267f3c72 UIApplicationMain(_:_:_:_:) + 98
28 Bookings 0x105de34c0 main + 560 (main.swift:12)
29 dyld_sim 0x1170582bf start_sim + 10
30 dyld 0x20cd81310 start + 2432
I have enabled Constraint Error Breakpoint , Exception Breakpoint and Run Time Issue Breakpoint but have no luck in finding any clue about the issue. Have used instruments to find memory leaks but had no luck there too since it showed as no leaks.
So from crash logs it is clear that app is crashing coz of something went wrong inside Autolayout engine (which may be coz of some contradicting constraints) and I can't check all the constraints since app has huge number of them. How can find the root cause of this crash and fix this issue.
I would appreciate any help in finding the root cause of this crash issue.

How to find the cause of an exception

I am trying to debug a crash whenever an iOS document provider extension is started. As it is a extension I am not able to debug it correctly, and this error log is the best i was able to get out of the device. How can i see what is throwing the exception (or what the assertion is) when none of the methods that get called are mine.
Incident Identifier: 0B4EA724-9AFB-4EE3-B752-7E1FDF3B9A75
CrashReporter Key: ac4cdaa3c5ddd65a3bffef5cc28903f683f0309d
Hardware Model: iPad3,1
Process: FileProvider [1100]
Path: /private/var/containers/Bundle/Application/CEDD148D-420D-4BE8-ABF8-8E83F6385ABC/Privat.app/PlugIns/FileProvider.appex/FileProvider
Identifier: com.privat.cloud.FileProvider
Version: 1 (2.5.6)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2017-02-09 15:19:03.03 +0100
Launch Time: 2017-02-09 15:19:02.02 +0100
OS Version: iOS 9.3.5 (13G36)
Report Version: 105
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Filtered syslog:
None found
Last Exception Backtrace:
0 CoreFoundation 0x22673916 __exceptionPreprocess + 122
1 libobjc.A.dylib 0x21e0ee12 objc_exception_throw + 34
2 CoreFoundation 0x226737ec +[NSException raise:format:arguments:] + 100
3 Foundation 0x22e57524 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 88
4 UIKit 0x26fc83e0 -[UIDocumentPickerExtensionViewController _prepareWithExtensionInfo:completionHandler:] + 504
5 CoreFoundation 0x226784c0 __invoking___ + 64
6 CoreFoundation 0x2259e878 -[NSInvocation invoke] + 288
7 CoreFoundation 0x225a22f2 -[NSInvocation invokeWithTarget:] + 46
8 UIKit 0x27489390 -[_UIViewServiceImplicitAnimationDecodingProxy forwardInvocation:] + 252
9 CoreFoundation 0x22676d7e ___forwarding___ + 346
10 CoreFoundation 0x225a2234 _CF_forwarding_prep_0 + 20
11 CoreFoundation 0x226784c0 __invoking___ + 64
12 CoreFoundation 0x2259e878 -[NSInvocation invoke] + 288
13 CoreFoundation 0x225a22f2 -[NSInvocation invokeWithTarget:] + 46
14 UIKit 0x27408b32 -[_UIQueueingProxy forwardInvocation:] + 370
15 CoreFoundation 0x22676d7e ___forwarding___ + 346
16 CoreFoundation 0x225a2234 _CF_forwarding_prep_0 + 20
17 CoreFoundation 0x226784c0 __invoking___ + 64
18 CoreFoundation 0x2259e878 -[NSInvocation invoke] + 288
19 CoreFoundation 0x225a22f2 -[NSInvocation invokeWithTarget:] + 46
20 CoreFoundation 0x22676d7e ___forwarding___ + 346
21 CoreFoundation 0x225a2234 _CF_forwarding_prep_0 + 20
22 CoreFoundation 0x226784c0 __invoking___ + 64
23 CoreFoundation 0x2259e878 -[NSInvocation invoke] + 288
24 CoreFoundation 0x225a22f2 -[NSInvocation invokeWithTarget:] + 46
25 CoreFoundation 0x22676d7e ___forwarding___ + 346
26 CoreFoundation 0x225a2234 _CF_forwarding_prep_0 + 20
27 CoreFoundation 0x226784c0 __invoking___ + 64
28 CoreFoundation 0x2259e878 -[NSInvocation invoke] + 288
29 FrontBoardServices 0x23d16c02 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 14
30 FrontBoardServices 0x23d16ab4 -[FBSSerialQueue _performNext] + 220
31 FrontBoardServices 0x23d16db4 -[FBSSerialQueue _performNextFromRunLoopSource] + 44
32 CoreFoundation 0x22635dfa __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 10
33 CoreFoundation 0x226359e8 __CFRunLoopDoSources0 + 448
34 CoreFoundation 0x22633d56 __CFRunLoopRun + 790
35 CoreFoundation 0x22583224 CFRunLoopRunSpecific + 516
36 CoreFoundation 0x22583010 CFRunLoopRunInMode + 104
37 GraphicsServices 0x23b73ac4 GSEventRunModal + 156
38 UIKit 0x26c57184 UIApplicationMain + 140
39 libxpc.dylib 0x223cd07c _xpc_objc_main + 700
40 libxpc.dylib 0x223ce730 xpc_main + 164
41 Foundation 0x22f74790 -[NSXPCListener resume] + 160
42 PlugInKit 0x28afe128 -[PKService run] + 504
43 PlugInKit 0x28afddf6 +[PKService main] + 54
44 PlugInKit 0x28afe15c +[PKService _defaultRun:arguments:] + 16
45 libextension.dylib 0x22db37c8 NSExtensionMain + 44
46 libdyld.dylib 0x2222b86e tlv_get_addr + 42
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x222fec5c __pthread_kill + 8
1 libsystem_pthread.dylib 0x223a8732 pthread_kill + 62
2 libsystem_c.dylib 0x222930ac abort + 108
3 libc++abi.dylib 0x21deaae4 __cxa_bad_cast + 0
4 libc++abi.dylib 0x21e0369e default_terminate_handler() + 266
5 libobjc.A.dylib 0x21e0f0b0 _objc_terminate() + 192
6 libc++abi.dylib 0x21e00e16 std::__terminate(void (*)()) + 78
7 libc++abi.dylib 0x21e008f8 __cxa_increment_exception_refcount + 0
8 libobjc.A.dylib 0x21e0ef5e objc_exception_rethrow + 42
9 CoreFoundation 0x225832ae CFRunLoopRunSpecific + 654
10 CoreFoundation 0x22583014 CFRunLoopRunInMode + 108
11 GraphicsServices 0x23b73ac8 GSEventRunModal + 160
12 UIKit 0x26c57188 UIApplicationMain + 144
13 libxpc.dylib 0x223cd080 _xpc_objc_main + 704
14 libxpc.dylib 0x223ce734 xpc_main + 168
15 Foundation 0x22f74794 service_connection_handler + 0
16 PlugInKit 0x28afe12c -[PKService run] + 508
17 PlugInKit 0x28afddfa +[PKService main] + 58
18 PlugInKit 0x28afe160 +[PKService _defaultRun:arguments:] + 20
19 libextension.dylib 0x22db37cc NSExtensionMain + 48
20 libdyld.dylib 0x2222b872 start + 2
Thread 1:
0 libsystem_kernel.dylib 0x222ff864 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x223a5b34 _pthread_wqthread + 1036
2 libsystem_pthread.dylib 0x223a5718 start_wqthread + 8
Thread 2 name: Dispatch queue: com.apple.libdispatch-manager
Thread 2:
0 libsystem_kernel.dylib 0x223002f8 kevent_qos + 24
1 libdispatch.dylib 0x221f5d60 _dispatch_mgr_invoke + 256
2 libdispatch.dylib 0x221f5abe _dispatch_mgr_thread$VARIANT$mp + 38
Thread 3:
0 libsystem_kernel.dylib 0x222ff864 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x223a5b34 _pthread_wqthread + 1036
2 libsystem_pthread.dylib 0x223a5718 start_wqthread + 8
Thread 4:
0 libsystem_kernel.dylib 0x222ff864 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x223a5b34 _pthread_wqthread + 1036
2 libsystem_pthread.dylib 0x223a5718 start_wqthread + 8
Thread 5:
0 libsystem_kernel.dylib 0x222ff864 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x223a5b34 _pthread_wqthread + 1036
2 libsystem_pthread.dylib 0x223a5718 start_wqthread + 8
Thread 6 name: com.apple.coremedia.player.async
Thread 6:
0 libsystem_kernel.dylib 0x222ea920 semaphore_wait_trap + 8
1 libdispatch.dylib 0x221f294a _dispatch_semaphore_wait_slow + 190
2 MediaToolbox 0x279571ec fpa_AsyncMovieControlThread + 1916
3 CoreMedia 0x2462b9b8 figThreadMain + 208
4 libsystem_pthread.dylib 0x223a785a _pthread_body + 138
5 libsystem_pthread.dylib 0x223a77ce _pthread_start + 110
6 libsystem_pthread.dylib 0x223a5724 thread_start + 8
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x00000000
r4: 0x00000006 r5: 0x395c3000 r6: 0x38803304 r7: 0x0037e378
r8: 0x14582d00 r9: 0x21e048fd r10: 0x3428ff05 r11: 0x14582d24
ip: 0x00000148 sp: 0x0037e36c lr: 0x223a8733 pc: 0x222fec5c
cpsr: 0x00000010
If i setup a global exception breakpoint i get this, and it is not helpful:
libobjc.A.dylib`objc_exception_throw:
-> 0x23c5edf0 <+0>: push {r4, r5, r6, r7, lr}
0x23c5edf2 <+2>: add r7, sp, #0xc
0x23c5edf4 <+4>: .long 0x0d00e92d ; unknown opcode
0x23c5edf8 <+8>: .long 0x6dfaf5ad ; unknown opcode
0x23c5edfc <+12>: mov r5, r0
0x23c5edfe <+14>: movs r0, #0x10
0x23c5ee00 <+16>: bl 0x23c5027c ; __cxa_allocate_exception

iOS: how to localize line in source code from dissasembly log

Console info:
2015-11-15 23:26:42.824 SWPi2[1564:476501] *** -[__NSCFConstantString length]: message sent to deallocated instance 0x110d868a0
bt:
* thread #1: tid = 0x74555, 0x0000000110a9beaf CoreFoundation`___forwarding___ + 767, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
* frame #0: 0x0000000110a9beaf CoreFoundation`___forwarding___ + 767
frame #1: 0x0000000110a9bb28 CoreFoundation`__forwarding_prep_0___ + 120
frame #2: 0x0000000110a1abfc CoreFoundation`CFURLCreateStringByReplacingPercentEscapes + 60
frame #3: 0x0000000110a5cec6 CoreFoundation`URLPathToPOSIXPath + 38
frame #4: 0x0000000110a1a1e7 CoreFoundation`CFURLCreateStringWithFileSystemPath + 439
frame #5: 0x0000000110a16f2c CoreFoundation`CFURLCopyFileSystemPath + 364
frame #6: 0x0000000110b05b25 CoreFoundation`extractQuadrupleFromPathIfPossible + 1221
frame #7: 0x0000000110b3f8c9 CoreFoundation`+[CFPrefsSearchListSource withSearchListForIdentifier:container:perform:] + 185
frame #8: 0x0000000110b2d017 CoreFoundation`_CFPreferencesCopyAppValueWithContainer + 183
frame #9: 0x0000000117a4f134 libAccessibility.dylib`_copyValuePreference + 138
frame #10: 0x0000000117a4ee14 libAccessibility.dylib`_getBooleanPreference + 24
frame #11: 0x0000000117a52312 libAccessibility.dylib`_AXSQuickSpeakEnabled + 76
frame #12: 0x000000010f0d57ad UIKit`-[UIApplication(UIKitApplicationAccessibility) _accessibilitySetUpQuickSpeak] + 79
frame #13: 0x00000001101a7129 Foundation`__NSFireDelayedPerform + 402
frame #14: 0x0000000110aa6364 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
frame #15: 0x0000000110aa5f11 CoreFoundation`__CFRunLoopDoTimer + 1089
frame #16: 0x0000000110a678b1 CoreFoundation`__CFRunLoopRun + 1937
frame #17: 0x0000000110a66e98 CoreFoundation`CFRunLoopRunSpecific + 488
frame #18: 0x0000000111bf8ad2 GraphicsServices`GSEventRunModal + 161
frame #19: 0x000000010ecd6676 UIKit`UIApplicationMain + 171
frame #20: 0x000000010deb1c41 SWPi2`main(argc=1, argv=0x00007fff51def770) + 129 at main.m:7
frame #21: 0x000000011255b92d libdyld.dylib`start + 1
thread forwarding:
0x110a9bc80 <+208>: movq %rbx, -0x40(%rbp)
0x110a9bc84 <+212>: leaq 0x2a3a0d(%rip), %rsi ; "_NSZombie_"
0x110a9bc8b <+219>: movl $0xa, %edx
0x110a9bc90 <+224>: movq %r14, %rdi
0x110a9bc93 <+227>: callq 0x110ba403c ; symbol stub for: strncmp
0x110a9bc98 <+232>: testl %eax, %eax
0x110a9bc9a <+234>: je 0x110a9be63 ; <+691>
0x110a9bca0 <+240>: movq 0x2ca1c1(%rip), %rsi ; "methodSignatureForSelector:"
0x110a9bca7 <+247>: movq %r12, %rdi
0x110a9bcaa <+250>: callq 0x110ba37e4 ; symbol stub for: class_respondsToSelector
0x110a9bcaf <+255>: testb %al, %al
0x110a9bcb1 <+257>: movq -0x40(%rbp), %r14
0x110a9bcb5 <+261>: movq -0x38(%rbp), %r13
0x110a9bcb9 <+265>: je 0x110a9beb4 ; <+772>
0x110a9bcbf <+271>: movq 0x2ca1a2(%rip), %rsi ; "methodSignatureForSelector:"
0x110a9bcc6 <+278>: movq %r14, %rdi
0x110a9bcc9 <+281>: movq -0x30(%rbp), %rdx
0x110a9bccd <+285>: callq *0x2dc525(%rip) ; (void *)0x00000001105d3800: objc_msgSend
0x110a9bcd3 <+291>: movq %rax, %r12
0x110a9bcd6 <+294>: testq %r12, %r12
0x110a9bcd9 <+297>: je 0x110a9bf11 ; <+865>
0x110a9bcdf <+303>: movq 0x2ca152(%rip), %rsi ; "_frameDescriptor"
0x110a9bce6 <+310>: movq %r12, %rdi
0x110a9bce9 <+313>: callq *0x2dc509(%rip) ; (void *)0x00000001105d3800: objc_msgSend
0x110a9bcef <+319>: movq %rax, %rbx
0x110a9bcf2 <+322>: movq (%rbx), %rax
0x110a9bcf5 <+325>: movzwl 0x22(%rax), %eax
0x110a9bcf9 <+329>: shrl $0x6, %eax
0x110a9bcfc <+332>: andq $0x1, %rax
0x110a9bd00 <+336>: cmpq %r13, %rax
0x110a9bd03 <+339>: je 0x110a9bd49 ; <+409>
0x110a9bd05 <+341>: movq -0x30(%rbp), %rdi
0x110a9bd09 <+345>: callq 0x110ba38ec ; symbol stub for: sel_getName
0x110a9bd0e <+350>: movq %rax, %rdx
0x110a9bd11 <+353>: movq (%rbx), %rax
0x110a9bd14 <+356>: movzwl 0x22(%rax), %eax
0x110a9bd18 <+360>: leaq 0x29b169(%rip), %rsi ; ""
0x110a9bd1f <+367>: leaq 0x2aa161(%rip), %r8 ; " not"
0x110a9bd26 <+374>: testb $0x40, %al
0x110a9bd28 <+376>: movq %r8, %rcx
0x110a9bd2b <+379>: cmovneq %rsi, %rcx
0x110a9bd2f <+383>: testq %r13, %r13
0x110a9bd32 <+386>: cmovneq %rsi, %r8
0x110a9bd36 <+390>: leaq 0x2f1983(%rip), %rsi ; #"*** NSForwarding: warning: method signature and compiler disagree on struct-return-edness of '%s'. Signature thinks it does%s return a struct, and compiler thinks it does%s."
0x110a9bd3d <+397>: movl $0x4, %edi
0x110a9bd42 <+402>: xorl %eax, %eax
Profiler stops in this place without zombie sign.
How to localize NSZombie in source code?

app crashes in iOS 8 when debugging, but works when not debugging

This app work fine on iOS 7 simulator without any issue. But when I'm debugging it on iOS 8.1 simulator it crashes. It would not even reach 1st view controller's viewDidLoad.
Just after compiler leaves applicaitondidFinishLaunchingWithOptions: method app crashes.
However I can run already built app in iOS 8.1 simulator without any issue. Crashes only when I'm running the app through Xcode. What could be the reason? (considering the fact that it's already debugging fine in iOS 7) ?
EDIT: (CRASH LOG)
UIKit`UIApplicationMain:
0x108ecff1e: pushq %rbp
0x108ecff1f: movq %rsp, %rbp
0x108ecff22: pushq %r15
0x108ecff24: pushq %r14
0x108ecff26: pushq %r13
0x108ecff28: pushq %r12
0x108ecff2a: pushq %rbx
0x108ecff2b: subq $0x38, %rsp
0x108ecff2f: movq %rcx, -0x48(%rbp)
0x108ecff33: movq %rdx, %r15
0x108ecff36: movq %rsi, %rbx
0x108ecff39: movl %edi, %r13d
0x108ecff3c: movq 0xb4ca8d(%rip), %rax ; (void *)0x000000010bcf1070: __stack_chk_guard
0x108ecff43: movq (%rax), %rax
0x108ecff46: movq %rax, -0x30(%rbp)
0x108ecff4a: leaq 0xdf66bb(%rip), %r14 ; _UIApplicationLinkedOnVersion
0x108ecff51: movl (%r14), %ecx
0x108ecff54: testl %ecx, %ecx
0x108ecff56: jne 0x108ecff7a ; UIApplicationMain + 92
0x108ecff58: xorl %eax, %eax
0x108ecff5a: cmpq $-0x1, 0xdf05ee(%rip) ; WebKitSetIsClassic + 7
0x108ecff62: je 0x108ecffa9 ; UIApplicationMain + 139
0x108ecff64: leaq 0xdf05e5(%rip), %rdi ; _UIApplicationLinkedOnVersionOnce
0x108ecff6b: leaq 0xb4fcfe(%rip), %rsi ; __block_literal_global1030
0x108ecff72: callq 0x1096a29e4 ; symbol stub for: dispatch_once
0x108ecff77: movl (%r14), %ecx
0x108ecff7a: xorl %eax, %eax
0x108ecff7c: cmpl $0x20100, %ecx
0x108ecff82: jb 0x108ecffa9 ; UIApplicationMain + 139
0x108ecff84: movq 0xdb8e15(%rip), %rdi ; (void *)0x000000010a4d7da8: NSAutoreleasePool
0x108ecff8b: movq 0xd8d406(%rip), %rsi ; "alloc"
0x108ecff92: movq 0xb4d0f7(%rip), %r14 ; (void *)0x000000010a881000: objc_msgSend
0x108ecff99: callq *%r14
0x108ecff9c: movq 0xd8d84d(%rip), %rsi ; "init"
0x108ecffa3: movq %rax, %rdi
0x108ecffa6: callq *%r14
0x108ecffa9: movq %r15, -0x50(%rbp)
0x108ecffad: movq %rax, -0x58(%rbp)
0x108ecffb1: cmpl $0x2, %r13d
0x108ecffb5: jl 0x108ed0019 ; UIApplicationMain + 251
0x108ecffb7: addq $0x8, %rbx
0x108ecffbb: decl %r13d
0x108ecffbe: leaq 0x8a9075(%rip), %r14 ; "-BuildDefaultPNG"
0x108ecffc5: leaq 0x8a907f(%rip), %r15 ; "-RegisterForSystemEvents"
0x108ecffcc: movq (%rbx), %r12
0x108ecffcf: movq %r12, %rdi
0x108ecffd2: movq %r14, %rsi
0x108ecffd5: callq 0x1096a2cd8 ; symbol stub for: strcmp
0x108ecffda: testl %eax, %eax
0x108ecffdc: je 0x108ed0009 ; UIApplicationMain + 235
0x108ecffde: movq %r12, %rdi
0x108ecffe1: movq %r15, %rsi
0x108ecffe4: callq 0x1096a2cd8 ; symbol stub for: strcmp
0x108ecffe9: testl %eax, %eax
0x108ecffeb: je 0x108ed0000 ; UIApplicationMain + 226
0x108ecffed: movq %r12, %rdi
0x108ecfff0: leaq 0x8a906d(%rip), %rsi ; "--RegisterForSystemEvents"
0x108ecfff7: callq 0x1096a2cd8 ; symbol stub for: strcmp
0x108ecfffc: testl %eax, %eax
0x108ecfffe: jne 0x108ed0010 ; UIApplicationMain + 242
0x108ed0000: movb $0x1, 0xdf656c(%rip) ; __ShouldLaunchSafe
0x108ed0007: jmp 0x108ed0010 ; UIApplicationMain + 242
0x108ed0009: movb $0x1, 0xdf6561(%rip) ; __IsRunningTests
0x108ed0010: addq $0x8, %rbx
0x108ed0014: decl %r13d
0x108ed0017: jne 0x108ecffcc ; UIApplicationMain + 174
0x108ed0019: xorl %eax, %eax
0x108ed001b: callq 0x1096a1592 ; symbol stub for: BKSDisplayServicesStart
0x108ed0020: callq 0x108ed0d0b ; UIApplicationInitialize
0x108ed0025: movq 0xdb8d24(%rip), %rdi ; (void *)0x0000000109c9ec80: UIApplication
0x108ed002c: movq 0xd8d39d(%rip), %rsi ; "class"
0x108ed0033: callq *0xb4d057(%rip) ; (void *)0x000000010a881000: objc_msgSend
0x108ed0039: movq %rax, %r15
0x108ed003c: movq -0x50(%rbp), %rbx
0x108ed0040: testq %rbx, %rbx
0x108ed0043: jne 0x108ed0081 ; UIApplicationMain + 355
0x108ed0045: movq 0xdb8d34(%rip), %rdi ; (void *)0x000000010a4d7e20: NSBundle
0x108ed004c: movq 0xd8e0dd(%rip), %rsi ; "mainBundle"
0x108ed0053: movq 0xb4d036(%rip), %r14 ; (void *)0x000000010a881000: objc_msgSend
0x108ed005a: callq *%r14
0x108ed005d: movq 0xd8e0d4(%rip), %rsi ; "infoDictionary"
0x108ed0064: movq %rax, %rdi
0x108ed0067: callq *%r14
0x108ed006a: movq 0xd8d38f(%rip), %rsi ; "objectForKey:"
0x108ed0071: leaq 0xb8b4b8(%rip), %rdx ; #"NSPrincipalClass"
0x108ed0078: movq %rax, %rdi
0x108ed007b: callq *%r14
0x108ed007e: movq %rax, %rbx
0x108ed0081: movq 0xd8e0c0(%rip), %rsi ; "length"
0x108ed0088: movq %rbx, %rdi
0x108ed008b: callq *0xb4cfff(%rip) ; (void *)0x000000010a881000: objc_msgSend
0x108ed0091: testq %rax, %rax
0x108ed0094: movq -0x48(%rbp), %r13
0x108ed0098: je 0x108ed0127 ; UIApplicationMain + 521
0x108ed009e: movq %rbx, %rdi
0x108ed00a1: callq 0x1096a19ca ; symbol stub for: NSClassFromString
0x108ed00a6: movq %rax, %r15
0x108ed00a9: testq %r15, %r15
0x108ed00ac: jne 0x108ed0127 ; UIApplicationMain + 521
0x108ed00ae: movq 0xdb8b33(%rip), %rdi ; (void *)0x000000010a4d8500: NSAssertionHandler
0x108ed00b5: movq 0xd8d47c(%rip), %rsi ; "currentHandler"
0x108ed00bc: movq 0xb4cfcd(%rip), %r12 ; (void *)0x000000010a881000: objc_msgSend
0x108ed00c3: callq *%r12
0x108ed00c6: movq %rax, -0x50(%rbp)
0x108ed00ca: movq 0xdb8b1f(%rip), %rdi ; (void *)0x000000010a4dae90: NSString
0x108ed00d1: movq 0xd8d468(%rip), %rsi ; "stringWithUTF8String:"
0x108ed00d8: leaq 0x8a8fb0(%rip), %rdx ; "int UIApplicationMain(int, char **, NSString *, NSString *)"
0x108ed00df: callq *%r12
0x108ed00e2: movq %rax, %r14
0x108ed00e5: movq 0xdb8b04(%rip), %rdi ; (void *)0x000000010a4dae90: NSString
0x108ed00ec: movq 0xd8d44d(%rip), %rsi ; "stringWithUTF8String:"
0x108ed00f3: leaq 0x8a868f(%rip), %rdx ; "/SourceCache/UIKit_Sim/UIKit-3318.16.14/UIApplication.m"
0x108ed00fa: callq *%r12
0x108ed00fd: movq %rax, %rcx
0x108ed0100: movq 0xd8e179(%rip), %rsi ; "handleFailureInFunction:file:lineNumber:description:"
0x108ed0107: movq %rbx, (%rsp)
0x108ed010b: leaq 0xb8b43e(%rip), %r9 ; #"Unable to instantiate the UIApplication subclass instance. No class named %# is loaded."
0x108ed0112: xorl %r15d, %r15d
0x108ed0115: movl $0xb36, %r8d
0x108ed011b: xorl %eax, %eax
0x108ed011d: movq %r14, %rdx
0x108ed0120: movq -0x50(%rbp), %rdi
0x108ed0124: callq *%r12
0x108ed0127: leaq 0x330(%rip), %rdi ; _UIApplicationHandleEvent
0x108ed012e: callq 0x1096a1d12 ; symbol stub for: GSEventRegisterEventCallBack
0x108ed0133: leaq 0x8f1(%rip), %rdi ; _UIApplicationHandleHIDEvent
0x108ed013a: callq 0x1096a15bc ; symbol stub for: BKSHIDEventRegisterEventCallback
0x108ed013f: movq 0xd8d28a(%rip), %rsi ; "class"
0x108ed0146: movq 0xb4cf43(%rip), %r12 ; (void *)0x000000010a881000: objc_msgSend
0x108ed014d: movq %r15, %rdi
0x108ed0150: callq *%r12
0x108ed0153: movq 0xd8e196(%rip), %rsi ; "registerAsSystemApp"
0x108ed015a: movq %rax, %rdi
0x108ed015d: callq *%r12
0x108ed0160: movb %al, 0xdf640d(%rip) ; __RegisterAsSystemApp
0x108ed0166: cmpq $-0x1, 0xdf0372(%rip) ; __signalRunLoopSource + 7
0x108ed016e: jne 0x108ed0446 ; UIApplicationMain + 1320
0x108ed0174: cmpb $0x0, 0xdf036d(%rip) ; _UIApplicationIsExtension.once + 7
0x108ed017b: je 0x108ed0186 ; UIApplicationMain + 616
0x108ed017d: xorl %eax, %eax
0x108ed017f: callq 0x1096a1cee ; symbol stub for: GSEventInitializeAsExtension
0x108ed0184: jmp 0x108ed0192 ; UIApplicationMain + 628
0x108ed0186: movzbl 0xdf63e6(%rip), %edi ; __RegisterAsSystemApp
0x108ed018d: callq 0x1096a1ce8 ; symbol stub for: GSEventInitialize
0x108ed0192: movq 0xb4cca7(%rip), %rax ; (void *)0x000000010ae3f300: NSDefaultRunLoopMode
0x108ed0199: movq (%rax), %rdi
0x108ed019c: callq 0x1096a1d06 ; symbol stub for: GSEventPushRunLoopMode
0x108ed01a1: movq 0xd8e430(%rip), %rsi ; "_startWindowServerIfNecessary"
0x108ed01a8: movq %r15, %rdi
0x108ed01ab: callq *%r12
0x108ed01ae: movq 0xd8e42b(%rip), %rsi ; "_startStatusBarServerIfNecessary"
0x108ed01b5: movq %r15, %rdi
0x108ed01b8: callq *%r12
0x108ed01bb: movq %r15, %rdi
0x108ed01be: callq 0x108ecfdd0 ; UIApplicationInstantiateSingleton
0x108ed01c3: movq 0xdb8c56(%rip), %rdi ; (void *)0x000000010e867498: FBSUIApplicationSystemService
0x108ed01ca: movq 0xd8d1c7(%rip), %rsi ; "alloc"
0x108ed01d1: callq *%r12
0x108ed01d4: movq 0xd8e40d(%rip), %rsi ; "initWithQueue:"
0x108ed01db: movq 0xb4c7fe(%rip), %rdx ; (void *)0x000000010bbe4780: _dispatch_main_q
0x108ed01e2: movq %rax, %rdi
0x108ed01e5: callq *%r12
0x108ed01e8: movq %rax, 0xdf0319(%rip) ; __systemAppService
0x108ed01ef: movq 0xdf6372(%rip), %rdx ; UIApp
0x108ed01f6: movq 0xd8d48b(%rip), %rsi ; "setDelegate:"
0x108ed01fd: movq %rax, %rdi
0x108ed0200: callq *%r12
0x108ed0203: movq 0xdb8c1e(%rip), %rdi ; (void *)0x000000010e867650: FBSUIApplicationWorkspace
0x108ed020a: movq 0xd8d187(%rip), %rsi ; "alloc"
0x108ed0211: callq *%r12
0x108ed0214: movq %rax, %r14
0x108ed0217: movq 0xdb8c12(%rip), %rbx ; (void *)0x000000010e868168: FBSSerialQueue
0x108ed021e: movq 0xb4cc13(%rip), %rax ; (void *)0x000000010ae3f308: NSRunLoopCommonModes
0x108ed0225: movq (%rax), %rax
0x108ed0228: movq %rax, -0x40(%rbp)
0x108ed022c: leaq 0xb8d9dd(%rip), %rax ; #"UIInitializationRunLoopMode"
0x108ed0233: movq %rax, -0x38(%rbp)
0x108ed0237: movq 0xdb897a(%rip), %rdi ; (void *)0x000000010ae78cd8: NSArray
0x108ed023e: movq 0xd8d0fb(%rip), %rsi ; "arrayWithObjects:count:"
0x108ed0245: leaq -0x40(%rbp), %rdx
0x108ed0249: movl $0x2, %ecx
0x108ed024e: callq *%r12
0x108ed0251: movq 0xd8e398(%rip), %rsi ; "queueWithMainRunLoopModes:"
0x108ed0258: movq %rbx, %rdi
0x108ed025b: movq %rax, %rdx
0x108ed025e: callq *%r12
0x108ed0261: movq 0xd8e390(%rip), %rsi ; "initWithSerialQueue:"
0x108ed0268: movq %r14, %rdi
0x108ed026b: movq %rax, %rdx
0x108ed026e: callq *%r12
0x108ed0271: movq %rax, 0xdf0238(%rip) ; __workspace
0x108ed0278: movq 0xdf62e9(%rip), %rdx ; UIApp
0x108ed027f: movq 0xd8d402(%rip), %rsi ; "setDelegate:"
0x108ed0286: movq %rax, %rdi
0x108ed0289: callq *%r12
0x108ed028c: movq 0xdb8965(%rip), %rdi ; (void *)0x0000000109ca4540: UIDevice
0x108ed0293: movq 0xd8d2d6(%rip), %rsi ; "currentDevice"
0x108ed029a: callq *%r12
0x108ed029d: movq 0xd8d2d4(%rip), %rsi ; "userInterfaceIdiom"
0x108ed02a4: movq %rax, %rdi
0x108ed02a7: callq *%r12
0x108ed02aa: cmpq $0x1, %rax
0x108ed02ae: jne 0x108ed02c4 ; UIApplicationMain + 934
0x108ed02b0: movq 0xdb8af1(%rip), %rdi ; (void *)0x0000000109cab250: UIClassicController
0x108ed02b7: movq 0xd8e062(%rip), %rsi ; "sharedClassicController"
0x108ed02be: callq *0xb4cdcc(%rip) ; (void *)0x000000010a881000: objc_msgSend
0x108ed02c4: testq %r13, %r13
0x108ed02c7: jne 0x108ed0307 ; UIApplicationMain + 1001
0x108ed02c9: movq 0xdb8ab0(%rip), %rdi ; (void *)0x000000010a4d7e20: NSBundle
0x108ed02d0: movq 0xd8de59(%rip), %rsi ; "mainBundle"
0x108ed02d7: callq *%r12
0x108ed02da: movq 0xd8de57(%rip), %rsi ; "infoDictionary"
0x108ed02e1: movq %rax, %rdi
0x108ed02e4: callq *%r12
0x108ed02e7: movq 0xd8d112(%rip), %rsi ; "objectForKey:"
0x108ed02ee: leaq 0xb8b27b(%rip), %rdx ; #"UIApplicationDelegateClass"
0x108ed02f5: movq %rax, %rdi
0x108ed02f8: callq *%r12
0x108ed02fb: movq %rax, %r13
0x108ed02fe: testq %r13, %r13
0x108ed0301: je 0x108ed0401 ; UIApplicationMain + 1251
0x108ed0307: movq %r13, %rdi
0x108ed030a: callq 0x1096a19ca ; symbol stub for: NSClassFromString
0x108ed030f: movq %rax, %r14
0x108ed0312: testq %r14, %r14
0x108ed0315: jne 0x108ed0384 ; UIApplicationMain + 1126
0x108ed0317: movq 0xdb88ca(%rip), %rdi ; (void *)0x000000010a4d8500: NSAssertionHandler
0x108ed031e: movq 0xd8d213(%rip), %rsi ; "currentHandler"
0x108ed0325: callq *%r12
0x108ed0328: movq %rax, %r15
0x108ed032b: movq 0xdb88be(%rip), %rdi ; (void *)0x000000010a4dae90: NSString
0x108ed0332: movq 0xd8d207(%rip), %rsi ; "stringWithUTF8String:"
0x108ed0339: leaq 0x8a8d4f(%rip), %rdx ; "int UIApplicationMain(int, char **, NSString *, NSString *)"
0x108ed0340: callq *%r12
0x108ed0343: movq %rax, %rbx
0x108ed0346: movq 0xdb88a3(%rip), %rdi ; (void *)0x000000010a4dae90: NSString
0x108ed034d: movq 0xd8d1ec(%rip), %rsi ; "stringWithUTF8String:"
0x108ed0354: leaq 0x8a842e(%rip), %rdx ; "/SourceCache/UIKit_Sim/UIKit-3318.16.14/UIApplication.m"
0x108ed035b: callq *%r12
0x108ed035e: movq %rax, %rcx
0x108ed0361: movq 0xd8df18(%rip), %rsi ; "handleFailureInFunction:file:lineNumber:description:"
0x108ed0368: movq %r13, (%rsp)
0x108ed036c: leaq 0xb8b21d(%rip), %r9 ; #"Unable to instantiate the UIApplication delegate instance. No class named %# is loaded."
0x108ed0373: movl $0xb62, %r8d
0x108ed0379: xorl %eax, %eax
0x108ed037b: movq %rbx, %rdx
0x108ed037e: movq %r15, %rdi
0x108ed0381: callq *%r12
0x108ed0384: movq 0xdb89c5(%rip), %rdi ; (void *)0x0000000109c9ec80: UIApplication
0x108ed038b: movq 0xd8d03e(%rip), %rsi ; "class"
0x108ed0392: callq *%r12
0x108ed0395: movq 0xd8e264(%rip), %rsi ; "isSubclassOfClass:"
0x108ed039c: movq %r14, %rdi
0x108ed039f: movq %rax, %rdx
0x108ed03a2: callq *%r12
0x108ed03a5: movq 0xdf61bc(%rip), %rbx ; UIApp
0x108ed03ac: testb %al, %al
0x108ed03ae: je 0x108ed03c5 ; UIApplicationMain + 1191
0x108ed03b0: movq 0xd8d2d1(%rip), %rsi ; "setDelegate:"
0x108ed03b7: movq %rbx, %rdi
0x108ed03ba: movq %rbx, %rdx
0x108ed03bd: callq *0xb4cccd(%rip) ; (void *)0x000000010a881000: objc_msgSend
0x108ed03c3: jmp 0x108ed0401 ; UIApplicationMain + 1251
0x108ed03c5: movq 0xd8cfcc(%rip), %rsi ; "alloc"
0x108ed03cc: movq %r14, %rdi
0x108ed03cf: callq *%r12
0x108ed03d2: movq 0xd8d417(%rip), %rsi ; "init"
0x108ed03d9: movq %rax, %rdi
0x108ed03dc: callq *%r12
0x108ed03df: movq 0xd8d4d2(%rip), %rsi ; "autorelease"
0x108ed03e6: movq %rax, %rdi
0x108ed03e9: callq *%r12
0x108ed03ec: movq 0xd8e215(%rip), %rsi ; "_setDelegate:assumeOwnership:"
0x108ed03f3: movl $0x1, %ecx
0x108ed03f8: movq %rbx, %rdi
0x108ed03fb: movq %rax, %rdx
0x108ed03fe: callq *%r12
0x108ed0401: movq 0xd8cf78(%rip), %rsi ; "release"
0x108ed0408: movq -0x58(%rbp), %rdi
0x108ed040c: callq *%r12
0x108ed040f: movq 0xdf6152(%rip), %rdi ; UIApp
0x108ed0416: movq 0xd8e1f3(%rip), %rsi ; "_run"
0x108ed041d: callq *%r12
0x108ed0420: movq 0xb4c5a9(%rip), %rax ; (void *)0x000000010bcf1070: __stack_chk_guard
0x108ed0427: movq (%rax), %rax
0x108ed042a: cmpq -0x30(%rbp), %rax
0x108ed042e: jne 0x108ed0441 ; UIApplicationMain + 1315
0x108ed0430: xorl %eax, %eax
0x108ed0432: addq $0x38, %rsp
0x108ed0436: popq %rbx
0x108ed0437: popq %r12
0x108ed0439: popq %r13
0x108ed043b: popq %r14
0x108ed043d: popq %r15
0x108ed043f: popq %rbp
0x108ed0440: retq
0x108ed0441: callq 0x1096a2936 ; symbol stub for: __stack_chk_fail
0x108ed0446: leaq 0xdf0093(%rip), %rdi ; _UIApplicationIsExtension.once
0x108ed044d: leaq 0xb4f57c(%rip), %rsi ; __block_literal_global616
0x108ed0454: callq 0x1096a29e4 ; symbol stub for: dispatch_once
0x108ed0459: jmp 0x108ed0174 ; UIApplicationMain + 598
breakpoint stops near :
0x108ed0420: movq 0xb4c5a9(%rip), %rax ; (void *)0x000000010bcf1070: __stack_chk_guard
I'm working with xcode 6.3 and swift 1.2. It seems that there is a problem with the pod that you've imported. Try to update the pod installed, then restart xcode and try again. It worked for me :)

Debugging in XCode: Exception Breakpoints

I'm debugging a random SIGTRAP crash right now that just happens in the background. It's probably something that has to do with an NSManagedObjectContext somewhere.
Besides that, I'm trying to debug it using an exception breakpoint to at least find out where it's originating from. The only problem is that the crash/breakpoint occurs in a 0 objc_exception_throw, which is no help to me.
The data I get back looks like this:
libobjc.A.dylib`objc_exception_throw:
0x32a3a960: push {r4, r5, r6, r7, lr} // breakpoint stops here
0x32a3a962: add r7, sp, #12
0x32a3a964: mov r4, r0
0x32a3a966: movs r0, #16
0x32a3a968: blx 0x32a46854 ; symbol stub for: -[NSObject isEqual:]
So my question is, how I can I create an exception breakpoint to initiate itself earlier? I'm trying to make the breakpoint occur in the last bit of actual Objective-C code before the crash.
I have tried editing the breakpoint to be shared, break on throw, then break on catch, and have changed the type of exception between Objective-C, C++, and "all" with no luck.
How can I make the exception breakpoint throw earlier?
Unless there is a way to decipher the code I posted. If that's possible, please give me a brief explanation of what it means, and how you deciphered it so I can learn to do so as well :)
Thanks everyone!
If I let the program run...
It continues to the crash, which looks like this:
libsystem_kernel.dylib`mach_msg_trap:
0x30830ea0: mov r12, sp
0x30830ea4: push {r4, r5, r6, r8}
0x30830ea8: ldm r12, {r4, r5, r6}
0x30830eac: mvn r12, #30
0x30830eb0: svc #128
0x30830eb4: pop {r4, r5, r6, r8} // SIGTRAP throws here
0x30830eb8: bx lr
Stack trace when running command "bt" as a debugger command
* thread #13: tid = 0x2337, 0x32a3a960 libobjc.A.dylib`objc_exception_throw, stop reason = breakpoint 1.1
frame #0: 0x32a3a960 libobjc.A.dylib`objc_exception_throw
frame #1: 0x340f9fee CoreData`-[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 298
frame #2: 0x341522d2 CoreData`-[NSManagedObjectContext save:] + 730
frame #3: 0x32054b02 UIKit`__84-[UIManagedDocument writeContents:toURL:forSaveOperation:originalContentsURL:error:]_block_invoke_0 + 30
frame #4: 0x34155bc0 CoreData`developerSubmittedBlockToNSManagedObjectContextPerform + 88
frame #5: 0x36e3d4b6 libdispatch.dylib`_dispatch_client_callout + 22
frame #6: 0x36e419f6 libdispatch.dylib`_dispatch_barrier_sync_f_invoke + 30
frame #7: 0x34155d42 CoreData`-[NSManagedObjectContext performBlockAndWait:] + 174
frame #8: 0x32054862 UIKit`-[UIManagedDocument writeContents:toURL:forSaveOperation:originalContentsURL:error:] + 986
frame #9: 0x3205418a UIKit`-[UIManagedDocument writeContents:andAttributes:safelyToURL:forSaveOperation:error:] + 698
frame #10: 0x32017ce4 UIKit`__block_global_4 + 68
frame #11: 0x32017c80 UIKit`__block_global_3 + 156
frame #12: 0x339c767c Foundation`-[NSFileCoordinator _invokeAccessor:thenCompletionHandler:] + 144
frame #13: 0x339c791e Foundation`__73-[NSFileCoordinator coordinateWritingItemAtURL:options:error:byAccessor:]_block_invoke_0 + 90
frame #14: 0x339c894e Foundation`-[NSFileCoordinator(NSPrivate) _invokeAccessor:orDont:thenRelinquishAccessClaimForID:] + 202
frame #15: 0x339c926c Foundation`-[NSFileCoordinator(NSPrivate) _coordinateWritingItemAtURL:options:error:byAccessor:] + 548
frame #16: 0x339c78be Foundation`-[NSFileCoordinator coordinateWritingItemAtURL:options:error:byAccessor:] + 90
frame #17: 0x32017254 UIKit`-[UIDocument _coordinateWritingItemAtURL:error:byAccessor:] + 720
frame #18: 0x320179a0 UIKit`__59-[UIDocument saveToURL:forSaveOperation:completionHandler:]_block_invoke_0 + 284
frame #19: 0x36e3e11e libdispatch.dylib`_dispatch_call_block_and_release + 10
frame #20: 0x36e41ece libdispatch.dylib`_dispatch_queue_drain$VARIANT$mp + 142
frame #21: 0x36e41dc0 libdispatch.dylib`_dispatch_queue_invoke$VARIANT$mp + 40
frame #22: 0x36e4291c libdispatch.dylib`_dispatch_root_queue_drain + 184
frame #23: 0x36e42ac0 libdispatch.dylib`_dispatch_worker_thread2 + 84
frame #24: 0x33ba7a10 libsystem_c.dylib`_pthread_wqthread + 360
frame #25: 0x33ba78a4 libsystem_c.dylib`start_wqthread + 8
Check out the link that Matt Wilding posted in the comments of his answer!
You don't have much control over where that breakpoint triggers. Once you've hit the breakpoint though, you can use the bt command to print the current stack trace.
EDIT: With the backtrace...
It looks like UIDocument's -saveToURL:forSaveOperation:completionHandler: method is the culprit. I've never used the class before, so I can't help too much. If you're calling that method anywhere in your code (like from a block?), you could also put a breakpoint there, in anticipation of the failure.

Resources