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

HLS dies when navigating its own codebase via GoToDefinition

Open Aster89 opened this issue 3 months ago • 2 comments

Your environment

Which OS do you use? Up-to-date ArchLinux

Which version of GHC do you use and how did you install it? GHC 9.10.1 installed via ghcup

How is your project built (alternative: link to the project)? The project is HLS itself

Which LSP client (editor/plugin) do you use? (terminal) Vim + YCM

Which version of HLS do you use and how did you install it? I've pointed my IDE at 91d2b4897, which I've built via cabal build exe:haskell-language-server -j8

Have you configured HLS in any way (especially: a hie.yaml file)? Not that I know of.

Steps to reproduce

  1. Open here: https://github.com/haskell/haskell-language-server/blob/91d2b4897d792aa9eca53bdee1220a353362a57c/plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Handlers.hs#L202
  2. Try GoToDefinition
    1. on EvalParams
      • succeeds
    2. on IdeState
      • RuntimeError: Cannot jump to location
    3. on CommandFunction
      • RuntimeError: Cannot jump to location
  3. manually open here: https://github.com/haskell/haskell-language-server/blob/91d2b4897d792aa9eca53bdee1220a353362a57c/ghcide/src/Development/IDE/Core/Shake.hs#L559
  4. try GoToDefinition on IdeState value constructor
    • ResponseAbortedException: Response Aborted
  5. Asking the IDE for info reveals that
    --   haskell-language-serverCompleter not running
    -- ...                                 
    --   haskell-language-serverCompleter Server State: Dead
    
  6. Repeat step 2.1 above
    • RuntimeError: Server is initializing. Please wait.

The whole screencast is available below, but from time 2:00 onwards you can disregard it because it's just me saving the log files.

asciicast

Expected behaviour

GoTos should work.

Actual behaviour

Server dies?

Debug information

YCM log: https://gist.github.com/Aster89/e88f8c993afd6ec5d5321951329a6fec ycmd stderr: https://www.dropbox.com/scl/fi/puxmqzlrki3z4l1ucy48j/ycmd_44423_stderr_n9199p2p.log?rlkey=ntwifjlbfj2o1hjduek7je4g4&st=rzo57n1t&dl=0 HLS log: https://gist.github.com/Aster89/a375d5164546d17153aae8e5c99cae77

Aster89 avatar Sep 26 '25 10:09 Aster89

Thank you for the bug report!

Perhaps this is the same issue as https://github.com/haskell/haskell-language-server/issues/4674? I don't think we know yet why this is happening.

fendor avatar Sep 29 '25 11:09 fendor

Thank you for the bug report!

Perhaps this is the same issue as #4674? I don't think we know yet why this is happening.

Seems likely:

haskell-language-server: internal error: ARR_WORDS object (0x421b7f7838) entered!
    (GHC version 9.10.1 for x86_64_unknown_linux)
    Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

As a workaround, I am currently building HLS on 9.8.4 and have not had a problem

sgillespie avatar Sep 29 '25 12:09 sgillespie