Skip to content

[sourcekitd] Fix crash in onDocumentUpdateNotification #14355

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
Copy link
Contributor Author

nathawes commented Feb 2, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Feb 2, 2018

Build failed
Swift Test Linux Platform
Git Sha - 27e4410412c7f041a27d565eb5b6525bd3c59abe

@nathawes
Copy link
Contributor Author

nathawes commented Feb 2, 2018

@swift-ci please test linux

@nathawes nathawes force-pushed the rdar36077481-crash-in-on-document-update-notification branch from 27e4410 to 3d97980 Compare February 2, 2018 23:49
…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
@nathawes
Copy link
Contributor Author

nathawes commented Feb 2, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Feb 2, 2018

Build failed
Swift Test OS X Platform
Git Sha - 27e4410412c7f041a27d565eb5b6525bd3c59abe

@nathawes
Copy link
Contributor Author

nathawes commented Feb 3, 2018

@swift-ci please test linux

@swift-ci
Copy link
Contributor

swift-ci commented Feb 3, 2018

Build failed
Swift Test Linux Platform
Git Sha - 27e4410412c7f041a27d565eb5b6525bd3c59abe

@nathawes nathawes merged commit 55d73e9 into swiftlang:master Feb 5, 2018
@nathawes nathawes deleted the rdar36077481-crash-in-on-document-update-notification 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