This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix crash if pending computations were active on exit
ClosedPublic

Authored by ilya-biryukov on Sep 24 2018, 7:39 AM.

Details

Summary

Make sure JSONRPCDispatcher outlives the worker threads, they access
its fields to remove the stored cancellations when Context dies.

Diff Detail

Repository
rL LLVM

Event Timeline

ilya-biryukov created this revision.Sep 24 2018, 7:39 AM
ioeric added inline comments.Sep 24 2018, 8:17 AM
clangd/ClangdLSPServer.cpp
483 ↗(On Diff #166684)

This woudn't work if run() is called multiple times. Maybe create a Server in each run()?

ilya-biryukov added inline comments.Sep 24 2018, 9:41 AM
clangd/ClangdLSPServer.cpp
483 ↗(On Diff #166684)

run() asserts it's never called multiple times, so we don't break the contract.

ioeric accepted this revision.Sep 25 2018, 3:07 AM

lgtm

This revision is now accepted and ready to land.Sep 25 2018, 3:07 AM
This revision was automatically updated to reflect the committed changes.