how to interpret this crash log of iphone - iphone

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x00004420 objc_msgSend + 24
1 CoreFoundation 0x000042a6 CFRetain + 54
2 CoreFoundation 0x0000a9f0 __CFBasicHashStandardRetainValue + 8
3 CoreFoundation 0x000054c0 __CFBasicHashAddValue + 100
4 CoreFoundation 0x00006184 CFBasicHashAddValue + 276
5 CoreFoundation 0x00006cfe CFDictionaryCreate + 58
6 CoreFoundation 0x00033d7c -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 1456
7 CoreFoundation 0x000361bc -[NSDictionary initWithObjectsAndKeys:] + 776
8 iota 0x0000cb04 -[CorpDirViewController reloadDisplayList] (CorpDirViewController.m:833)
9 iota 0x000098ba -[CorpDirViewController refreshDataAndDisplay] (CorpDirViewController.m:134)
10 iota 0x00009b62 -[CorpDirViewController handleNotication:] (CorpDirViewController.m:197)
11 Foundation 0x00015432 _nsnote_callback + 150
12 CoreFoundation 0x000271da __CFXNotificationPost_old + 390
13 CoreFoundation 0x00026e7a _CFXNotificationPostNotification + 122
14 Foundation 0x0000b9f6 -[NSNotificationCenter postNotification:] + 138
15 Foundation 0x0007ae02 postQueueNotifications + 258
16 Foundation 0x0007afae __NSPostIdleQueueNotes + 6
17 CoreFoundation 0x00031084 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 12
18 CoreFoundation 0x00030eb2 __CFRunLoopDoObservers + 494
19 CoreFoundation 0x00028206 __CFRunLoopRun + 934
20 CoreFoundation 0x00027d74 CFRunLoopRunSpecific + 220
21 CoreFoundation 0x00027c82 CFRunLoopRunInMode + 54
22 GraphicsServices 0x00004e84 GSEventRunModal + 188
23 UIKit 0x00004f8c -[UIApplication _run] + 564
24 UIKit 0x000024cc UIApplicationMain + 964
25 iota 0x00005582 main (main.m:17)
26 iota 0x00005544 0x1000 + 17732

From the looks of the log, you have overreleased something and that is causing a crash. Take a look at this line in your code:
8 iota 0x0000cb04 -[CorpDirViewController reloadDisplayList] (CorpDirViewController.m:833)
Which has the file and the line of code affected:
[CorpDirViewController reloadDisplayList] (CorpDirViewController.m:833)

Related

NSInvalidArgumentException', reason: '-[__SwiftValue set]

