2 Replies
      Latest reply on Nov 4, 2015 3:13 PM by titanshadow
      absinth Level 1 Level 1 (0 points)

        hello all,

         

        as per Apple's recommendations, we have seperated our root-level functionality of deleting files into a seperate helper app that is installed globally via SMJobBless() to /Library/PrivilegedHelperTools & /Library/LaunchDaemons.

         

        at launch our app (UninstallPKG) creates a XPC connection to the helper (xpc_connection_create_mach_service() ) and when it needs to delete a file it sends a message to the helper app ( xpc_connection_send_message_with_reply_sync() ) which then performs its task.

         

        this works perfectly well on all our test machines, and for most of our customers. however, it seems like some users are constantly encountering 'XPC_ERROR_CONNECTION_INVALID' failures. does anyone have any clue why this happens for some customers and how we could handle or prevent this problem? barring more information about what 'XPC_ERROR_CONNECTION_INVALID' actually means, we currently just quit the app, which is just as bad as a crash.

         

        google or apple's documentation or sample code reveals little about under what circumstances 'XPC_ERROR_CONNECTION_INVALID' could be encountered and how it should be gracefully handles. any insights would be appreciated. if Apple is serious about this priviledge separation thing, documentation on how to do so reliably should really be improved.

         

        btw to a lesser extent we are also seeing 'XPC_ERROR_CONNECTION_INTERRUPTED' out in the wild. we are currently just ignoring it. any insights on this one?


        thanks, julian