Skip to content

Eval codelens crashes hls if eval calls into c-code that triggers an assertion #2330

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

Open
mfussenegger opened this issue Nov 5, 2021 · 0 comments
Labels
component: hls-eval-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@mfussenegger
Copy link

mfussenegger commented Nov 5, 2021

Your environment

Output of haskell-language-server --probe-tools or haskell-language-server-wrapper --probe-tools:

haskell-language-server version: 1.4.0.0 (GHC: 9.0.1) (PATH: $HOME/.local/bin/haskell-language-server-wrapper) (GIT hash: a0cd84b4f6c6e48eb56e135faf5f9b1e3139886c)
Tool versions found on the $PATH
cabal:		3.2.0.0
stack:		2.7.3
ghc:		9.0.1

Which OS do you use:

Linux

Which lsp-client do you use:

Neovim

Describe your project (alternative: link to the project):

Contents of stack.yaml:

resolver: lts-17.9

packages:
  - .

extra-deps:
  - tree-sitter-0.9.0.2@sha256:a8e9821575a1bf90455cc164619f5a59f6cc01d66a870944ece84a755b6450d9

No hie.yaml

.cabal contents:

executable myexecutable
  hs-source-dirs:      src
  main-is:             Main.hs
  default-language:    Haskell2010
  build-depends:       base >= 4.7 && < 5
                     , tree-sitter

Steps to reproduce

Execute the eval code-lens on parse "bar":

import qualified TreeSitter.Parser as TS
import qualified TreeSitter.Tree as TS


-- Do something
--
-- >>> parse "bar"
parse content = do
  parser <- TS.ts_parser_new
  TS.withParseTree parser content processTree
  where
    processTree tree = TS.withRootNode tree processNode
    processNode node = pure ()

Expected behaviour

Some error indication or something like that

Actual behaviour

hls crashes. Last lines from the LSP log:

ERROR][2021-11-05 16:32:33] .../vim/lsp/rpc.lua:412	"rpc"	"haskell-language-server-wrapper"	"stderr"	"2021-11-05 16:32:33.378549034 [ThreadId 722] INFO hls:\tfinish: eval (took 0.00s)\n"
[ERROR][2021-11-05 16:32:33] .../vim/lsp/rpc.lua:412	"rpc"	"haskell-language-server-wrapper"	"stderr"	"2021-11-05 16:32:33.378659895 [ThreadId 725] INFO hls:\tfinish: runEvalCmd.getModSummary (took 0.00s)\n"
[ERROR][2021-11-05 16:32:34] .../vim/lsp/rpc.lua:412	"rpc"	"haskell-language-server-wrapper"	"stderr"	"haskell-language-server-8.10.4: src/bridge.c:44: ts_tree_root_node_p: Assertion `tree != NULL' failed.\n"

Include debug information

Probably not relevant(?)


Maybe related to #461 ?

@jneira jneira added component: hls-eval-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: hls-eval-plugin 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

2 participants