Crash when switch to AirPlay - iphone

I'm working on app that streaming audio. I've MPVolumeView with AirPlay button. But sometimes app crashes when switch to airplay.
0 libobjc.A.dylib 0x394455d0 objc_msgSend + 16
1 Foundation 0x39f05040 +[NSObject(NSDelayedPerforming) cancelPreviousPerformRequestsWithTarget:selector:object:] + 336
2 MediaPlayer 0x381d43b0 -[MPAudioDeviceController _scheduleSendDelegateAudioRoutesChanged] + 52
3 CoreFoundation 0x3ac90346 _CFXNotificationPost + 1418
4 Foundation 0x39f0538a -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
5 Celestial 0x35d3c0a4 -[AVObjectRegistry safePostNotificationFromMainThreadTarget:name:userInfo:] + 92
6 Celestial 0x35d41970 figConnection_ActiveAudioRouteDidChange_Callback + 112
7 CoreFoundation 0x3ad0c0a2 __CFNotificationCenterAddObserver_block_invoke_0 + 122
8 CoreFoundation 0x3ac90346 _CFXNotificationPost + 1418
9 CoreFoundation 0x3ac91918 CFNotificationCenterPostNotification + 100
10 CoreMedia 0x3a111c96 CMNotificationCenterPostNotification + 114
11 MediaToolbox 0x33ccae16 playerasync_reflectSubPlayerNotification + 118
12 CoreFoundation 0x3ad0c0a2 __CFNotificationCenterAddObserver_block_invoke_0 + 122
13 CoreFoundation 0x3ac90346 _CFXNotificationPost + 1418
14 CoreFoundation 0x3ac91918 CFNotificationCenterPostNotification + 100
15 CoreMedia 0x3a111c96 CMNotificationCenterPostNotification + 114
16 MediaToolbox 0x33ccad92 playerremote_postNotification + 554
17 MediaToolbox 0x33cccd28 playerremote_postNotificationWithPayload + 84
18 MediaToolbox 0x33cca2ce FigPlayerRemoteCallbacksServer_SendNotifyPing + 370
19 MediaToolbox 0x33cca14e _XSendNotifyPing + 66
20 MediaToolbox 0x33cc74de figmoviecallbacks_server + 90
21 MediaToolbox 0x33cc7468 fpr_ClientPortCallBack + 176
22 CoreFoundation 0x3ad09888 __CFMachPortPerform + 116
23 CoreFoundation 0x3ad143e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
24 CoreFoundation 0x3ad14386 __CFRunLoopDoSource1 + 134
25 CoreFoundation 0x3ad1320a __CFRunLoopRun + 1378
26 CoreFoundation 0x3ac86238 CFRunLoopRunSpecific + 352
27 CoreFoundation 0x3ac860c4 CFRunLoopRunInMode + 100
28 GraphicsServices 0x36f8c336 GSEventRunModal + 70
29 UIKit 0x34a9328c UIApplicationMain + 1116
30 RogApp 0x0006a0ba main (main.m:17)
31 RogApp 0x0006a034 start + 36
I've enabled zombie objects and after crash I see message like this:
[MPAudioDeviceController performSelector:withObject:afterDelay:inModes:] message sent to deallocated instance
This is private class. How can I fix this bug?

FWIW, I am getting essentially the same crash reports from the field with an app. I did not know what it was related to, but now I can at least explore switching to AirPlay to drive it.

Related

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

good methods to debug iOS exception

