MaskRay / ccls

C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting
Apache License 2.0
3.75k stars 257 forks source link

Crash/disconnect on inspection of file in VS Code #807

Closed wisepotato closed 3 years ago

wisepotato commented 3 years ago

I am aware that this is not the vs code plugin repo, but the crash is in ccls, so i thouht it would fit here.

Observed behavior

I use VS Code to call ccls on my project it works great! but also crashes a lot. The (blurred for company specific details) error log:

15:38:16 indexer1         pipeline.cc:298 I load cache for $FILE
15:38:16 indexer0         pipeline.cc:298 I load cache for $FILE
15:38:16 indexer1         pipeline.cc:298 I load cache for $FILE
15:38:16 indexer0         pipeline.cc:298 I load cache for $FILE
15:38:16 indexer1         pipeline.cc:298 I load cache for $FILE
 #0 0x0000000001830bef PrintStackTraceSignalHandler(void*) (/home/$name/git/ccls/Release/ccls+0x1830bef)
 #1 0x000000000182e92e SignalHandler(int) (/home/$name/git/ccls/Release/ccls+0x182e92e)
 #2 0x00007f73d67755d0 __restore_rt (/lib64/libpthread.so.0+0xf5d0)
 #3 0x00000000017e1760 llvm::Twine::printOneChild(llvm::raw_ostream&, llvm::Twine::Child, llvm::Twine::NodeKind) const [clone .constprop.25] (/home/$name/git/ccls/Release/ccls+0x17e1760)
 #4 0x00000000017e1bc2 llvm::Twine::toVector(llvm::SmallVectorImpl<char>&) const (/home/$name/git/ccls/Release/ccls+0x17e1bc2)
 #5 0x00000000004675e7 ccls::pipeline::(anonymous namespace)::indexer_Parse(ccls::SemaManager*, ccls::WorkingFiles*, ccls::Project*, ccls::VFS*, ccls::GroupMatch const&) (/home/$name/git/ccls/Release/ccls+0x4675e7)
 #6 0x0000000000468976 ccls::pipeline::indexer_Main(ccls::SemaManager*, ccls::VFS*, ccls::Project*, ccls::WorkingFiles*) (/home/$name/git/ccls/Release/ccls+0x468976)
 #7 0x00000000004f0704 ccls::(anonymous namespace)::indexer(void*) (/home/$name/git/ccls/Release/ccls+0x4f0704)
 #8 0x00007f73d676ddd5 start_thread (/lib64/libpthread.so.0+0x7dd5)
 #9 0x00007f73d5837ead __clone (/lib64/libc.so.6+0xfdead)
ccls server connection was closed

it works great 50% of the time, and crashes indiscriminately. I have compiled both LLVM +CLANG and ccls and cmake (needed new version) from source.

Expected behavior

It to not crash.

Steps to reproduce

  1. Start a project
  2. click on cc file
  3. boom

System information

wisepotato commented 3 years ago

seems to fail after a recompile. Will cross post to vs code repo

wisepotato commented 3 years ago

@MaskRay thanks for working on this proejct, i fixed it myself by setting both ccls and llvm to latest tag, might be worht adding to documentation.