To begin with: I know it's my code, because if I go back to our main branch and try it, I don't get this crash. But I can't figure out what it's unhappy about, so I'm not sure what changes I have to look for. (Also, this is macOS.)
The daemon tries to communicate with a Network Extension over XPC. I have a class, with a shared
instance, and I have a cached NSXPCConnection
connection instance variable. So my code is something like id connection = [[ExtensionCommunication shared] connection]
, which is created by [[NSXPCConnection alloc] initWithMachServiceName:self.redirectorMachServiceName options:0]
.
With my changes (whatever they are), when it does [_connection resume]
, it crashes:
* frame #0: 0x00007ff8191ab20e libxpc.dylib`_xpc_api_misuse + 117
frame #1: 0x00007ff8191963a1 libxpc.dylib`xpc_connection_resume + 54
This happens whether the network extension is activated or not. The crash happens the second time this is called. (Hm, one thing I need to figure out then is why my cached connection object is being set to nil. It shouldn't be. hm.)
Anyway! Any suggestions on how I can try to debug this?