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.

Hello,


I am maintaining a legacy application and we have an issue when migrating from 10.13 SDK to 10.14 SDK.

The failing code is trying to open a NSWindow modally. This NSWindow contains a NSOpenGLView. Hidden part of the call stack is just internal C++ code, nothing related to Cocoa. As you can see at the top of the stack, a NSException gets thrown and contains this message: "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."


Callstack: https://cl.ly/8399f31a5ee8


Only changing back to 10.13 SDK makes this issue go away. After reading 10.14 SDK release notes, I've the impression that this comes from the changes in Cocoa layer backing. This is described starting from slide 109 of https://developer.apple.com/videos/play/wwdc2018/209/

Unfortunately, slide 123 says that:

Implementation details for NSOpenGL are different

OpenGL is deprecated
Use MTKView


So I don't have any clue about what is the recommended behavior in my case. I'm not in a drawRect call and I disabled all the parts of the code that I think could trigger -[NSView/NSWindow display] calls but I still get the exception, so I don't really know what to do. Right now removing the NSOpenGLView is not an option, and doing so doesn't guarantee that the exception would go away.


In the time being I use 10.13 SDK with Xcode 10 but if you know how it could be fixed and to allow me to use 10.14 SDK, I'm interested!


Best regards,

Lucas

  • Same. I have tried everything. This is a huge headache for me. Changing to Chrome.

Add a Comment

Replies

Just a shot in the dark, but: check your window and/or view classes for properties which might accidentally override/hide properties of their superclasses, perhaps properties that have been relatively newly added.

Hello,


I tried what you said (I added a prefix to all members of all classes that inherit from NSWindow / NSOpenGLView) but it did not fix the issue. Thanks for trying though 🙂

I updated my build to IOS 14 and Mac OS 20.15.6 and the error went away.

I'm seeing this with Safari now on 11.6.

There was an empty tab spot on the left hand side of the browser, so I tried to move the rightmost tab over to the left.

Then Safari crashed. Now it won't restart without crashing.

I'm having the same issue. I can't open Safari at all without it crashing.

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               Safari [1735]
Path:                  /Applications/Safari.app/Contents/MacOS/Safari
Identifier:            com.apple.Safari
Version:               15.3 (17612.4.9.1.8)
Build Info:            Safari-7612004009001008~1
Code Type:             X86-64 (Native)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2022-03-01 12:28:29.3141 -0700
OS Version:            macOS 12.2.1 (21D62)
Report Version:        12
Bridge OS Version:     6.2 (19P744)
Anonymous UUID:        E219FD26-CDAA-C331-1985-21F876626C23


Time Awake Since Boot: 2500 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 4 Illegal instruction: 4
Terminating Process:   exc handler [1735]

Application Specific Information:
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.
<NSWindow: 0x7f7c07f50780> 0xd3 (211) {{100, 100}, {100, 128}}  en