I'm new to this project and Firebase has been added only recently, so I've some issue to figure out the reason of a crash (that I can't reproduce locally).
It's a EXC_BAD_ACCESS KERN_INVALID_ADDRESS on dispatch_call_block_and_release.
Therefore it should be a memory issue, trying to access to an object that has been already deallocated.
The last traced line is an addObserver call of Notification Center, and then the call trace continue with several calls but not showing an exact line of code. Since I don't see anything wrong with that observer, I'm wondering: is this line significant? Or it could be that the app is crashing on a different thread so that the call trace is irrelevant?
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000008
Crashed: com.apple.main-thread
0 MyPod 0x103dafb18 (Missing)
1 MyPod 0x103daf564 (Missing)
2 MyPod 0x103daf9fc (Missing)
3 MyApp 0x103b12ffc (Missing)
4 MyPod 0x103daf268 (Missing)
5 MyPod 0x103dae844 (Missing)
6 MyPod 0x103daef64 (Missing)
7 MyPodClient 0x103d40fd0 (Missing)
8 MyPodClient 0x103d3dcb8 (Missing)
9 libdispatch.dylib 0x1a9e38610 _dispatch_call_block_and_release + 24
10 libdispatch.dylib 0x1a9e39184 _dispatch_client_callout + 16
11 libdispatch.dylib 0x1a9deb190 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1044
12 CoreFoundation 0x1aa0ea5e4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
13 CoreFoundation 0x1aa0e55d8 __CFRunLoopRun + 2004
14 CoreFoundation 0x1aa0e4adc CFRunLoopRunSpecific + 464
15 GraphicsServices 0x1b406a328 GSEventRunModal + 104
16 UIKitCore 0x1ae1dfae0 UIApplicationMain + 1936
17 MyApp 0x102e0bce0 main + 21 (PlayerPlugin.swift:21) //-> This is the line in which a func is called, and inside this func observers are added.
thanks
ps. I don't know if this helps, but for some crash reports (but not all of them), I get in the KEYS section this line:
crash_info_entry_0
CoreUI: deallocating _CUIInternalLinkRendition 7113 /private/var/containers/Bundle/Application/A6721767-C6DD-43AB-B2E0-094D4CBD12D6/MyApp.app/Assets.car
Is this related to assets? However it looks more like a consequence of the crash, rather than a cause.
Related
I use AudioEngine.
In crash reports I see some random EXC_BREAKPOINT crashes with this stacktrace
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001896df0e4
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [12467]
Triggered by Thread: 15
Thread 15 Crashed:
0 libdispatch.dylib 0x00000001896df0e4 __DISPATCH_WAIT_FOR_QUEUE__ + 448 (queue.c:1619)
1 libdispatch.dylib 0x00000001896dec74 _dispatch_sync_f_slow + 140 (queue.c:1732)
2 libdispatch.dylib 0x00000001896dec74 _dispatch_sync_f_slow + 140 (queue.c:1732)
3 AVFAudio 0x00000001965b11a8 -[AVAudioEngine dealloc] + 308 (AVAudioEngine.mm:406)
4 Foundation 0x0000000189ce52ac -[NSConcreteNotification dealloc] + 68 (NSNotification.m:206)
5 AVFAudio 0x00000001965b7158 invocation function for block in AVAudioEngineImpl::IOUnitConfigurationChanged() + 292 (AVAudioEngine.mm:1215)
6 libdispatch.dylib 0x00000001896de998 _dispatch_block_async_invoke2 + 104 (queue.c:525)
7 libdispatch.dylib 0x00000001896fb184 _dispatch_client_callout + 16 (object.m:495)
8 libdispatch.dylib 0x00000001896d4e8c _dispatch_continuation_pop$VARIANT$armv81 + 404 (inline_internal.h:2484)
9 libdispatch.dylib 0x00000001896e502c _dispatch_source_invoke$VARIANT$armv81 + 1232 (source.c:568)
10 libdispatch.dylib 0x00000001896d85e0 _dispatch_lane_serial_drain$VARIANT$armv81 + 260 (inline_internal.h:2525)
11 libdispatch.dylib 0x00000001896d9128 _dispatch_lane_invoke$VARIANT$armv81 + 400 (queue.c:3863)
12 libdispatch.dylib 0x00000001896e243c _dispatch_workloop_worker_thread + 576 (queue.c:6445)
13 libsystem_pthread.dylib 0x000000018974ab88 _pthread_wqthread + 276 (pthread.c:2351)
14 libsystem_pthread.dylib 0x000000018974d760 start_wqthread + 8
I can't reproduce this crash and stacktrace doesn't point to my code. Does anyone know what is cause of this crash, how this can be fixed and if it's even possible to fix?
Thanks
According to the apple documentation of AVAudioEngineConfigurationChange,
You must not release the engine during handling this notification.
Note The engine must not be deallocated from within the client's
notification handler. Callback happens on an internal dispatch queue
and can deadlock while trying to teardown the engine synchronously.
Though you didn't release at that time, It can be caused.
AVAudioEngine in iOS 11 or 12 can be stucked to notify before, then you release engine later.
There's workaround. You have to re-use the audio engine rather than re-create.
I'm working on an iOS app that uses Realm which is installed/managed via Cocoapods. My app crashes sporadically and I'm having difficulty troubleshooting the problem because my stack trace doesn't show me the method names related to Realm. I am deploying a debug build of my app to the phone via Xcode and I have the Debug Information Format option set to DWARF with dSYM File. In the stack trace below you can see that my code appears to be symbolicated but the method names in Realm are just addresses and offsets. Unfortunately, I'm somewhat new to troubleshooting with Xcode but I'm under the assumption that this means the Realm debug symbols could not be found? If anyone can explain to me how to correct this, I'd really appreciate it!
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Application Specific Information:
abort() called
Filtered syslog:
None found
Last Exception Backtrace:
0 CoreFoundation 0x18316ad8c __exceptionPreprocess + 228
1 libobjc.A.dylib 0x1823245ec objc_exception_throw + 55
2 Realm 0x10814e238 0x108030000 + 1172024
3 Realm 0x10814ffa0 0x108030000 + 1179552
4 Realm 0x10814ff74 0x108030000 + 1179508
5 MyAppName 0x104af31a4 closure #1 in closure #2 in processOutgoingMessage(outgoingMessage:) + 4452772 (ProcessOutgoingMessage.swift:51)
6 MyAppName 0x1046cd168 _T0Ieg_IeyB_TR + 102760 (DataSource.swift:0)
7 libdispatch.dylib 0x182a5caa0 _dispatch_call_block_and_release + 23
8 libdispatch.dylib 0x182a5ca60 _dispatch_client_callout + 15
9 libdispatch.dylib 0x182a9dd80 _dispatch_main_queue_callback_4CF$VARIANT$armv81 + 963
10 CoreFoundation 0x183113070 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 11
11 CoreFoundation 0x183110bc8 __CFRunLoopRun + 2271
12 CoreFoundation 0x183030da8 CFRunLoopRunSpecific + 551
13 GraphicsServices 0x185015020 GSEventRunModal + 99
14 UIKit 0x18d04d758 UIApplicationMain + 235
15 MyAppName 0x104a7919c main + 3953052 (AppDelegate.swift:18)
16 libdyld.dylib 0x182ac1fc0 start + 3
UPDATE - as it turns out, the Build Settings for the Pods project (recall that I'm using Realm via Cocoapods) needed to also have the Debug Information Format set to DWARF with dSYM File for debug builds. My app hasn't crashed again yet but I did notice that when I cleaned and rebuilt the app this time it appeared to be including the debug symbols for Realm so here's hoping.
I am observing AVPlayer object KVO notification in my class PCSPlayerNotification and I found the below crash.I am unable to reproduce this issue and I get this issue rarely.
I read this http://www.cocoabuilder.com/archive/cocoa/204196-cannot-remove-observer-error.html and I found the cause of the issue must be with KVO notification that is sent by AVPlayer.But not sure how to fix ,can anyone help me to fix this issue.
Issue :
Fatal Exception: NSInternalInconsistencyException
Cannot update for observer <PCSPlayerNotification 0x7f78b70> for the key path "player.currentItem.playbackLikelyToKeepUp" from <PCSPlayerNotification 0x7f78b70>, most likely because the value for the key "player" has changed without an appropriate KVO notification being sent. Check the KVO-compliance of the PCSPlayerNotification class.
Crash :
Thread : Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x2b2315a7 __exceptionPreprocess
1 libobjc.A.dylib 0x39156c77 objc_exception_throw
2 CoreFoundation 0x2b2314ed -[NSException initWithCoder:]
3 Foundation 0x2bed464d -[NSKeyValueNestedProperty object:withObservance:didChangeValueForKeyOrKeys:recurse:forwardingValues:]
4 Foundation 0x2beb4151 NSKeyValueDidChange
5 Foundation 0x2bea0991 -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:]
6 VZFiOSMobile 0x4f33f1 (Missing)
7 libdispatch.dylib 0x396c1c83 _dispatch_call_block_and_release
8 libdispatch.dylib 0x396c1c6f _dispatch_client_callout
9 libdispatch.dylib 0x396cd553 _dispatch_main_queue_callback_4CF$VARIANT$mp
10 CoreFoundation 0x2b1f7891 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
11 CoreFoundation 0x2b1f5fb1 __CFRunLoopRun
12 CoreFoundation 0x2b142b51 CFRunLoopRunSpecific
13 CoreFoundation 0x2b142963 CFRunLoopRunInMode
14 GraphicsServices 0x326501a9 GSEventRunModal
15 UIKit 0x2e794c91 UIApplicationMain
16 VZFiOSMobile 0x272c1d main (main.m:16)
17 libdyld.dylib 0x396ffaaf start
i have such a report from Crashlytics:
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x000000019503fbd0 objc_msgSend + 16
1 CoreFoundation 0x00000001836e5458 CFRelease + 524
2 CoreFoundation 0x00000001836f1a18 -[__NSArrayM dealloc] + 152
3 libobjc.A.dylib 0x0000000195045724 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 564
4 CoreFoundation 0x00000001836e9074 _CFAutoreleasePoolPop + 28
5 Foundation 0x000000018461a588 -[NSAutoreleasePool release] + 148
6 UIKit 0x00000001882b4460 -[UIApplication _run] + 588
7 UIKit 0x00000001882aefac UIApplicationMain + 1488
Is there anything I can do to catch such an issue? It happens on customer devices so I have no chance to reproduce it.
For crashes like this one, if the crash is reproducible, turn on NSZombies in your project's environment variables. This will keep deallocated objects alive (zombies) and when one of them is messaged, the caller and message will be captured on the crashing object.
Turn it off when done as it can block the memory of the app due to the objects not being released for zombie tracking.
Some of logic code need to be run in background. You need to try debug where is code is error and then add this code
DispatchQueue.main.async(execute: {
// your code
})
It's been answered here: objc_msgSend [__NSArrayM dealloc] crash report sometimes from Crashlytics
Basically, upgrade your Crashlytics framework to past 3.0.9. The crash was in the crash reporting framework itself.
My iOS app keeps crashing. I found the way I could make it crash consistently. I repeated the operation multiple times and I get the same crash log every single time.
The crash happens if I do the following: launch the app, use it a bit (optional), go to the main screen, open a modal ViewController, dismiss it, keep using the app (optional), close the app (press home button, not kill the app), wait a bit (optional), re-open the app. When the app is re-opened, it crashes after 1 second. Note that where you are in the app when you leave it does not cause/prevent the crash. No matter where you are on the app, it crashes the same way. If I use the app and don't open the modal VC, I can send it in background and re-open it with no problem.
Here is some of the crash log I get every time (I took out what I thought was not related, I can provide the full log):
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x317d332c __pthread_kill + 8
1 libsystem_c.dylib 0x33ed0208 pthread_kill + 48
2 libsystem_c.dylib 0x33ec9298 abort + 88
3 libc++abi.dylib 0x36d56f64 abort_message + 40
4 libc++abi.dylib 0x36d54346 _ZL17default_terminatev + 18
5 libobjc.A.dylib 0x35321350 _objc_terminate + 140
6 libc++abi.dylib 0x36d543be _ZL19safe_handler_callerPFvvE + 70
7 libc++abi.dylib 0x36d5444a std::terminate() + 14
8 libc++abi.dylib 0x36d5581e __cxa_rethrow + 82
9 libobjc.A.dylib 0x353212a2 objc_exception_rethrow + 6
10 CoreFoundation 0x37572506 CFRunLoopRunSpecific + 398
11 CoreFoundation 0x37572366 CFRunLoopRunInMode + 98
12 GraphicsServices 0x33d31432 GSEventRunModal + 130
13 UIKit 0x3131ecce UIApplicationMain + 1074
14 ***my app name** 0x0006f140 0x6b000 + 16704
15 ***my app name** 0x0006d5f0 0x6b000 + 9712
It's hard to provide some code, and I don't even know what I could possibly give..
I'd love some help, I have no idea why this is happening..
Feels to me like some cleanup is happening whilst you're in the background. If it's not iOS 6 then check what you;re doing to handle viewDidUnload and in any version, check what you're doing in viewWillDisappear/viewDidDisappear and viewWillAppear/viewDidAppear.