emacs-lsp / emacs-ccls

Emacs client for ccls, a C/C++ language server
200 stars 29 forks source link

CCLS Restart prompt after opening specific source file #63

Closed RomeuG closed 4 years ago

RomeuG commented 4 years ago

Hello.

When I open a very specific file in my project, the Ccls server shuts down and there is a prompt to restart it. This is the message: Server ccls:23405 exited with status signal. Do you want to restart it? (y or n)

The file: https://github.com/RomeuG/libPkmnSave/blob/master/tests/src/main.cpp

For the software I am using:

CCLS

$ ccls --version
ccls version 0.20190823.4-6-g396d0668
clang version 9.0.0 (tags/RELEASE_900/final)

Clang

$ clang --version
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /bin

OS

$ uname -a
Linux xerxes 5.3.7-1-ck-haswell #1 SMP PREEMPT @1572041003 x86_64 GNU/Linux

When I open that specific file, the ccls::stderr buffer shows me this:

20:30:13 ccls           initialize.cc:262 I initialize in directory /home/romeu/Documents/Projects/libpkmnsave with uri file:///home/romeu/Documents/Projects/libpkmnsave
20:30:13 ccls           initialize.cc:285 I initializationOptions: {"compilationDatabaseCommand":"","compilationDatabaseDirectory":"","cache":{"directory":".ccls-cache","format":"binary","hierarchicalPath":false,"retainInMemory":2},"capabilities":{"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"}","moreTriggerCharacter":[]},"foldingRangeProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}}},"clang":{"excludeArgs":[],"extraArgs":[],"pathMappings":[],"resourceDir":""},"client":{"diagnosticsRelatedInformation":true,"hierarchicalDocumentSymbolSupport":true,"linkSupport":true,"snippetSupport":true},"codeLens":{"localVariables":true},"completion":{"caseSensitivity":2,"detailedLabel":true,"dropOldRequests":true,"duplicateOptional":true,"filterAndSort":true,"include":{"blacklist":[],"maxPathSize":30,"suffixWhitelist":[".h",".hpp",".hh",".inc"],"whitelist":[]},"maxNum":100,"placeholder":true},"diagnostics":{"blacklist":[],"onChange":1000,"onOpen":0,"onSave":0,"spellChecking":true,"whitelist":[]},"highlight":{"largeFileSize":2097152,"lsRanges":false,"blacklist":[],"whitelist":[]},"index":{"blacklist":[],"comments":2,"initialNoLinkage":false,"initialBlacklist":[],"initialWhitelist":[],"maxInitializerLines":5,"multiVersion":0,"multiVersionBlacklist":[],"multiVersionWhitelist":[],"name":{"suppressUnwrittenScope":false},"onChange":false,"parametersInDeclarations":true,"threads":0,"trackDependency":2,"whitelist":[]},"request":{"timeout":5000},"session":{"maxNum":10},"workspaceSymbol":{"caseSensitivity":1,"maxNum":1000,"sort":true},"xref":{"maxNum":2000}}
20:30:13 ccls           initialize.cc:317 I use -resource-dir=/usr/lib/clang/9.0.0
20:30:13 ccls           initialize.cc:350 I workspace folder: /home/romeu/Documents/Projects/libpkmnsave/
20:30:13 ccls              project.cc:426 I loaded /home/romeu/Documents/Projects/libpkmnsave/compile_commands.json
20:30:13 ccls           initialize.cc:375 I start 8 indexers
20:30:13 ccls           initialize.cc:383 I dispatch initial index requests
20:30:13 ccls             pipeline.cc:473 I loaded project. Refresh semantic highlight for all working file.
20:30:13 indexer1         pipeline.cc:339 I delete /home/romeu/Documents/Projects/libpkmnsave/src/Rom/Rom.cpp
20:30:13 indexer5         pipeline.cc:339 I delete /home/romeu/Documents/Projects/libpkmnsave/src/Rom/Rom32kb.cpp
20:30:13 indexer2         pipeline.cc:339 I delete /home/romeu/Documents/Projects/libpkmnsave/src/Rom/Rom64kb.cpp
20:30:13 indexer4         pipeline.cc:339 I delete /home/romeu/Documents/Projects/libpkmnsave/src/Rom/RomInterface.cpp
20:30:13 indexer6         pipeline.cc:339 I delete /home/romeu/Documents/Projects/libpkmnsave/src/IGlobal.cpp
20:30:13 indexer0         pipeline.cc:339 I delete /home/romeu/Documents/Projects/libpkmnsave/src/Gen/Gen1/Gen1.cpp
20:30:13 indexer3         pipeline.cc:289 I load cache for /home/romeu/Documents/Projects/libpkmnsave/src/Utils.cpp
20:30:13 indexer7         pipeline.cc:339 I parse /home/romeu/Documents/Projects/libpkmnsave/tests/src/main.cpp
20:30:13 preamble     sema_manager.cc:734 I create session for /home/romeu/Documents/Projects/libpkmnsave/tests/src/main.cpp
#0 0x00007fce56793b7b llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/lib/libLLVM-9.so+0xb08b7b)
#1 0x00007fce56791a44 llvm::sys::RunSignalHandlers() (/usr/lib/libLLVM-9.so+0xb06a44)
#2 0x00007fce56791bd6 (/usr/lib/libLLVM-9.so+0xb06bd6)
#3 0x00007fce55931930 __restore_rt (/usr/lib/libpthread.so.0+0x14930)
#4 0x00007fce5b5a5f40 clang::NestedNameSpecifier::getKind() const (/usr/lib/libclangAST.so.9+0x380f40)

Process ccls stderr finished

What can I do to help you help me solve this?

Thanks.

MaskRay commented 4 years ago

This usually indicates that the build is at fault. There may be lots of root causes. You may follow the troubleshooting process described at https://github.com/MaskRay/emacs-ccls/issues/62

RomeuG commented 4 years ago

For some reason it started working. I have no clue why (no updates done).

Maybe it is because instead of opening that file directly, I opened a different project related file before opening the "offending" file.