Post

Replies

Boosts

Views

Activity

Reply to EXC_BREAKPOINT @main
Hey there, I'm the TA/mentor for the team who encountered this issue. I met with them to debug this afternoon, and I cautiously believe we may have made some progress. tl;dr: I believe there may be a bug when removing a NavigationView from the view hierarchy while it's presenting a child view. Their crash occurred when a user pressed their "sign in" button with valid credentials. After the backend validates the credentials, they update an @Published property containing their authentication state, which they essentially switch over in their ContentView. Here's a simplified version of their ContentView: struct ContentView: View { @ObservedObject var manager = AuthenticationManager.shared var body: some View { if manager.state == .loggedIn { MainView() } else if manager.state == .loading { ProgressView() } else { AuthView() } } } After the credentials are validated, they transition their auth state to .loading while fetching their user information. This is the point where the app crashed. So, it seemed like the crash might have been occurring during the deallocation of AuthView(), which has a NavigationView as its root view (which aligns with the [UINavigationController dealloc] calls in the backtrace). I noticed references to UISplitViewController in the backtrace and, since they only ever need NavigationViewStyle.stack, I decided to try replacing NavigationView with NavigationStack. After that change, we haven't been able to reproduce the crash. I found a minimum sample project that reproduces this crash, so I believe this might be a bug in SwiftUI/UIKit. I'll file a feedback with that code shortly.
Apr ’24