haskell-language-server
haskell-language-server copied to clipboard
hls consistently crashes on eval code lens
Your environment
OS: arch linux 5.16.10 LSP client: neovim nightly built-in LSP client HLS version: from package haskell-language-server-static 1.6.1.0-1 at the AUR GHC version: 9.0.2
Steps to reproduce
Create a file with the following contents:
-- >>> 3 + 5
Evaluate the code lens from the eval plugin.
Expected behaviour
A new line should be inserted with the result:
-- >>> 3 + 5
-- 8
Actual behaviour
HLS crashes. Until a few weeks ago, the eval plugin worked flawlessly. Now HLS basically always crashes when executing an eval code lens, with some rare exceptions. However, the action is always completed normally if the expression raises an exception:
-- >>> show (+)
-- No instance for (Show (Integer -> Integer -> Integer))
-- arising from a use of ‘show’
Include debug information
After triggering the code lens:
2022-03-03 11:45:51.500641495 [ThreadId 170] INFO hls: finish: codeLens.GhcSession (took 0.00s)
2022-03-03 11:45:51.50063769 [ThreadId 168] INFO hls: finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2022-03-03 11:45:51.500743127 [ThreadId 167] INFO hls: finish: eval.GetParsedModuleWithComments (took 0.00s)
2022-03-03 11:45:51.500831964 [ThreadId 169] INFO hls: finish: ModuleName.GetParsedModule (took 0.00s)
2022-03-03 11:45:51.500847129 [ThreadId 171] INFO hls: finish: (took 0.00s)
2022-03-03 11:45:51.50094092 [ThreadId 178] INFO hls: finish: codeLens.TypeCheck (took 0.00s)
2022-03-03 11:45:51.501295017 [ThreadId 182] INFO hls: finish: codeLens.GetBindings (took 0.00s)
2022-03-03 11:45:51.501339683 [ThreadId 180] INFO hls: finish: Wingman.codeLensProvider.GetAnnotatedParsedSource (took 0.00s)
2022-03-03 11:45:51.50151244 [ThreadId 177] INFO hls: finish: RefineImports (took 0.00s)
2022-03-03 11:45:51.501542606 [ThreadId 191] INFO hls: finish: codeLens.GetGlobalBindingTypeSigs (took 0.00s)
2022-03-03 11:45:51.501607892 [ThreadId 196] INFO hls: finish: Wingman.codeLensProvider.GetBindings (took 0.00s)
2022-03-03 11:45:51.502004945 [ThreadId 198] INFO hls: finish: Wingman.emptyCaseScrutinees.TypeCheck (took 0.00s)
2022-03-03 11:45:51.502176917 [ThreadId 199] INFO hls: finish: Wingman.emptyCaseScrutinees.False (took 0.00s)
2022-03-03 11:45:51.985303435 [ThreadId 219] INFO hls: finish: eval (took 0.00s)
2022-03-03 11:45:51.985334051 [ThreadId 264] INFO hls: finish: runEvalCmd.getModSummary (took 0.00s)
haskell-language-server-wrapper: callProcess: /usr/bin/haskell-language-server-9.0.2 "--lsp" (exit -11): failed
HLS crashes. Until a few weeks ago, the eval plugin worked flawlessly. Now HLS basically always crashes when executing an eval code lens, with some rare exceptions. However, the action is always completed normally if the expression raises an exception:
Any idea of what has changed in the last few weeks?
Same issue here, running Fedora 35, GHC 8.6.5 and HLS 1.6.1 (also happens on 1.5.1). Related: #2363
HLS crashes. Until a few weeks ago, the eval plugin worked flawlessly. Now HLS basically always crashes when executing an eval code lens, with some rare exceptions. However, the action is always completed normally if the expression raises an exception:
Any idea of what has changed in the last few weeks?
Not really. It might have stopped working after a GHC update, but I only updated HLS after the code lenses stopped working.
Any news on this one? I changed GHC versions but I still get the same issue.
I am also still struggling with this, see issue #2363
Could you try building HLS locally, either from Hackage (works only for ghc 8.x) or HEAD, and let us know if that helps?
Sorry for never following up on this. The behaviour simply disappeared one day, even though I did not make any changes to my system (no OS updates, no ghcup updates, no cabal updates). So I can unfortunately no longer reproduce this.
Then let's close, optimistically :)