Skip to content

[5.0][sourcekitd] Fix crash in onDocumentUpdateNotification #14354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

nathawes
Copy link
Contributor

@nathawes nathawes commented Feb 2, 2018

SourceKit didn't xpc_retain a globally stored XPC connection reference, MainConnection, allowing it to be used in an invalid state. This happened if the client cancelled the connection or crashed while SourceKit was busy gathering semantic information for a document. SourceKit would use the invalid connection to try to notify the client when it finished and crash.

Resolves rdar://problem/36077481

@nathawes nathawes changed the title [sourcekitd] Fix crash in onDocumentUpdateNotification [5.0][sourcekitd] Fix crash in onDocumentUpdateNotification Feb 2, 2018
@nathawes
Copy link
Contributor Author

nathawes commented Feb 2, 2018

@swift-ci please test

@nathawes nathawes force-pushed the rdar36077481-crash-in-on-document-update-notification-5.0 branch from 5981586 to fd462f9 Compare February 2, 2018 23:53
@nathawes
Copy link
Contributor Author

nathawes commented Feb 2, 2018

@swift-ci please test

…g when cancelled from the other end

If a client crashes and we tried to post notifications to the XPC connection,
SourceKitService would go down too, as it never `xpc_retain`ed the connection.

Resolves rdar://problem/36077481
@swift-ci
Copy link
Contributor

swift-ci commented Feb 2, 2018

Build failed
Swift Test OS X Platform
Git Sha - 5981586e74d4405a3214006d1180c07c5a0f7e66

@swift-ci
Copy link
Contributor

swift-ci commented Feb 3, 2018

Build failed
Swift Test Linux Platform
Git Sha - 5981586e74d4405a3214006d1180c07c5a0f7e66

@nathawes
Copy link
Contributor Author

nathawes commented Feb 5, 2018

@swift-ci please smoke test and merge

@nathawes nathawes merged commit 2865425 into swiftlang:swift-5.0-branch Feb 5, 2018
@nathawes nathawes deleted the rdar36077481-crash-in-on-document-update-notification-5.0 branch February 5, 2018 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants