Fwd: XPC service crash
Fwd: XPC service crash
- Subject: Fwd: XPC service crash
- From: Arjun SM <email@hidden>
- Date: Tue, 28 Apr 2015 10:01:29 +0530
Hi all,
My XPC service is crashing on Mavericks 10.9.5 and on Mountain Lion 10.8.x
and I am not able to figure out the problem. 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 and Mountain Lion OS X. Any help is greatly appreciated.
*CRASH LOG*
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
*Below is the Code Snippet that starts the service*
@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;
}
My launchd plist is as below,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "
http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.cmpnyName.cspxpc</string>
<key>Program</key>
<string>/Library/PrivilegedHelperTools/cspd.xpc/Contents/MacOS/cspd
</string>
<key>KeepAlive</key>
<true/>
<key>MachServices</key>
<dict>
<key>com.cmpnyName.cspxpc</key>
<dict>
<key>ResetAtClose</key>
<true/>
</dict>
</dict>
<key>EnableTransactions</key>
<true/>
</dict>
</plist>
thanks,
~Arjun
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden