bash-language-server
bash-language-server copied to clipboard
after update to version 5.0.0 keeps spawning shellcheck until memory runs out.
Code editor
vim
Platform
Linux 6.4.3
Version
5.0.0
What steps will reproduce the bug?
Start vim with filetype or sh.
How often does it reproduce? Is there a required condition?
Everytime.
What is the expected behavior?
n/a
What do you see instead?
After starting vim with filetype sh more and more sessions of shellcheck are spawned until memory runs out and kernel steps in and kills processes.
Additional information
Jul 15 17:42:47 arch kernel: [ 2283] 1000 2283 268462800 109120 1118208 0 0 shellcheck
Jul 15 17:42:47 arch kernel: [ 2282] 1000 2282 268462800 109184 1118208 0 0 shellcheck
Jul 15 17:42:47 arch kernel: [ 2271] 1000 2271 268462800 159134 1519616 0 0 shellcheck
Jul 15 17:42:47 arch kernel: [ 2270] 1000 2270 268462800 159296 1519616 0 0 shellcheck
Jul 15 17:42:47 arch kernel: [ 2246] 1000 2246 268462800 409215 3522560 0 0 shellcheck
Jul 15 17:42:47 arch kernel: [ 2245] 1000 2245 268462800 409653 3522560 0 0 shellcheck
Jul 15 17:42:47 arch kernel: [ 2244] 1000 2244 268462800 416446 3579904 0 0 shellcheck
Jul 15 17:42:47 arch kernel: [ 2243] 1000 2243 268462800 352768 3076096 0 0 shellcheck
Jul 15 17:42:47 arch kernel: [ 2241] 1000 2241 268462800 759616 6328320 0 0 shellcheck
Jul 15 17:42:47 arch kernel: [ 2240] 1000 2240 268462800 637695 5353472 0 0 shellcheck
Jul 15 17:42:47 arch kernel: [ 2173] 1000 2173 268462800 939777 7786496 0 0 shellcheck
Jul 15 17:42:47 arch kernel: [ 2172] 1000 2172 268462800 942017 7798784 0 0 shellcheck
Jul 15 17:42:47 arch kernel: [ 2171] 1000 2171 268462800 984575 8138752 0 0 shellcheck
Jul 15 17:42:47 arch kernel: [ 1907] 1000 1907 268462800 951553 8265728 0 0 shellcheck
Then shortly after system locks up and then.
Jul 15 17:42:47 arch kernel: Out of memory: Killed process 2171 (shellcheck) total-vm:1073851200kB, anon-rss:3937532kB, file-rss:768kB, shmem-rss:0kB, UID:1000 pgtables:7948kB oom_score_adj:0
Unsure if this is bash-language-server or shellcheck issue but it started right after I updated bash-language-server today. I also opened an issue on the shellcheck github page I am unsure how to diagnose this further but thought I would mention it here.
Thank you, Jason C.
Can you please try downgrading? Not sure how you install the language server, but npm install -g [email protected]
should do the trick.
I tried downgrading to the bash-language-server-4.9.2-2 and it appear to be fine so I tried upgrading to 5.0.0-1 and the issue seems to have been resolved. I will do some more digging but I wasn't thinking and I updated my machine again today something may have been updated. I run the server via coc-vim so it may have even been an issue with that also sorry to waste your time. But if I find out any information I'll let you know.
The issue seems to have started happening again not exactly sure what is going on I will try downgrading again and see if that fixes it and let you know.
Jul 21 15:45:25 arch kernel: Out of memory: Killed process 30148 (shellcheck) total-vm:1073851200kB, anon-rss:3714248kB, file-rss:3840kB, shmem-rss:0kB, UID:1000 pgtables:7516kB oom_score_adj:0
Jul 21 15:45:25 arch kernel: oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/session-1.scope,task=shellcheck,pid=30148,uid=1000
Jul 21 15:45:25 arch kernel: [ 31291] 0 31291 1916 256 49152 0 0 login
Jul 21 15:45:25 arch kernel: [ 30976] 1000 30976 268462800 48448 638976 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30975] 1000 30975 268462800 62657 745472 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30937] 1000 30937 268462800 113536 1150976 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30936] 1000 30936 268462800 107904 1110016 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30935] 1000 30935 268462800 98688 1036288 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30733] 1000 30733 268462800 145536 1404928 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30732] 1000 30732 268462800 145984 1417216 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30637] 1000 30637 268462800 160959 1531904 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30636] 1000 30636 268462800 161147 1527808 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30556] 1000 30556 268462800 160766 1531904 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30555] 1000 30555 268462800 161726 1536000 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30497] 1000 30497 268462800 161474 1527808 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30496] 1000 30496 268462800 272005 2424832 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30385] 1000 30385 268462800 274816 2453504 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30384] 1000 30384 268462800 429632 3686400 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30305] 1000 30305 268462800 614589 5169152 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30304] 1000 30304 268462800 803071 6684672 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30240] 1000 30240 268462800 642809 5402624 0 0 shellcheck
Jul 21 15:45:25 arch kernel: [ 30195] 1000 30195 268462800 837413 6955008 0 0 shellcheck
Ok I did some more testing and whatever is causing the issue seems to most reliably happen when you log into a file then make some change then save. After save it starts spawning and eating up memory looks like coc had an update in the beginning of July I am out of my area of knowledge on how to track an issue like this so Ill post what I find an again this could be an issue with one of these other applications.
Ok I am fairly certain this issue is being caused by vim-coc I uninstalled coc and install youCompleteMe and used there default LSP config for bash-language-server and the issue appears to have stopped again Ill keep this config for awhile and see if anything changes if so Ill let you know.
On Neovim
using the native LSP support, I have to set settings.bashIde.backgroundAnalysisMaxFiles = 1
, otherwise bashls
will continue to spawn shellcheck
instances until my workstation crashes.
Also, the single instance of shellcheck
uses close to 4GB of memory and up to 50% of CPU cycles whenever it's summoned for analysis. In other words, it severely taxes my system.
This always happens when I'm editing .bashrc/.zshrc
.
Please disregard my last comment. shellcheck
is spawned on every save regardless of that setting. So if you have autosave
on, you're very likely to run out of memory eventually at least on Neovim
. I'm not sure shellcheck
is the appropriate solution for an LSP at this point.
Has anyone fixed this issue?
Am also running into this issue, downgrading to e.g. 4.10.3 does not help