Do XPC errors imply failure to communicate with a macosx daemon? - macos

I am having a problem where a mac binary that interacts with CoreBluetooth fails as CBCentralManager reports "unsupported". I have already ensured entitlements, codesigning, and Security & Privacy are set properly. When I do verbose bluetooth logging I see the following:
[com.apple.bluetooth:CoreBluetooth] Sending XPC message 1: {
kCBMsgArgName = "TestApp";
kCBMsgArgOptions = {
kCBInitOptionRestoreIdentifier = SuperUnique;
kCBInitOptionShowPowerAlert = 1;
kCBManagerPrivacySupported = 0;
};
kCBMsgArgType = 0;
kCBMsgArgVersion = 20161219;
}
Default 0x0 152 0 bluetoothd: [com.apple.bluetooth:Server.XPC] Received XPC message "CBMsgIdCheckIn" from session ""
**Error 0x0 152 0 bluetoothd: [com.apple.bluetooth:Server.XPC] No XPC object for key: kCBMsgArgType**
My question is not about the permissions for Bluetooth and more about how severe this error is or if it is a red herring. Does this mean my IPC message to bluetoothd failed to be delivered? If so, how would XPC issues like this normally occur? SDK version mismatch? Is there any way to get more debugging information?

I upgraded from XCode 12.5.0 to 13.2.1 and the problem is resolved. It seems to have been an SDK mismatch and therefore the XPC messages were not being deserialized properly.
It would be good to get a more robust answer of how XPC messages work but I have not found a lot of resources on that. In lieu of that I can at least say this has solved the problem.

Related

CFNetwork SSL NSPOSIXErrorDomain Code=89 on Exchange Web Services

I'm trying to connect to an Exchange Web Services server which used to work from CFNetwork prior to October 7, but doesn't any more. I don't see any packages that were installed around this time so I'm guessing it was a server change.
I think this is proxied somehow (I don't run the server or have access to it) as some URLs work on this server but some don't. You don't even get prompted for authentication. The server is email dot fahc dot org. You should be able to get an OWA login page, but trying to access an EWS URL (e.g. /ews/Services.wsdl) doesn't work. I have no problems logging into it from Firefox or Chrome, but Safari, Mail, my own apps, etc. are broken.
This is broken on OS X 10.11 and macOS 10.12; OS X 10.10 is fine.
Here's what I get when testing with nscurl with CFNetwork diagnostics enabled. I see it trying to fall back from TLS 1.2 to 1.1 to 1.0, which works elsewhere, but I don't see any more specific errors than 89 (ECANCELED), which is somewhat less than helpful.
Oct 26 14:31:56 nscurl[15026] <Notice>: CFNetwork Diagnostics [3:37] 14:31:56.438 {
Did Fail
Loader: <CFURLRequest 0x7ffbc0502ed0 [0x7fff7552c440]> {url = https://[...]/ews/Services.wsdl, cs = 0x0}
Error: Error Domain=NSPOSIXErrorDomain Code=89 "Operation canceled" UserInfo={NSErrorPeerAddressKey=<CFData 0x7ffbc063a550 [0x7fff7552c440]>{length = 16, capacity = 16, bytes = 0x100201bb0a801e2e0000000000000000}, _kCFStreamErrorCodeKey=89, _kCFStreamErrorDomainKey=1}
init to origin load: 0.00233305s
total time: 0.205145s
total bytes: 0
} [3:37]
Any ideas how I can dig into this further, or should I just file a bug?
Thanks.
This appears to be related to VMware NAT. After switching my VM to bridged networking, this issue disappeared (on both the 10.11 host and 10.12 guest). Thanks to #mikeymikey on Twitter for the suggestion.

Error during initializing the Scanner of mPop Printer

I am developing a point of Sale Application in which there is requirement of Bluetooth connectivity which printer and scanner. I am using star Printer. I am getting following error randomly when scanner is being initialized.
ERROR - opening session
ERROR - /SourceCache/ExternalAccessory/ExternalAccessory-288.20.7/EASession.m:-[EASession dealloc] - 141 unable to close session for _accessory=0x16768100 and sessionID=65536
Thanks,
Ratneshwar
I had the same bug, so finally i fixed it downloading the mPOP utility and changing in the bluetooth configuration the Name port.
It isnt a complete solution, but while star micronics fix the problem can works to the customers.
EDIT: If you have implemented both sdks StarIO.framework and StarIO_extension.framework and you are using the barcode lector always in your app you should use the method [_starIoExtManager.lock lock]; before you try to get the connection of the port and after you do that and close the port, use [_starIoExtManager.lock unlock];

Error message when initializing EKEventStore on OS X 10.10

I would like to programmatically create a new reminder in my app that runs on Mavericks.
As written in the Mac Developer Library, I tried to use the method initWithAccessToEntityTypes to initialize an event store:
On OS X, use initWithAccessToEntityTypes: instead of the default init
method. Acceptable entity types are EKEntityMaskEvent for events and
EKEntityMaskReminder for reminders.
However, Xcode complained that this method is deprecated in OS X 10.9.
When using it anyway, I get the following error message:
[com.apple.calendar.store.log] [Tried to connect to XPC persistence,
but connection was invalidated, retrying...]
[com.apple.calendar.store.log] [Retried too many times, giving up.]
[com.apple.calendar.store.log] [Couldn't start the XPC store server.
[Error Domain=CalPersistenceCreationDomain Code=3 "Could not create
XPC connection to the CalendarAgent, connection interrupted or
invalidated more than 5 times" UserInfo=0x6080002698c0
{NSLocalizedDescription=Could not create XPC connection to the
CalendarAgent, connection interrupted or invalidated more than 5
times}]] [com.apple.calendar.agentLink.xpc] [Creating a remote proxy
object for com.apple.CalendarAgent.proxy resulted in an invalid
connection. The connection will be removed. Error
Domain=NSCocoaErrorDomain Code=4099 "Couldn’t communicate with a
helper application." (The connection to service named
com.apple.CalendarAgent.proxy was invalidated.)
UserInfo=0x600000475e80 {NSDebugDescription=The connection to service
named com.apple.CalendarAgent.proxy was invalidated.} (
I've searched using Google, StackOverflow, and the Mac developer forums but I could not find a way to make it work.
What can I do to initialize the event store in order to add a new reminder?
The app was sandboxed. I changed the sandbox setting in Xcode (see screenshot) and now it works. Also, it seems that it is now possible to initialize a store simply by using:
self.ekEventStore = [[EKEventStore alloc] init];

Unable to Open SCOAudio connection with phone

I am trying to use IOBluetooth framework on OS X 10.8.2 to connect with the bluetooth enabled phones emulating computer as a hands free device. I can successfully make a connection with the phone and phone can recognise the connection as a HandsFree connected to the phone.
But when I try to make a call with the phone and want to send the audio to the mac (by selecting the source as handsfree), the audio never reaches the computer.
As at this point the bluetooth framework tries to open a SCO Audio connection with the device, but the connection establishment is never successful and I get the error code 0x0D status code in scoConnectionOpened status.
I am using IOBluetoothAddSCOAudioDevice function to attach the SCO Audio device with bluetooth device and it is always successful.
//btDevice is paired
res=IOBluetoothAddSCOAudioDevice((IOBluetoothDeviceRef) btDevice,NULL);
if(res != kIOReturnSuccess)
{
self.error.title = [NSString stringWithFormat:
#"Could not attach the Audio device. Try paring device again"];
}
The console log says
24/11/2012 4:02:13.000 PM kernel[0]: [SendHCIRequestFormatted] ###
ERROR: [0x0428] (Setup Synchronous Connection) -- Send request failed
(err = 0x000D (kBluetoothHCIErrorHostRejectedLimitedResources))
24/11/2012 4:02:13.000 PM kernel[0]: REQUIRE_NO_ERR failure: 0xd -
file:
/SourceCache/IOBluetoothFamily_kexts/IOBluetoothFamily-4090.4.33/Core/Family/Drivers/IOBluetoothSCOAudioDriver/IOBluetoothSCOAudioDevice.cpp:872
Although console log says limited resources but I have tried it with multiple phones having their batteries full.
I am stumped on this and just thinking if I need to do any thing special or different?
Thanks in advance for much appreciated help.
This error ("Connection Rejected due to Limited resource") typically happens when a T2 request is sent to a T1-only SCO listener. If you read the patch notes to version 5 you can get a discussion about this problem linux-bluetooth v5 patch notes

Windows Mobile 6 intermittent connection status NOPATHTODESTINATION

On a Windows Mobile 6 device we are trying to open an internet connection. This usually works but sometimes we get a return code of 0x80004005 with a status of CONNMGR_STATUS_NOPATHTODESTINATION. When this happens it will keep happening but if you launch IE on the device, it will connect and then our call to ConnMgrEstablishConnectionSync works. We have not been able to isolate what causes this to happen, it currently appears to be random (though I suspect it isn't). Any hints?
Our code looks basically like this:
CONNMGR_CONNECTIONINFO connInfo;
DWORD dwStatus = 0;
memset(&connInfo, 0, sizeof(connInfo));
connInfo.cbSize = sizeof(connInfo);
connInfo.dwParams = CONNMGR_PARAM_GUIDDESTNET;
connInfo.dwFlags = CONNMGR_FLAG_NO_ERROR_MSGS;
connInfo.dwPriority = CONNMGR_PRIORITY_HIPRIBKGND;
connInfo.guidDestNet = IID_DestNetInternet; /* Connect to the "Internet" network */
hr = ConnMgrEstablishConnectionSync(&connInfo, &s_hConnection, 120 * 1000, &dwStatus);
Windows Mobile connection manager is a huge PITA. Do you get the same error if you specify the network address by IP (e.g. "255.255.255.255/whatever") instead of by server name?
My guess is you could reproduce the lack-of-connection on demand with one of these methods:
Clearing the history in IE on the WM device
Closing IE from the running programs screen (in other words, really removing it from memory)
Soft resetting the device

Resources