I recently migrated to macOS Monterey to build my macOS app. After building the app in 12.3, the users have started to experience mysterious crashes related to view layout.
The first one was somehow related to NSScrollView
endlessly resizing itself between two width values, and I figured it could have something to do with scroll bar sizing, but found no apparent fix.
Crashing on exception: The window has been marked as needing another Display Window pass, but it has already had more Display Window passes than there are views in the window.
I circumvented the issue with some duct tape, but ended up with another layout exception on other users' systems:
Crashing on exception: The window has been marked as needing another Update Constraints in Window pass, but it has already had more Update Constraints in Window passes than there are views in the window.
It's very hard to debug this, because the bug seems to be very system-specific.
However, by intense googling, I've seen that Safari and Xcode have also suffered from the exact same crash, but I've found no information on how they might have been fixed.
I'm starting to suspect that there is something principal that has been changed within view layout routines macOS 11/12 that I'm completely missing. Does anyone have any experience with such issues, and how to start digging deeper?