My XPC service is crashing on Mavericks 10.9.5 and I am not able ti figure out why. I have pasted the logs below. The same code works perfectly fine on latest 10.10 Yosemite.
I am not sure what changes to be done in my code to make it work on Mavericks 10.9.5. Any help is greatly appreciated.
Process: cspd [1930]
Path: /Library/PrivilegedHelperTools/*/cspd
Identifier: cspd
Version: 1.0 (1.0.)
Code Type: X86-64 (Native)
Parent Process: launchd [1]
Responsible: cspd [1930]
User ID: 0
Date/Time: 2015-04-27 15:56:47.803 +0530
OS Version: Mac OS X 10.9.5 (13F34)
Report Version: 11
Anonymous UUID: 69D81D83-6C1D-62A2-E979-4A567F1EF27D
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Application Specific Information:
Configuration error: Could not create listener. xpc_main() was probably called from a process that is not an XPC service bundle.
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libxpc.dylib 0x00007fff8a9b8bb6 xpc_main + 359
1 com.apple.Foundation 0x00007fff88f37cdb -[NSXPCListener resume] + 108
2 com.mcafee.cspxpc
0x0000000105fcc6b5 main + 98 (
main.mm:34)
3 libdyld.dylib 0x00007fff88cc65fd start + 1
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x00007fff8a9c3744 rbx: 0x00007fb1f1c0bce0 rcx: 0x00000000000000ac rdx: 0x0000000000000003
rdi: 0x000000000000020b rsi: 0x0000000010000003 rbp: 0x00007fff59c9be00 rsp: 0x00007fff59c9bd50
r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0x00000000000000ac r11: 0x0000000000000206
r12: 0x00000001060ec010 r13: 0x0000000000000000 r14: 0x00007fff88f37cdb r15: 0x0000000000000000
rip: 0x00007fff8a9b8bb6 rfl: 0x0000000000010206 cr2: 0x00007fff75b654d0
@interface ServiceDelegate : NSObject <NSXPCListenerDelegate>
@end
@implementation ServiceDelegate
- (BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection {
NSLog(@"Received connection request from process PID : %d", newConnection.processIdentifier );
newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MCSP_XPCProtocol)];
// Exported connection object
MCSPClient *exportedObject = [MCSPClient sharedClient];
newConnection.exportedObject = exportedObject;
[newConnection resume];
return YES;
}
@end
int main(int argc, const char *argv[])
{
ServiceDelegate *delegate = [ServiceDelegate new];
NSXPCListener *listener = [NSXPCListener serviceListener];
listener.delegate = delegate;
[listener resume];
return 0;
}