Skip to content

Consistent server crash in kakoune #1751

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

Closed
raiguard opened this issue Dec 7, 2022 · 2 comments
Closed

Consistent server crash in kakoune #1751

raiguard opened this issue Dec 7, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@raiguard
Copy link

raiguard commented Dec 7, 2022

How are you using the lua-language-server?

Kakoune

Which OS are you using?

Linux

What is the issue affecting?

Completion, Diagnostics/Syntax Checking, Hover

Expected Behaviour

The server handles the change to the variable name without crashing.

Actual Behaviour

The language server crashes and reboots from scratch. Since my projects have lots of libraries, it takes upwards of ten seconds for it to reboot.

Reproduction steps

Open the following file in Kakoune with lua-language-server configured (see here):

local mystring = "foo"

print(string.match(mystring, "(foo)"))
  1. Change string on line 3 to math.
  2. Observe that the diagnostics correctly update to show that math.match doesn't exist.
  3. Change math back to string.
  4. Observe that the language server crashes and reboots, and the diagnostics in kak-lsp get desynced.

This is 100% reproducible with default configuration. The diagnostics getting out of sync is likely a byproduct of the crash, and is not the primary issue, but it makes it very obvious when the crash occurs.

image

Additional Notes

I tested this exact same setup in vscode, and it does not crash. This makes me unsure if the root of the issue is in lua-language-server, or in kak-lsp. However, I have absolutely no issues with any other language server in kak-lsp, so I'm leaning towards the server being at fault. Oddly, the server is not showing any sort of stack trace - it is just exiting without any useful information.

One thing I noticed is that kak-lsp does not support workspace/diagnostic/refresh. I am unsure if that is related to this problem.

Log File

Here are the logs both for lua-language-server, and for kak-lsp. The kak-lsp log shows every RPC request and response, as well as every method that is passed to or from the editor itself.
sumneko-crash.log
sumneko-crash-kak.log

@sumneko sumneko added the bug Something isn't working label Dec 9, 2022
sumneko added a commit that referenced this issue Dec 9, 2022
@sumneko
Copy link
Collaborator

sumneko commented Dec 9, 2022

Thanks for your log!

Client log:

Dec 07 19:14:59.362 ERRO panic: panicked at 'Failed to parse response: Error("invalid value: integer `-1`, expected u32", line: 0, column: 0)', src/context.rs:140:64, module: kak_lsp:286
Dec 07 19:14:59.362 INFO Waiting for Messages to language server to finish..., module: kak_lsp::thread_worker:19
Dec 07 19:14:59.362 DEBG Received signal to stop language server, closing pipe, module: kak_lsp::language_server_transport:193

Server log:

[12:14:59.362][warn] [#0:script/pub/report.lua:25]: Load proto error:	Disconnected!

It seems that the server send wrong parameters to client, witch makes the language client panic.
I have fixed the wrong parameter, however I think the client should also do something to avoiding panic in this case.

sumneko added a commit that referenced this issue Dec 9, 2022
@raiguard
Copy link
Author

raiguard commented Dec 9, 2022

Ah, my bad, I somehow overlooked that panic in the log. Thanks for fixing the parameter! I will reach out to kak-lsp to get the panic fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants