dnssd_clientstub error messages

Hi!

I use DNSServiceQueryRecord on macOS and iOS for querying the current name server for specific records.


guard DNSServiceCreateConnection(result.serviceRef) == kDNSServiceErr_NoError,
    DNSServiceQueryRecord(result.serviceRef,
                          DNSServiceFlags(kDNSServiceFlagsValidate | kDNSServiceFlagsTimeout),
                          DNSServiceInterface(kDNSServiceInterfaceIndexAny),
                          self.tlsaLookupName,
                          DNSServiceType(DnssdTLSAResolver.kDNSServiceType_TLSA),
                          DNSServiceClass(kDNSServiceClass_IN),
                          self.callback, &result) == kDNSServiceErr_NoError,
    DNSServiceSetDispatchQueue(result.serviceRef.pointee, self.dnssdResolveQueue) == kDNSServiceErr_NoError,
    DNSServiceProcessResult(result.serviceRef.pointee) == kDNSServiceErr_NoError
    else { return }


And I can see the following strange error messages on the log from time to time:

dnssd_clientstub DNSServiceProcessResult daemon version 3 does not match client version 1


And the other message is:

dnssd_clientstub DNSServiceProcessResult called with DNSServiceRef with no ProcessReply function


What is happening here? Has anybody else seen these messages?


Regards

Christian

Replies

You can see the source of these messages in the mDNSResponder project in Darwin, and specifically in

dnssd_clientstub.c
. The DNS-SD client library talks to the
mDNSResponder
daemon via a UNIX domain socket. Every message over that socket is framed with a header of type
ipc_msg_hdr
. That header includes a version number field. Your first error indicates that the version number coming back from the daemon (3) does not match the version number that the client library was built with (1).

Version 1 is the expected version on all current systems, so it’s seems likely that something has gone wrong with the framing of messages on this socket, and that’s cause the client to build a header from data that isn’t actually a header.

If you can reproduce this at will — or even if you only see it occasionally but manage to notice it shortly after it’s happened — I’d appreciate you triggering a sysdiagnose and filing a bug with the resulting log. You can learn more about sysdiagnose on our Bug Reporting > Profiles and Logs page. Please post your bug number, just for the record.

The second error is almost certainly a consequence of the first. Note how the error handler nulls out

sdRef->ProcessReply
in that case.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"