We have reviewed the documentation and the common reasons for EXC_BAD_ACCESS crashes. As highlighted in our initial report, we are encountering a EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0 crash, with the top of the stack trace indicating an issue within swift_getObjectType during the execution of our custom navigation controller delegate method.
protocol PushPopAnimatable: AnyObject {
var animationTargetView: UIView? { get }
/// Set targetview's frame that is relative to viewController's view
/// e.g. targetView.superview?.convert(targetView.frame, to: viewController.view)
var animationTargetFrame: CGRect? { get }
}
typealias PushPopAnimatableViewController
= PushPopAnimatable & UIViewController
func navigationController(
_ navigationController: UINavigationController,
animationControllerFor operation: UINavigationController.Operation,
from fromVC: UIViewController, to toVC: UIViewController)
-> UIViewControllerAnimatedTransitioning? {
switch operation {
case .push:
if fromVC is PushPopAnimatableViewController, // Crash occurs here
toVC is ItemDetailViewController {
return PushAnimator() as UIViewControllerAnimatedTransitioning
}
// ... other cases
}
return nil
}
The crash consistently occurs on the line checking if fromVC conforms to our PushPopAnimatableViewController type alias (which is a combination of UIViewController and the PushPopAnimatable protocol).
As the stack trace suggests, the crash happens when the system attempts to determine the type of fromVC using swift_getObjectType. This strongly indicates that at the moment this delegate method is called, the fromVC object is in an invalid state (likely deallocated or a dangling pointer).
Based on our analysis and the fact that this crash is predominantly, if not exclusively, occurring on iOS 18 (we have no similar reports from iOS 16 or 17 in Firebase Crashlytics), we suspect a potential change in the way UINavigationController manages view controller lifecycles or calls its delegate methods in iOS 18 might be exposing this issue.
We have already:
Examined our custom animation code (PushAnimator, PopAnimator) for potential memory management issues and retain cycles involving the fromVC.
Reviewed the lifecycle of the fromVC (which is the parent view controller in the navigation stack) to understand why it might be in an invalid state during the transition.
We are still unable to reliably reproduce this crash locally on our development devices.
Attached to this reply is a fully symbolicated Apple crash report for your review. We hope this will provide further context and insight into the specific conditions leading to this crash on iOS 18.
Apple crash report:
2025-04-03_08-10-20.5612_+0900-208251d9dd3f8b2d646cbd55f020623d925a68ba.crash
Firebase crash report:
_bbb831b817ec53048634badaa66d021d_crash_session_bd8c313d72bf4abfa323d1442cd938e7_DNE_0_v2_stacktrace.txt
_issue_bbb831b817ec53048634badaa66d021d_crash_session_a909652d094d4cada8cac20836decab0_DNE_0_v2_stacktrace.txt
We would appreciate any specific guidance you can offer regarding potential changes in UINavigationController behavior in iOS 18 that might be relevant to this scenario, or any further debugging steps you recommend given our findings.
Thank you for your assistance.