iOS 18.1 SwiftUI popover crash

When trying to debug a mysterious app crash pointing to some layoutIfNeeded() method call, me and my QA team member reduced it to this sample app.

struct ContentView: View {
@State var isPresented = false
var body: some View {
VStack {
Button {
isPresented = true
} label: {
Text("show popover")
}
.popover(isPresented: $isPresented) {
Text("hello world")
}
}
.padding()
}
}`

This code crashes on his iPad iOS 18.1.0 22B5034E with EXC_BAD_ACCESS error. It is not reproducible on simulator or on device with iOS 18.2 or iOS 17.

Is this a known issue? Are there any known workarounds? I've found similar posts here

https://developer.apple.com/forums/thread/769757 https://developer.apple.com/forums/thread/768544

But they are about more specific cases.

Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. I'd greatly appreciate it if you could open a bug report, include the code snippet that reproduces the issue and the build information. Post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report.

I've created a report in Feedback Assistant: FB17003318 (iOS 18.1 SwiftUI popover crash)

iOS 18.1 SwiftUI popover crash
 
 
Q