CGSWindowShmemCreateWithPort log message

After ther Mac application is launched: Log error: CGSWindowShmemCreateWithPort failed on port 0 and when the application quit: No error handler for XPC error: Connection invalid

Appear with Xcode 15.4 but not with 12.4 As repported by Steve4442 in "Can someone explain this message" https://Forums.Developer.Apple.com/Forums/Thread/727803 <Does not seem to affect anything though and things work just fine>. The code don't use "windowNumbersWithOptions"

Can I ignore this log message ?

Answered by DTS Engineer in 825290022

In that thread you referenced (this is the correct link btw), one of my colleagues referenced On Log Noise, which is my standard advice on this topic.

Written by Alain_B in 774550021
Can I ignore this log message ?

That depends on whether you’re doing something to trigger it. The other thread has a handy tip for how to track down the original of this message.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

In that thread you referenced (this is the correct link btw), one of my colleagues referenced On Log Noise, which is my standard advice on this topic.

Written by Alain_B in 774550021
Can I ignore this log message ?

That depends on whether you’re doing something to trigger it. The other thread has a handy tip for how to track down the original of this message.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

How to use:

  b libsystem_trace.dylib``_os_log_error_impl

?

I put the details into that other thread, because I wanted it to be easy for other folks to find.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thank you for the link. With

os_log_error(OS_LOG_DEFAULT, "");

I was able to see that disable "Visible At Launch" in MainMenu.nib cause the "CGSWindowShmemCreateWithPort failed on port 0" log error.

What can I do to make the window not visible at launch (other than close the window in awakeFromNib)?

How to fix the second issue: "No error handler for XPC error: Connection invalid" The code don't use any communications (etnernet, wifi or bluetooth) call.

Written by Alain_B in 825523022
The code don't use any communications

XPC is an inter-process communication (IPC) mechanism. Apple’s system framework make extensive use of IPC. In this case the Core Graphics framework is using XPC to communicate with the window server.

Written by Alain_B in 825523022
What can I do to make the window not visible at launch … ?

This is an AppKit question, and I’m hardly an expert on that, but I wanna confirm my understanding of this before I send you in that direction.

I believe you’re saying:

  1. If you disable Visible At Launch, you get this log message.

  2. This log message is bad.

  3. Thus you need a different way to make your window not visible at launch.

Is that right?

If so, your logic is flawed at step 2. Unless there is some other issue in play, you should consider this log message to be noise and simply ignore it.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  1. If you disable Visible At Launch, you get this log message.

Yes

  1. This log message is bad.

Surely

  1. Thus you need a different way to make your window not visible at launch.

Yes

Written by Alain_B in 825672022
Surely

Why do you say that? Do you see any problems other than the log message itself?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

No one except the:

  "No error handler for XPC error: Connection invalid"

that happen when the application quit.

Thank a lot for all precious reply.

Accepted Answer

Again, more logging. Logging like this is not necessarily indicative of a problem. The point I’m making in On Log Noise is that you shouldn’t worry about log entries just because they look bad; rather, focus on ones that look bad and are correlated with an actual failure.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

CGSWindowShmemCreateWithPort log message
 
 
Q