mtshiba / pylyzer

A fast static code analyzer & language server for Python
http://mtshiba.github.io/pylyzer/
MIT License
2.41k stars 32 forks source link

Stack overflow when used from nVim #73

Open savchenko opened 9 months ago

savchenko commented 9 months ago

LSP log obtained with vim.lsp.set_log_level 'trace'

[TRACE][2024-01-16 00:51:51] ...lsp/handlers.lua:618    "default_handler"       "workspace/configuration"       {  ctx = '{\n  client_id = 1,\n  method = "workspace/configuration"\n}',  result = {    items = { { section = "files.autoSave"      } }  }}
[DEBUG][2024-01-16 00:51:51] .../vim/lsp/rpc.lua:403    "server_request: callback result"       {  result = { vim.NIL },  status = true}
[DEBUG][2024-01-16 00:51:51] .../vim/lsp/rpc.lua:284    "rpc.send"      {  id = 10001,  jsonrpc = "2.0",  result = { vim.NIL }}
[TRACE][2024-01-16 00:51:51] .../lua/vim/lsp.lua:1066   "server_request"        "window/workDoneProgress/create"        {  token = "els/start_workspace_diagnostics"}
[TRACE][2024-01-16 00:51:51] .../lua/vim/lsp.lua:1069   "server_request: found handler for"     "window/workDoneProgress/create"
[TRACE][2024-01-16 00:51:51] ...lsp/handlers.lua:618    "default_handler"       "window/workDoneProgress/create"        {  ctx = '{\n  client_id = 1,\n  method = "window/workDoneProgress/create"\n}',  result = { token = "els/start_workspace_diagnostics"  }}
[DEBUG][2024-01-16 00:51:51] .../vim/lsp/rpc.lua:403    "server_request: callback result"       {  result = vim.NIL,  status = true}
[DEBUG][2024-01-16 00:51:51] .../vim/lsp/rpc.lua:284    "rpc.send"      {  id = 1,  jsonrpc = "2.0",  result = vim.NIL}
[ERROR][2024-01-16 00:51:52] .../vim/lsp/rpc.lua:734    "rpc"   "/home/bin/pylyzer"   "stderr"        "\nthread 'pylyzer' has overflowed its stack\nfatal runtime error: stack overflow\n"
[INFO][2024-01-16 00:51:57] .../lua/vim/lsp.lua:1875    "exit_handler"  {}

In :messages

Client 1 quit with exit code 0 and signal 6

I have tried overriding cmd = { 'pylyzer', '--server', '--verbose', '2' }, but this hasn't introduced any additional information in the LSP log or stderr/out.

jlzht commented 6 days ago

Any update on this?

mtshiba commented 6 days ago

Bugs that cause stack overflows are common in the type checker, but are continually being fixed. If the problem is still not resolved in the latest version, please provide us with more information such as the code where the problem occurred, so we can help fix the bug.