How to debug XPC_ERROR_CONNECTION_INVALID

Hello,
Our application is logging sometimes the following message:

2020-11-18 09:47:12.937916+0200 OESIS-V4-SampleApp[1330:45664] [Metadata] ==== XPC handleXPCMessage XPCERRORCONNECTION_INVALID

This is all the information that I have, if I use breakpoints to narrow down the possibilities, the error is not showing anymore.

Any debugging advice/starting point would be great.

Our application is offline, so we are not using XPC services. And is written in C++ but has dependecy to some macOS Frameworks.

Thanks in advance!


we are not using XPC services.

OK. And is this error correlated to some failure within your program? If not, I recommend that you treat it as log noise.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
No, our program is not failing. It is working as expected.
Understood, thanks for the recommendation. We will most likely go with this approach, but is there any way to find the source of this message? I am thinking it is coming from a 3rd party library or maybe a macOS Framework. Thanks again!

is there any way to find the source of this message?

The [Metadata] in the log entry shows the logging category. This suggests its being logged by the Metadata framework (a subframework of CoreServices). I took a look at the source for that and it seems to be MDQuery logging this because it can’t talk to its XPC service. If you really want to track down the origin of this you could set a symbolic breakpoint on os_log_error and look at the backtrace. I don’t think it’s going to be particularly helpful though. There’s a reason why I wrote the On Log Noise post.

Oh, os_log_error is actually a macro, so your breakpoint needs to be on _os_log_error_impl.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Thank you for all the information, Eskimo!
How to debug XPC_ERROR_CONNECTION_INVALID
 
 
Q