haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

hls consistently crashes on eval code lens

Open w4v3 opened this issue 3 years ago • 6 comments

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

w4v3 avatar Mar 03 '22 10:03 w4v3

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?

pepeiborra avatar Mar 03 '22 11:03 pepeiborra

Same issue here, running Fedora 35, GHC 8.6.5 and HLS 1.6.1 (also happens on 1.5.1). Related: #2363

emlautarom1 avatar Mar 03 '22 11:03 emlautarom1

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.

w4v3 avatar Mar 03 '22 13:03 w4v3

Any news on this one? I changed GHC versions but I still get the same issue.

emlautarom1 avatar Apr 11 '22 21:04 emlautarom1

I am also still struggling with this, see issue #2363

julmb avatar Apr 11 '22 23:04 julmb

Could you try building HLS locally, either from Hackage (works only for ghc 8.x) or HEAD, and let us know if that helps?

pepeiborra avatar Apr 12 '22 08:04 pepeiborra

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.

julmb avatar Oct 08 '22 12:10 julmb

Then let's close, optimistically :)

michaelpj avatar Oct 10 '22 14:10 michaelpj