i want to debug my exception at my app,i have read
Debugging -[NSCFDictionary setObject:forKey:]: attempt to insert nil value add so on,but these methods is happen at i am running my app,so i can use add an Exception breakpoint, click the Add (+) button at the bottom of the breakpoints list and click Add Exception Breakpoint ,and use gcc command line怂but my question is if user give me a crash report,the bug not easy happen,how to solve it ,for example:
Application received signal SIGSEGV
(null)
(
0 CoreFoundation 0x3120e2bb + 186
1 libobjc.A.dylib 0x38f2b97f objc_exception_throw + 30
2 CoreFoundation 0x3120e1c5 + 0
3 myshine 0x001f9f51 myshine + 1503057
4 libsystem_c.dylib 0x393a9e8b _sigtramp + 34
5 myshine 0x000ac985 myshine + 137605
6 myshine 0x000ac35d myshine + 136029
7 CoreFoundation 0x311ab7cf + 74
8 CoreFoundation 0x311b1623 + 74
9 CoreFoundation 0x311ab507 + 326
10 CFNetwork 0x30f0fa8b + 98
11 CFNetwork 0x30f0ec71 + 36
12 CFNetwork 0x30f11365 + 44
13 CFNetwork 0x30f110f9 + 88
14 CFNetwork 0x30f114ff + 34
15 CFNetwork 0x30ed0ce1 + 324
16 CFNetwork 0x30ed1661 + 156
17 CFNetwork 0x30f0ec71 + 36
18 CFNetwork 0x30f11365 + 44
19 CoreFoundation 0x311e3683 + 14
20 CoreFoundation 0x311e2ee9 + 212
21 CoreFoundation 0x311e1cb7 + 646
22 CoreFoundation 0x31154ebd CFRunLoopRunSpecific + 356
23 CoreFoundation 0x311b39bb CFRunLoopRun + 98
24 myshine 0x000b20ef myshine + 159983
25 Foundation 0x31b24e85 + 972
26 libsystem_c.dylib 0x39382311 + 308
27 libsystem_c.dylib 0x393821d8 thread_start + 8
)
and
*** -[__NSArrayM objectAtIndex:]: index 121 beyond bounds [0 .. 23]
(
0 CoreFoundation 0x311963ff + 186
1 libobjc.A.dylib 0x38e87963 objc_exception_throw + 30
2 CoreFoundation 0x310e1ef9 + 164
3 myshine 0x001720b1 myshine + 1372337
4 UIKit 0x33090087 + 70
5 UIKit 0x3309003b + 30
6 UIKit 0x33090015 + 44
7 UIKit 0x3308f8cb + 502
8 UIKit 0x3308fdb9 + 488
9 UIKit 0x32fb85f9 + 524
10 UIKit 0x32fa58e1 + 380
11 UIKit 0x32fa51ef + 6198
12 GraphicsServices 0x34cbc5f7 + 590
13 GraphicsServices 0x34cbc227 + 34
14 CoreFoundation 0x3116b3e7 + 34
15 CoreFoundation 0x3116b38b + 138
16 CoreFoundation 0x3116a20f + 1382
17 CoreFoundation 0x310dd23d CFRunLoopRunSpecific + 356
18 CoreFoundation 0x310dd0c9 CFRunLoopRunInMode + 104
19 GraphicsServices 0x34cbb33b GSEventRunModal + 74
20 UIKit 0x32ff92b9 UIApplicationMain + 1120
21 myshine 0x00026ec7 myshine + 16071
22 myshine 0x00025660 myshine + 9824
)
through i know NSArray beyond bounds,but my app have many many NSArray,and they are user report,can you give me some easy methods to find the location?
From your question what I understood is you want the method which has produced the crash in your app. May be this can help you Symbolicating iPhone App Crash Reports.

Crash Quartz Core (creittercism)

I see this crash log in my crittercism dashboard
QuartzCore 0x373d37c4 _ZN2CA5Layer16commit_if_neededEPNS_11TransactionEPFvPS0_jjPvES4_ + 39
1 QuartzCore 0x373d3875 _ZN2CA5Layer16commit_if_neededEPNS_11TransactionEPFvPS0_jjPvES4_ + 216
2 QuartzCore 0x373d773b _ZN2CA7Context11commit_rootEPNS_5LayerEPv + 34
3 QuartzCore 0x373d7717 _ZN2CAL16foreach_callbackEPNS_5LayerES1_Pv + 18
4 QuartzCore 0x373d76ed x_hash_table_foreach + 44
5 QuartzCore 0x373d76bd _ZN2CA11Transaction12foreach_rootEPFvPNS_5LayerEPvES3_ + 32
6 QuartzCore 0x373d1455 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 1052
7 QuartzCore 0x373d0e57 _ZN2CA11Transaction6commitEv + 314
8 QuartzCore 0x373c8d85 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 56
9 CoreFoundation 0x37da8b4b __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
10 CoreFoundation 0x37da6d87 __CFRunLoopDoObservers + 258
11 CoreFoundation 0x37da70e1 __CFRunLoopRun + 760
12 CoreFoundation 0x37d2a4dd CFRunLoopRunSpecific + 300
13 CoreFoundation 0x37d2a3a5 CFRunLoopRunInMode + 104
14 GraphicsServices 0x37b01fcd GSEventRunModal + 156
15 UIKit 0x318aa743 UIApplicationMain + 1090
And don't have idea what is causing this error, anybody with the same problem (that found the solution lol)?