Scenario
I have a SwiftUI app that has been working perfectly fine.
I upgrade Xcode to 13.2.1 and I'm able to launch the application but when I navigate to a certain part of the application I'm getting this error on device and during SwiftUI preview.
'NSInvalidArgumentException', reason: '-[__SwiftValue set]: unrecognized selector sent to instance 0x600001bd9590'
Feedback / Assistance
Can anyone provide instructions / steps to debug this?
How can I find out what is instance 0x600001bd9590 and who is setting the NSInvalidArgumentException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__SwiftValue set]: unrecognized selector sent to instance 0x600001bd9590'
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/m1/Library/Developer/Xcode/DerivedData/NT-dfyuqrdtadtqdkaxajldzwimkhru/Build/Intermediates.noindex/Previews/NT/Products/Debug-iphonesimulator DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot//System/Library/PrivateFrameworks/PreviewsInjection.framework/PreviewsInjection DYLD_FRAMEWORK_PATH=/Users/m1/Library/Developer/Xcode/DerivedData/NT-dfyuqrdtadtqdkaxajldzwimkhru/Build/Intermediates.noindex/Previews/NT/Products/Debug-iphonesimulator
abort() called
Last Exception Backtrace:
0 CoreFoundation 0x1803e1174 __exceptionPreprocess + 216
1 libobjc.A.dylib 0x180193384 objc_exception_throw + 56
2 CoreFoundation 0x1803f0530 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
3 CoreFoundation 0x1803e53fc ___forwarding___ + 1408
4 CoreFoundation 0x1803e743c _CF_forwarding_prep_0 + 92
5 UIFoundation 0x18410cc7c -[NSCoreTypesetter _NSFastDrawString:length:attributes:paragraphStyle:typesetterBehavior:lineBreakMode:rect:padding:graphicsContext:baselineRendering:usesFontLeading:usesScreenFont:scrollable:syncAlignment:mirrored:boundingRectPointer:baselineOffsetPointer:drawingContext:] + 3820
6 UIFoundation 0x18410d6c0 -[NSCoreTypesetter _stringDrawingCoreTextEngineWithOriginalString:rect:padding:graphicsContext:forceClipping:attributes:stringDrawingOptions:drawingContext:stringDrawingInterface:] + 1200
7 UIFoundation 0x184107bf0 __NSStringDrawingEngine + 1480
8 UIFoundation 0x184108b24 -[NSAttributedString(NSExtendedStringDrawing) drawWithRect:options:context:] + 128
9 UIKitCore 0x18524a2b4 -[UILabel _drawTextInRect:baselineCalculationOnly:] + 3100
10 UIKitCore 0x18524abb8 -[UILabel _drawTextInRect:] + 248
11 UIKitCore 0x185249330 -[UILabel drawTextInRect:] + 536
12 UIKitCore 0x185300714 -[UIView(CALayerDelegate) drawLayer:inContext:] + 536
13 QuartzCore 0x1883ad940 CABackingStoreUpdate_ + 192
14 QuartzCore 0x1884e0078 invocation function for block in CA::Layer::display_() + 52
15 QuartzCore 0x1884d66dc -[CALayer _display] + 1688
16 QuartzCore 0x1884e8ce4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 408
17 QuartzCore 0x18843c04c CA::Context::commit_transaction(CA::Transaction*, double, double*) + 516
18 QuartzCore 0x188467860 CA::Transaction::commit() + 684
19 UIKitCore 0x184dc48f4 _afterCACommitHandler + 104
20 CoreFoundation 0x18034ef9c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
21 CoreFoundation 0x180349724 __CFRunLoopDoObservers + 556
22 CoreFoundation 0x180349c84 __CFRunLoopRun + 976
23 CoreFoundation 0x1803493a8 CFRunLoopRunSpecific + 572
24 GraphicsServices 0x18c03c5ec GSEventRunModal + 160
25 UIKitCore 0x184d937ac -[UIApplication _run] + 992
26 UIKitCore 0x184d982e8 UIApplicationMain + 112
27 SwiftUI 0x1b99bc7f4 closure #1 in KitRendererCommon(_:) + 160
28 SwiftUI 0x1b99bc750 runApp<A>(_:) + 164
29 SwiftUI 0x1b94124f4 static App.main() + 80
30 NT 0x102d46c24 static NTApp.$main() + 100
31 NT 0x102d46d38 main + 76
32 dyld_sim 0x10368dca0 start_sim + 20
33 dyld 0x1033d50f4 start + 520
34 ??? 0x4c15800000000000 ???
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x1c997ca60 __pthread_kill + 8
1 libsystem_pthread.dylib 0x1c99ce380 pthread_kill + 256
2 libsystem_c.dylib 0x1800fe3d8 abort + 120
3 libc++abi.dylib 0x18022de94 abort_message + 128
4 libc++abi.dylib 0x18021fc98 demangling_terminate_handler() + 296
5 libobjc.A.dylib 0x180176e84 _objc_terminate() + 124
6 libc++abi.dylib 0x18022d358 std::__terminate(void (*)()) + 16
7 libc++abi.dylib 0x18022fd98 __cxa_rethrow + 144
8 libobjc.A.dylib 0x1801934d4 objc_exception_rethrow + 40
9 CoreFoundation 0x180349494 CFRunLoopRunSpecific + 808
10 GraphicsServices 0x18c03c5ec GSEventRunModal + 160
11 UIKitCore 0x184d937ac -[UIApplication _run] + 992
12 UIKitCore 0x184d982e8 UIApplicationMain + 112
13 SwiftUI 0x1b99bc7f4 closure #1 in KitRendererCommon(_:) + 160
14 SwiftUI 0x1b99bc750 runApp<A>(_:) + 164
15 SwiftUI 0x1b94124f4 static App.main() + 80
16 NT 0x102d46c24 static NTApp.$main() + 100 (NTApp.swift:10)
17 NT 0x102d46d38 main + 76
18 dyld_sim 0x10368dca0 start_sim + 20
19 dyld 0x1033d50f4 start + 520

