jacobdufault / cquery

C/C++ language server supporting multi-million line code base, powered by libclang. Emacs, Vim, VSCode, and others with language server protocol support. Cross references, completion, diagnostics, semantic highlighting and more
MIT License
2.34k stars 163 forks source link

After recent update: lsp-timed-out-error #757

Open damon-kwok opened 5 years ago

damon-kwok commented 5 years ago

Debugger entered--Lisp error: (lsp-timed-out-error) signal(lsp-timed-out-error nil) lsp--send-wait("Content-Length: 215\15\n\15\n{\"jsonrpc\":\"2.0\",\"method\":\"$cquery/base\",\"params\":{\"textDocument\":{\"uri\":\"file:///home/damon/ArchitecturePrototype/Modules/Foundation/Source/CybertronLogServer/Main.cpp\"},\"position\":{\"line\":0,\"character\":0}},\"id\":2}" # #s(lsp--parser :waiting-for-response t :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "" :queued-notifications nil :queued-requests nil :workspace #s(lsp--workspace :parser #3 :file-versions #<hash-table equal 1/65 0x19b50b1> :server-capabilities #<hash-table equal 18/65 0x2011b39> :registered-server-capabilities nil :root "/home/damon/ArchitecturePrototype/" :client #s(lsp--client :language-id #f(compiled-function (_) #<bytecode 0x19b29bd>) :send-sync nil :send-async nil :type nil :new-connection #f(compiled-function (filter sentinel) #<bytecode 0x19625a5>) :stderr "lsp-cquery stderr" :get-root cquery--get-root :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 3/65 0x19b5071> :request-handlers #<hash-table equal 0/65 0x19bebe5> :response-handlers #<hash-table eql 0/65 0x19bfc7d> :string-renderers (("objectivec" lambda (str) (with-temp-buffer (delay-mode-hooks ...) (insert str) (font-lock-ensure) (buffer-string))) ("cpp" lambda (str) (with-temp-buffer (delay-mode-hooks ...) (insert str) (font-lock-ensure) (buffer-string))) ("c" lambda (str) (with-temp-buffer (delay-mode-hooks ...) (insert str) (font-lock-ensure) (buffer-string)))) :last-id 2 :enable-function lsp-cquery-enable :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x19b5091> :action-handlers #<hash-table equal 0/65 0x1d644dd> :default-renderer nil) :change-timer-disabled nil :proc # :cmd-proc # :buffers (#) :highlight-overlays #<hash-table eq 0/65 0x1e2e895> :extra-client-capabilities ((company-lsp . company-lsp--client-capabilities)) :status nil :metadata #<hash-table equal 0/65 0x1dd7355> :watches #<hash-table equal 0/65 0x1e83f95>))) lsp--send-request((:jsonrpc "2.0" :method "$cquery/base" :params (:textDocument (:uri "file:///home/damon/ArchitecturePrototype/Modules/Foundation/Source/CybertronLogServer/Main.cpp") :position (:line 0 :character 0)) :id 2)) cquery-xref-find-custom("$cquery/base") cquery-setup() funcall-interactively(cquery-setup) call-interactively(cquery-setup nil nil) command-execute(cquery-setup)

./cquery --check /home/damon/ArchitecturePrototype/Modules/Foundation/Source/CybertronLogServer/Main.cpp ( 0.000s) [main thread ] command_line.cc:438 | Running --check ( 0.000s) [main thread ] utils.cc:298 | Reading /home/damon/ArchitecturePrototype/Modules/Foundation/Source/CybertronLogServer/Main.cpp ( 0.000s) [main thread ] command_line.cc:451 | Using path /home/damon/ArchitecturePrototype/Modules/Foundation/Source/CybertronLogServer/Main.cpp ( 0.000s) [main thread ] project.cc:69 | Failed to normalize /home/damon/.cquery/bin/build ( 0.000s) [main thread ] project.cc:606 | Trying to load /home/damon/.cquery/bin/build/compile_commands.json ( 0.000s) [main thread ] project.cc:613 | Trying to load /home/damon/.cquery/bin/compile_commands.json ( 0.000s) [main thread ] project.cc:631 | Unable to load compile_commands.json located at "/home/damon/.cquery/bin/build/"; using directory listing instead. ( 0.000s) [main thread ] project.cc:504 | Using .cquery arguments from /home/damon/.cquery terminate called after throwing an instance of 'std::ios_failure' what(): basic_filebuf::underflow error reading the file: iostream error /home/damon/.cquery/bin/../lib/libclang.so.6(+0x1919454)[0x7f42ff051454] /home/damon/.cquery/bin/../lib/libclang.so.6(+0x1919736)[0x7f42ff051736] /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f42fca7b390] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f42fc6d5428] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f42fc6d702a] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x8c8f7)[0x7f42fd2348f7] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x92a46)[0x7f42fd23aa46] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x92a81)[0x7f42fd23aa81] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x92cb4)[0x7f42fd23acb4] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZSt19__throw_ios_failurePKc+0x88)[0x7f42fd26bea8] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt13basic_filebufIcSt11char_traitsIcEE9underflowEv+0x3fa)[0x7f42fd296bba] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt15basic_streambufIcSt11char_traitsIcEE5uflowEv+0x26)[0x7f42fd2cb666] ./cquery(_Z11SafeGetlineRSiRNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0xe1)[0x5df5c1] ./cquery(_Z19ReadLinesWithEndingB5cxx11RK12AbsolutePath+0x16f)[0x5e134f] ./cquery[0x53cf30] ./cquery[0x549ebc] ./cquery(_ZN7Project4LoadERK12AbsolutePath+0x5de)[0x54b29e] ./cquery(main+0x64b)[0x465c2b] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f42fc6c0830] ./cquery(_start+0x29)[0x471c39] Aborted

innerout commented 5 years ago

If i am not mistaken, cquery cannot load compile_commands.json for your project. Have you tested if this happens to another project of yours?

damon-kwok commented 5 years ago

@innerout It should have nothing to do with this, it is random, This problem is random,sometimes it work sometimes no.But before the update, it has not appeared in the past few months.

mkdir -p build
cd build; 
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=YES ..
cd ..
ln -s build/compile_commands.json
Debugger entered--Lisp error: (lsp-timed-out-error) signal(lsp-timed-out-error nil) lsp--send-wait("Content-Length: 215\15\n\15\n{"jsonrpc":"2.0","method":"$cquery/base","params":{"textDocument":{"uri":"file:///home/damon/ArchitecturePrototype/Modules/Foundation/Source/CybertronLogServer/Main.cpp"},"position":{"line":0,"character":0}},"id":2}" #
Debugger entered--Lisp error: (cl-assertion-failed (lsp--cur-workspace "No language server is associated with this buffer.")) cl--assertion-failed(lsp--cur-workspace "No language server is associated with this buffer." nil nil) cquery-xref-find-custom("$cquery/base") cquery-setup() funcall-interactively(cquery-setup) call-interactively(cquery-setup nil nil) command-execute(cquery-setup)
innerout commented 5 years ago

The best thing you can do is to find a way to reproduce the bug constantly.