Skip to content
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

hls consistently crashes on eval code lens #2747

Closed
w4v3 opened this issue Mar 3, 2022 · 8 comments
Closed

hls consistently crashes on eval code lens #2747

w4v3 opened this issue Mar 3, 2022 · 8 comments
Labels
component: hls-eval-plugin status: needs info Not actionable, because there's missing information type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@w4v3
Copy link

w4v3 commented Mar 3, 2022

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 w4v3 added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Mar 3, 2022
@pepeiborra
Copy link
Collaborator

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?

@emlautarom1
Copy link

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

@w4v3
Copy link
Author

w4v3 commented Mar 3, 2022

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.

@emlautarom1
Copy link

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

@julmb
Copy link

julmb commented Apr 11, 2022

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

@pepeiborra
Copy link
Collaborator

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

@kokobd kokobd added status: needs info Not actionable, because there's missing information component: hls-eval-plugin and removed status: needs triage labels Sep 7, 2022
@julmb
Copy link

julmb commented Oct 8, 2022

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.

@michaelpj
Copy link
Collaborator

Then let's close, optimistically :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: hls-eval-plugin status: needs info Not actionable, because there's missing information type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

6 participants