GULUserDefaults crash Swift Xcode (maybe firebase)

I am facing this error really randomly and rarely but still want to fix it. I don't know how to reproduce it as its not happening on my device but on other users devices.
The crash log does not really help me, at least I cannot figure out where the is issue is coming from and how to solve it.
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x000000000000001c
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x19fa3513c object_isClass + 16
1 Foundation 0x18c807978 KVO_IS_RETAINING_ALL_OBSERVERS_OF_THIS_OBJECT_IF_IT_CRASHES_AN_OBSERVER_WAS_OVERRELEASED_OR_SMASHED + 48
2 Foundation 0x18c807774 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:] + 288
3 Foundation 0x18c7413f8 -[NSObject(NSKeyValueObservingPrivate) _notifyObserversOfChangeFromValuesForKeys:toValuesForKeys:] + 836
4 CoreFoundation 0x18b3cc60c -[CFPrefsSource forEachObserver:] + 336
5 CoreFoundation 0x18b3cde3c -[CFPrefsSource _notifyObserversOfChangeFromValuesForKeys:toValuesForKeys:] + 112
6 CoreFoundation 0x18b541b68 ___CFPrefsDeliverPendingKVONotificationsGuts_block_invoke + 428
7 CoreFoundation 0x18b4253f0 __CFDictionaryApplyFunction_block_invoke + 28
8 CoreFoundation 0x18b50bd94 CFBasicHashApply + 144
9 CoreFoundation 0x18b4253ac CFDictionaryApplyFunction + 240
10 CoreFoundation 0x18b53d748 _CFPrefsDeliverPendingKVONotificationsGuts + 300
11 CoreFoundation 0x18b53bf44 -[_CFXPreferences _deliverPendingKVONotifications] + 96
12 CoreFoundation 0x18b4ff194 __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke + 432
13 CoreFoundation 0x18b4fe720 normalizeQuintuplet + 356
14 CoreFoundation 0x18b4fefbc -[_CFXPreferences withSearchListForIdentifier:container:cloudConfigurationURL:perform:] + 152
15 CoreFoundation 0x18b3c1580 -[_CFXPreferences setValue:forKey:appIdentifier:container:configurationURL:] + 128
16 CoreFoundation 0x18b53fdd8 _CFPreferencesSetAppValueWithContainerAndConfiguration + 136
17 GoogleUtilities 0x1012a7acc -[GULUserDefaults setObject:forKey:] + 109 (GULUserDefaults.m:109)
18 FirebaseMessaging 0x1011a86b0 -[FIRMessagingPubSub archivePendingTopicsList:] + 238 (FIRMessagingPubSub.m:238)
19 FirebaseMessaging 0x1011a67d4 -[FIRMessagingPendingTopicsList addOperationForTopic:withAction:completion:] + 164 (FIRMessagingPendingTopicsList.m:164)
20 FirebaseMessaging 0x1011a8304 -[FIRMessagingPubSub subscribeToTopic:handler:] + 184 (FIRMessagingPubSub.m:184)
21 FirebaseMessaging 0x1011a16a8 __44-[FIRMessaging subscribeToTopic:completion:]_block_invoke + 674 (FIRMessaging.m:674)
22 FirebaseInstanceID 0x101166674 __39-[FIRInstanceID instanceIDWithHandler:]_block_invoke + 220 (FIRInstanceID.m:220)
23 FirebaseInstanceID 0x101167ee8 __34-[FIRInstanceID getIDWithHandler:]_block_invoke + 454 (FIRInstanceID.m:454)
24 FirebaseInstallations 0x1011378a8 __49-[FIRInstallations installationIDWithCompletion:]_block_invoke + 210 (FIRInstallations.m:210)
25 FBLPromises 0x100deda48 __56-[FBLPromise chainOnQueue:chainedFulfill:chainedReject:]_block_invoke.48 + 273 (FBLPromise.m:273)
26 libdispatch.dylib 0x18b0d324c _dispatch_call_block_and_release + 32
27 libdispatch.dylib 0x18b0d4db0 _dispatch_client_callout + 20
28 libdispatch.dylib 0x18b0e2800 _dispatch_main_queue_callback_4CF + 920
29 CoreFoundation 0x18b45c11c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
30 CoreFoundation 0x18b456120 __CFRunLoopRun + 2508
31 CoreFoundation 0x18b45521c CFRunLoopRunSpecific + 600
32 GraphicsServices 0x1a24d4784 GSEventRunModal + 164
33 UIKitCore 0x18de8e200 -[UIApplication _run] + 1072
34 UIKitCore 0x18de93a74 UIApplicationMain + 168
35 MyApp 0x100424788 main + 20 (HashtagTableViewCell.swift:20)
36 libdyld.dylib 0x18b1156c0 start + 4
It looks like its coming from firebase but ultimately it crashes on the user defaults.
Any idea or hint how to solve this is greatly appreciated.
GULUserDefaults.m line 109
this is the headline of the crash in my firebase Crashlytics

Need help in finding crash cause

Below are the crash logs from an iPad. I'm getting this crash randomly while I'm pushing and popping out a UIViewController from Navigation controller. Any help/pointer is appreciated.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x31430386 _ZL12realizeClassP7class_t + 34
1 libobjc.A.dylib 0x314303e6 _ZL12realizeClassP7class_t + 130
2 libobjc.A.dylib 0x3142a836 prepareForMethodLookup + 74
3 libobjc.A.dylib 0x3142a740 lookUpMethod + 40
4 libobjc.A.dylib 0x3142a70c _class_lookupMethodAndLoadCache3 + 12
5 libobjc.A.dylib 0x31429fc4 objc_msgSend_uncached + 20
6 UIKit 0x3186553e -[UINavigationItem _accumulateViewsFromItems:isLeft:refreshViews:] + 270
7 UIKit 0x31851244 -[UINavigationItem _updateViewsForBarSizeChangeAndApply:] + 124
8 UIKit 0x319e023a __33-[UINavigationBar layoutSubviews]_block_invoke_0 + 250
9 UIKit 0x31838b46 +[UIView(Animation) _performWithoutAnimation:] + 62
10 UIKit 0x3184d2e2 -[UINavigationBar layoutSubviews] + 382
11 UIKit 0x31814f30 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 176
12 CoreFoundation 0x315431f4 -[NSObject performSelector:withObject:] + 36
13 QuartzCore 0x35459a9e -[CALayer layoutSublayers] + 210
14 QuartzCore 0x354596b6 CA::Layer::layout_if_needed(CA::Transaction*) + 210
15 QuartzCore 0x3545d83c CA::Context::commit_transaction(CA::Transaction*) + 220
16 QuartzCore 0x3545d578 CA::Transaction::commit() + 308
17 QuartzCore 0x354554b2 CA:::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 50
18 CoreFoundation 0x315b8b14 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 12
19 CoreFoundation 0x315b6d50 __CFRunLoopDoObservers + 252
20 CoreFoundation 0x315b70aa __CFRunLoopRun + 754
21 CoreFoundation 0x3153a49e CFRunLoopRunSpecific + 294
22 CoreFoundation 0x3153a366 CFRunLoopRunInMode + 98
23 GraphicsServices 0x32a13432 GSEventRunModal + 130
24 UIKit 0x3183fcce UIApplicationMain + 1074
25 SmartClassTPS 0x000b551a main (main.m:16)
26 SmartClassTPS 0x000b5170 start + 32
Was able to figure out long back but forgot to update here. KVO observer not removed! Silly me :-|. BTW thanks for the support. SO rocks.
Most probably you forgot to clear some delegates before releasing an object.

Why deleteRecording crashed (AVAudioRecorder, iOS)?

