{"action":"opened","issue":{"url":"https://api.github.com/repos/datatheorem/TrustKit/issues/58","repository_url":"https://api.github.com/repos/datatheorem/TrustKit","labels_url":"https://api.github.com/repos/datatheorem/TrustKit/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/datatheorem/TrustKit/issues/58/comments","events_url":"https://api.github.com/repos/datatheorem/TrustKit/issues/58/events","html_url":"https://github.com/datatheorem/TrustKit/issues/58","id":164839627,"number":58,"title":"XPC exception with NSURLSession background sessions","user":{"login":"nabla-c0d3","id":1915165,"avatar_url":"https://avatars.githubusercontent.com/u/1915165?v=3","gravatar_id":"","url":"https://api.github.com/users/nabla-c0d3","html_url":"https://github.com/nabla-c0d3","followers_url":"https://api.github.com/users/nabla-c0d3/followers","following_url":"https://api.github.com/users/nabla-c0d3/following{/other_user}","gists_url":"https://api.github.com/users/nabla-c0d3/gists{/gist_id}","starred_url":"https://api.github.com/users/nabla-c0d3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nabla-c0d3/subscriptions","organizations_url":"https://api.github.com/users/nabla-c0d3/orgs","repos_url":"https://api.github.com/users/nabla-c0d3/repos","events_url":"https://api.github.com/users/nabla-c0d3/events{/privacy}","received_events_url":"https://api.github.com/users/nabla-c0d3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-11T13:40:47Z","updated_at":"2016-07-11T13:40:47Z","closed_at":null,"body":"One App has been seeing the following intermittent crash:\r\n\r\n```\r\nApplication Specific Information:\r\n*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[_NSXPCDistantObject methodSignatureForSelector:]: No protocol has been set on connection <NSXPCConnection: 0x15dc25f50> connection to service named com.apple.nsurlsessiond'\r\n```\r\n\r\nThere's very little information available on the Internet regarding this crash but the developer posted it on the Apple Developer Forum at https://forums.developer.apple.com/thread/45651 and got an answer:\r\n\r\n> ... I forgot to loop back here to post an update; sorry.\r\nAFAICT this crash is caused by NSURLSession’s background session support.  This passes work to its daemon (nsurlsessiond) using NSXPCConnection (not part of the iOS SDK, but public API on OS X, so you can read up about it there).  NSXPCConnection has the notion of interrupted connections, that is, the IPC connection between the client and the server has torn but can be re-established.  NSURLSession’s background session support, like all NSXPCConnection clients, must handle these interruptions as a matter of course.\r\nAlas, there’s a bug in the way it does that.  This bug is a race condition that manifest itself as this crash.  We hope to fix this in a future OS release but I can’t share any concrete details.\r\n\r\nTrustKit uses background sessions to upload pin failure reports. According to the reporter, they have been seeing this crash more often after upgrading TrustKit from 1.1.3 to 1.2.0, but are unable to reproduce it.\r\n\r\nLooking at the changes ( https://github.com/datatheorem/TrustKit/compare/1.1.3...1.2.0 ), there are only two commits with changes to how the reports get uploaded:\r\n\r\n* https://github.com/datatheorem/TrustKit/commit/46299ff73bb3f3e56418a6b7702f4c5fbdba57e1\r\n* https://github.com/datatheorem/TrustKit/commit/bc39395d135f0f510dec4dacdeb2f34baede93cf\r\n\r\nWithout a clear way to reproduce this and as it is a bug in iOS (ie. not a bug in TrustKit), this will be a tough one to fix."}}
{"actor":{"display_login":"nabla-c0d3"}}