iphone - understanding crash logs

Im developing my app and yesterday while I was playing with it crashed. I wasnt debugging, so I thought I'd take a look at the crash log today.
But my surprise is that I can't see anything that can give me some info, here it is:
Thread 0 Crashed:
0 libobjc.A.dylib 0x33479464 objc_msgSend + 16
1 MapKit 0x31bffe28 -[MKMapView annotationContainer:viewForAnnotation:] + 36
2 MapKit 0x31bffaba -[MKAnnotationContainerView _addViewForAnnotation:] + 270
3 MapKit 0x31c25540 -[MKAnnotationContainerView addViewForManagedAnnotation:] + 8
4 MapKit 0x31c21df2 -[MKMapView(UserPositioningInternal) _runPositioningChange] + 1034
5 MapKit 0x31c20036 -[MKMapView(UserPositioningInternal) _startPositioningChange:] + 22
6 MapKit 0x31c23446 -[MKMapView(UserPositioningInternal) locationManagerUpdatedLocation:] + 578
7 CoreFoundation 0x33a5ebb8 -[NSObject(NSObject) performSelector:withObject:] + 16
8 CoreFoundation 0x33a83266 -[NSArray makeObjectsPerformSelector:withObject:] + 394
9 MapKit 0x31c1232a -[MKLocationManager _reportLocationStatus:] + 34
10 MapKit 0x31c13844 -[MKLocationManager _reportLocationSuccess] + 36
11 MapKit 0x31c134b8 -[MKLocationManager locationManager:didUpdateToLocation:fromLocation:] + 688
12 CoreLocation 0x34371410 -[CLLocationManager onClientEventLocation:] + 528
13 CoreLocation 0x3436f68e -[CLLocationManager onClientEvent:supportInfo:] + 98
14 CoreLocation 0x3436f7e6 OnClientEventInternal + 14
15 CoreLocation 0x3436b534 CLClientInvokeCallback(__CLClient*, CLClientEvent, __CFDictionary const*) + 60
16 CoreLocation 0x3436d3cc CLClientHandleDaemonDataLocation(__CLClient*, CLClientLocation const*, __CFDictionary const*) + 196
17 CoreLocation 0x3436d512 CLClientHandleDaemonData(__CFMessagePort*, long, __CFData const*, void*) + 286
18 CoreFoundation 0x33a813fe __CFMessagePortPerform + 242
19 CoreFoundation 0x33a556f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
20 CoreFoundation 0x33a556bc __CFRunLoopDoSource1 + 160
21 CoreFoundation 0x33a47f76 __CFRunLoopRun + 514
22 CoreFoundation 0x33a47c80 CFRunLoopRunSpecific + 224
23 CoreFoundation 0x33a47b88 CFRunLoopRunInMode + 52
24 GraphicsServices 0x33b0e4a4 GSEventRunModal + 108
25 GraphicsServices 0x33b0e550 GSEventRun + 56
26 UIKit 0x32099322 -[UIApplication _run] + 406
27 UIKit 0x32096e8c UIApplicationMain + 664
28 Palyque 0x0000280a main (main.m:14)
29 Palyque 0x00002794 start + 44
Hope you can help me with this, thanks.
Without the app still in memory I'm not sure there's much you can do. From experience I guess you messaged an object that has been dealloc'd. (Maybe the datasource object for your MKMapView?) I'd try running your app with zombies enabled to track it down.

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.