[recorder deleteRecording]; works well 30 times, but around 31 it crashes.
0 libobjc.A.dylib 0x3266fc98 objc_msgSend + 16
1 Foundation 0x328c203c -[NSError dealloc] + 36
2 CoreFoundation 0x30d2dc3c -[NSObject(NSObject) release] + 24
3 Foundation 0x328e687c -[NSFilesystemItemRemoveOperation dealloc] + 36
4 Foundation 0x328bc7b2 -[NSOperation release] + 38
5 CoreFoundation 0x30d2e19a CFRelease + 62
6 CoreFoundation 0x30d30eb4 _CFAutoreleasePoolPop + 140
7 Foundation 0x328abbae NSPopAutoreleasePool + 2
8 Foundation 0x3293a908 __NSThreadPerformPerform + 620
9 CoreFoundation 0x30da0a72 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 6
10 CoreFoundation 0x30da2758 __CFRunLoopDoSources0 + 376
11 CoreFoundation 0x30da34e4 __CFRunLoopRun + 224
12 CoreFoundation 0x30d33ebc CFRunLoopRunSpecific + 224
13 CoreFoundation 0x30d33dc4 CFRunLoopRunInMode + 52
14 GraphicsServices 0x31896418 GSEventRunModal + 108
15 GraphicsServices 0x318964c4 GSEventRun + 56
16 UIKit 0x355b9d62 -[UIApplication _run] + 398
17 UIKit 0x355b7800 UIApplicationMain + 664
18 AppName 0x000020f6 main (main.m:16)
19 AppName 0x00002050 start + 44
I found that this happens when deleteRecording is trying to delete a non existent file. So check if file exists before you call it:
if ([[NSFileManager defaultManager] fileExistsAtPath:self.recorder.url.path]) {
if (![self.recorder deleteRecording])
NSLog(#"Failed to delete %#", self.recorder.url);
}
It must be a bug in AVAudioRecorder.

Application Crashing due to EXC_BAD_ACCESS

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x00004420 objc_msgSend + 24
1 CoreFoundation 0x000042a6 CFRetain + 54
2 CoreFoundation 0x0000a9f0 __CFBasicHashStandardRetainValue + 8
3 CoreFoundation 0x000054c0 __CFBasicHashAddValue + 100
4 CoreFoundation 0x00006184 CFBasicHashAddValue + 276
5 CoreFoundation 0x00006cfe CFDictionaryCreate + 58
6 CoreFoundation 0x00033d7c -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 1456
7 CoreFoundation 0x000361bc -[NSDictionary initWithObjectsAndKeys:] + 776
8 iota 0x0000c4cc 0x1000 + 46284
9 iota 0x00009282 0x1000 + 33410
10 iota 0x0000952a 0x1000 + 34090
11 Foundation 0x00015432 _nsnote_callback + 150
12 CoreFoundation 0x000271da __CFXNotificationPost_old + 390
13 CoreFoundation 0x00026e7a _CFXNotificationPostNotification + 122
14 Foundation 0x0000b9f6 -[NSNotificationCenter postNotification:] + 138
15 Foundation 0x0007ae02 postQueueNotifications + 258
16 Foundation 0x0007afae __NSPostIdleQueueNotes + 6
17 CoreFoundation 0x00031084 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 12
18 CoreFoundation 0x00030eb2 __CFRunLoopDoObservers + 494
19 CoreFoundation 0x00028206 __CFRunLoopRun + 934
20 CoreFoundation 0x00027d74 CFRunLoopRunSpecific + 220
21 CoreFoundation 0x00027c82 CFRunLoopRunInMode + 54
22 GraphicsServices 0x00004e84 GSEventRunModal + 188
23 UIKit 0x00004f8c -[UIApplication _run] + 564
24 UIKit 0x000024cc UIApplicationMain + 964
25 iota 0x0000533a 0x1000 + 17210
26 iota 0x000052fc 0x1000 + 17148
NSDictionary *contactNameDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:item, #"contact", sortName, #"contactSortName", compositeName, #"compositeName", nil];
The crashes are random. Like it happens once in 15 trials of a particular action.
KERN_PROTECTION_FAILURE - means that your program is accessing a shared memory that it didn't have access to. That's why kenel sent killed your process. I'm pretty sure that some of your pointers point to wrong location. E.g.
NSObject* obj;
obj would have garbage as it's value. You have to declare it like this:
NSObject* obj = nil;
Without more info, it's hard to say. Usually it's because you try to access/insert into your dictionary an object that doesn't exist anymore.
Check if you're not inserting something that is not an instance of NSObject, like an int or something.
Given that you are using initWithObjectsAndKeys:, make sure that you have nil-terminated the list of arguments, as that's a common mistake that can lead to crashes.