haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.71k stars 368 forks source link

Segfault on empty YESOD project #230

Closed makarenya closed 3 years ago

makarenya commented 4 years ago

In visual studio code i got The Haskell (yolo) server crashed 5 times in the last 3 minutes. The server will not be restarted on Yesod project, just created by: stack new yolo yesodweb/sqlite In the project root command: /Users/username/Library/Application\ Support/Code/User/globalStorage/alanz.vscode-hie-server/haskell-language-server-0.2.1-darwin-8.8.3 make a lot output, ends with

> Using main module: 1. Package `yolo' component yolo:exe:yolo with main-is file: /Users/username/projects/yolo/app/main.hs
> The following GHC options are incompatible with GHCi and have not been passed to it: -O2 -threaded
> Configuring GHCi with the following packages: yolo
> /Users/username/projects/yolo/.stack-work/install/x86_64-osx/8cbbbf4c1a2cdf46e45d5d32e8b22ceac2ffa8f98c48498f8584c0b75853ef9e/8.8.3/pkgdb:/Users/username/.stack/snapshots/x86_64-osx/8cbbbf4c1a2cdf46e45d5d32e8b22ceac2ffa8f98c48498f8584c0b75853ef9e/8.8.3/pkgdb:/Users/username/.stack/programs/x86_64-osx/ghc-8.8.3/lib/ghc-8.8.3/package.conf.d
[INFO] Using interface files cache dir: /Users/username/.cache/ghcide/main-84211d3eb0b88f2b7e58a2978f8ed8651063ebf2
[INFO] Using interface files cache dir: /Users/username/.cache/ghcide/main-84211d3eb0b88f2b7e58a2978f8ed8651063ebf2
[INFO] Using interface files cache dir: /Users/username/.cache/ghcide/main-84211d3eb0b88f2b7e58a2978f8ed8651063ebf2
[INFO] Using interface files cache dir: /Users/username/.cache/ghcide/main-84211d3eb0b88f2b7e58a2978f8ed8651063ebf2
[INFO] Using interface files cache dir: /Users/username/.cache/ghcide/main-84211d3eb0b88f2b7e58a2978f8ed8651063ebf2
[INFO] Using interface files cache dir: /Users/username/.cache/ghcide/main-84211d3eb0b88f2b7e58a2978f8ed8651063ebf2
[INFO] Using interface files cache dir: /Users/username/.cache/ghcide/main-84211d3eb0b88f2b7e58a2978f8ed8651063ebf2
[INFO] Making new HscEnv[main,main,main,main,main,main,main]
[INFO] Consulting the cradle for "/Users/username/projects/yolo/test/TestImport.hs"
Output from setting up the cradle Cradle {cradleRootDir = "/Users/username/projects/yolo", cradleOptsProg = CradleAction: Stack}
File:     /Users/username/projects/yolo/test/Spec.hs
Hidden:   no
Range:    1:0-2:0
Source:   compiler
Severity: DsError
Message:  haskell-language-server-0.2.1-darwin-8.8.3: could not execute: hspec-discover
File:     /Users/username/projects/yolo/app/DevelMain.hs
Hidden:   no
Range:    9:0-35:46
Source:   parser
Severity: DsWarning
Message:
  Haddock parse error on input ‘-- $ stack ghci yolo:lib --no-load --work-dir .stack-work-devel
  --
  -- 2. Load this module
  --
  -- > :l app/DevelMain.hs
  --
  -- 3. Run @update@
  --
  -- > DevelMain.update
  --
  -- 4. Your app should now be running, you can connect at http://localhost:3000
  --
  -- 5. Make changes to your code
  --
  -- 6. After saving your changes, reload by running:
  --
  -- > :r
  -- > DevelMain.update
  --
  -- You can also call @DevelMain.shutdown@ to stop the app
  --
  -- There is more information about this approach,
  -- on the wiki: https://github.com/yesodweb/yesod/wiki/ghci
  --
  -- WARNING: GHCi does not notice changes made to your template files.
  -- If you change a template, you'll need to either exit GHCi and reload,
  -- or manually @touch@ another Haskell module.’
File:     /Users/username/projects/yolo/app/devel.hs
Hidden:   no
Range:    2:14-2:25
Source:   not found
Severity: DsError
Message:
  Could not load module ‘Application’
  It is a member of the hidden package ‘yolo-0.0.0’.
  You can run ‘:set -package yolo’ to expose it.
  (Note: this unloads all the modules in the current scope.)
> Using main module: 1. Package `yolo' component yolo:exe:yolo with main-is file: /Users/username/projects/yolo/app/main.hs
> The following GHC options are incompatible with GHCi and have not been passed to it: -O2 -threaded
> Configuring GHCi with the following packages: yolo
[1]    94537 segmentation fault

Ok, I try to use haskell-ide-engine instead of haskell-language-server with same segserv result. BUT! i insert some debug output in the haskell-ide-engine, and got something: segserv happends on this line in haskell ide engine, and i think, that in this porject is same. https://github.com/haskell/haskell-ide-engine/blob/master/hie-plugin-api/Haskell/Ide/Engine/ModuleCache.hs#L256

makarenya commented 4 years ago

You can get same repo, just typing stack new yolo yesodweb/sqlite, ghc 8.8.3 System: macOs Catalina. And it's not new bug for me, it reproduced on previous mac os on ghc 8.6.5

jneira commented 4 years ago

Hi, are you using a explicit hie.yaml? if that is the case please attach it. Otherwise try to open the project creating the explicit hie.yaml, following the readme: https://github.com/haskell/haskell-language-server#project-configuration . The ide tries to load your files without hie.yaml calling stack repl path/to/file underneath. What is the output if you executes stack repl app/devel.hs? Also there is an error about hspec not present, it is closely related with #176, and the workaround is to install the executable globally.

makarenya commented 4 years ago

Before you last message i use pretty simple hie.yaml:

cradle:
  stack

But, after reading it, i change hie.yaml to

cradle:
  stack:
    component: "haskell-language-server:lib"

And got new error:

> Error parsing targets: Unknown local package: haskell-language-server

I think, that i must do some additional installation steps to solve it... But i'm sure after fixing this issue, i will get the segfault back. Next: stack repl /app/devel.hs output:

Warning: Couldn't find a component for file target /Users/username/projects/yolo/app/devel.hs. This means that the correct ghc options might not be used.
         Attempting to load the file anyway.
Configuring GHCi with the following packages:
GHCi, version 8.8.3: https://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( /Users/username/projects/yolo/app/devel.hs, interpreted )
Ok, one module loaded.
Loaded GHCi configuration from /private/var/folders/9y/h9dg4bhn3759h7ybs9djb27j7t15nw/T/haskell-stack-ghci/aafecffd/ghci-script

And I want to reiterate that this is not an exception, but a segfault.

jneira commented 4 years ago

But i'm sure after fixing this issue, i will get the segfault back.

Yeah it is probable, still they could be related (f.e. one could cause the other). Even if the segfault is not related you will need to fix the load of the project anyways 😉 .

The hie.yaml should describe your project components (libs, exes, tests), not the haskell-language-server ones so it would look:

PS D:\dev\ws\haskell\issues\yolo> cat .\hie.yaml
cradle:
  stack:
    - path: "./src"
      component: "yolo:lib"

    - path: "./app/main.hs"
      component: "yolo:exe:yolo"

    - path: "./app/DevelMain.hs"
      component: "yolo:exe:yolo"

    - path: "./app/Paths_yolo.hs"
      component: "yolo:exe:yolo"

    - path: "./test"
      component: "yolo:test:yolo-test"

I've used the utility gen-hieto generate the hie.yaml, installed with stack install implicit-hie.

Without the hie yaml i got 13 files worked, 7 files failed (log)

With that hie.yaml, 19 files worked, 1 file failed (log). The module that fails is ./app/devel.hs.

makarenya commented 4 years ago

Thank you for support, gen-hie works fine. So, segmentation fault come back. tail of output

File:     /Users/username/projects/yolo/test/Spec.hs
Hidden:   no
Range:    1:0-2:0
Source:   cradle
Severity: DsError
Message:
  ghcide compiled by GHC 8.8 failed to load packages: <command line>: cannot satisfy -package
  hspec-2.7.1
  (use -v for more information).
  Please ensure that ghcide is compiled with the same GHC installation as the project.
[INFO] Consulting the cradle for "/Users/username/projects/yolo/app/devel.hs"
Output from setting up the cradle Cradle {cradleRootDir = "/Users/username/projects/yolo", cradleOptsProg = CradleAction: Stack}
File:     /Users/username/projects/yolo/app/devel.hs
Hidden:   no
Range:    1:0-2:0
Source:   cradle
Severity: DsError
Message:
  Multi Cradle: No prefixes matched
  pwd: /Users/username/projects/yolo
  filepath: /Users/username/projects/yolo/app/devel.hs
  prefixes:
  ("./src",Stack {component = Just "yolo:lib"})
  ("./app/main.hs",Stack {component = Just "yolo:exe:yolo"})
  ("./app/DevelMain.hs",Stack {component = Just "yolo:exe:yolo"})
  ("./app/Paths_yolo.hs",Stack {component = Just "yolo:exe:yolo"})
  ("./test",Stack {component = Just "yolo:test:yolo-test"})
[INFO] Consulting the cradle for "/Users/username/projects/yolo/test/TestImport.hs"
Output from setting up the cradle Cradle {cradleRootDir = "/Users/username/projects/yolo", cradleOptsProg = CradleAction: Stack}
> Using main module: 1. Package `yolo' component yolo:test:yolo-test with main-is file: /Users/username/projects/yolo/test/Spec.hs
> Configuring GHCi with the following packages: yolo
>
> Warning: Didn't find expected autogen file:
>          /Users/username/projects/yolo/.stack-work/dist/x86_64-osx/Cabal-3.0.1.0/build/yolo-test/autogen/cabal_macros.h
> /Users/username/projects/yolo/.stack-work/install/x86_64-osx/8cbbbf4c1a2cdf46e45d5d32e8b22ceac2ffa8f98c48498f8584c0b75853ef9e/8.8.3/pkgdb:/Users/username/.stack/snapshots/x86_64-osx/8cbbbf4c1a2cdf46e45d5d32e8b22ceac2ffa8f98c48498f8584c0b75853ef9e/8.8.3/pkgdb:/Users/username/.stack/programs/x86_64-osx/ghc-8.8.3/lib/ghc-8.8.3/package.conf.d
[INFO] Consulting the cradle for "/Users/username/projects/yolo/test/Handler/CommentSpec.hs"
File:     /Users/username/projects/yolo/test/TestImport.hs
Hidden:   no
Range:    1:0-2:0
Source:   cradle
Severity: DsError
Message:
  ghcide compiled by GHC 8.8 failed to load packages: <command line>: cannot satisfy -package
  hspec-2.7.1
  (use -v for more information).
  Please ensure that ghcide is compiled with the same GHC installation as the project.
Output from setting up the cradle Cradle {cradleRootDir = "/Users/username/projects/yolo", cradleOptsProg = CradleAction: Stack}
> Using main module: 1. Package `yolo' component yolo:test:yolo-test with main-is file: /Users/username/projects/yolo/test/Spec.hs
> Configuring GHCi with the following packages: yolo
>
> Warning: Didn't find expected autogen file:
>          /Users/username/projects/yolo/.stack-work/dist/x86_64-osx/Cabal-3.0.1.0/build/yolo-test/autogen/cabal_macros.h
> /Users/username/projects/yolo/.stack-work/install/x86_64-osx/8cbbbf4c1a2cdf46e45d5d32e8b22ceac2ffa8f98c48498f8584c0b75853ef9e/8.8.3/pkgdb:/Users/username/.stack/snapshots/x86_64-osx/8cbbbf4c1a2cdf46e45d5d32e8b22ceac2ffa8f98c48498f8584c0b75853ef9e/8.8.3/pkgdb:/Users/username/.stack/programs/x86_64-osx/ghc-8.8.3/lib/ghc-8.8.3/package.conf.d
[1]    21010 segmentation fault
jneira commented 4 years ago

Jumm, ok, when the language server crashes, could you see the same error in the hls output? please, attach that log just in case it could help. In my windows 10 i am able to load the project (screenshot to show where the output can be found):

imagen

The hie.yaml i am using now is this one:

cradle:
  multi:
    - path: "./app/devel.hs"
      config: { cradle: { none:  } }

    - path: "./"
      config:
        cradle:
          stack:
            - path: "./src"
              component: "yolo:lib"

            - path: "./app"
              component: "yolo:exe:yolo"

            - path: "./test"
              component: "yolo:test:yolo-test"
makarenya commented 4 years ago

after opening some hs file in VS code i got message The Haskell (yolo) server crashed 5 times in the last 3 minutes. The server will not be restarted. And log contains 3 repeat of:

haskell-language-server version: 0.2.1.0 (GHC: 8.8.3) (PATH: /Users/username/Library/Application Support/Code/User/globalStorage/alanz.vscode-hie-server/haskell-language-server-0.2.1-darwin-8.8.3) (GIT hash: e8812c18d2be311c6b52545a0dc2b1408f8fa4b2)
Starting (haskell-language-server)LSP server...
  with arguments: Arguments {argLSP = True, argsCwd = Nothing, argFiles = [], argsVersion = False, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = False, argsLogFile = Nothing, argsThreads = 0, argsProjectGhcVersion = False}
  with plugins: [PluginId "eval",PluginId "floskell",PluginId "ghcide",PluginId "ormolu",PluginId "pragmas",PluginId "stylish-haskell"]
  in directory: /Users/username/projects/yolo
If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!
 Started LSP server in 0.00s
2020-07-24 17:47:02.766841 [ThreadId 21] - Opened text document: file:///Users/username/projects/yolo/src/Handler/Home.hs
Data.HashMap.Base.(!): key not found
CallStack (from HasCallStack):
  error, called at ./Data/HashMap/Base.hs:733:16 in nrdrd-cntnrs-0.2.11.0-175d3514:Data.HashMap.Base
  !, called at src/Development/IDE/Import/DependencyInformation.hs:107:40 in ghcide-0.2.0-inplace:Development.IDE.Import.DependencyInformation
2020-07-24 17:47:02.768943 [ThreadId 63] - Consulting the cradle for "/Users/username/projects/yolo/src/Handler/Home.hs"
[Error - 5:47:02 PM] haskell-lsp:configuration parse error. NotificationMessage {_jsonrpc = "2.0", _method = WorkspaceDidChangeConfiguration, _params = DidChangeConfigurationParams {_settings = Object (fromList [("haskell",Object (fromList [("logFile",String ""),("hlintOn",Bool True),("formatOnImportOn",Bool True),("enable",Bool True),("indentationRules",Object (fromList [("enabled",Bool True)])),("liquidOn",Bool False),("languageServerVariant",String "haskell-language-server"),("serverExecutablePath",String ""),("diagnosticsOnChange",Bool True),("completionSnippetsOn",Bool True),("maxNumberOfProblems",Number 100.0),("formattingProvider",String "brittany"),("trace",Object (fromList [("server",String "off")]))]))])}} "key \"languageServerHaskell\" not found"
Output from setting up the cradle Cradle {cradleRootDir = "/Users/username/projects/yolo", cradleOptsProg = CradleAction: Stack}
> The following GHC options are incompatible with GHCi and have not been passed to it: -O2
> Configuring GHCi with the following packages: yolo
> /Users/username/projects/yolo/.stack-work/install/x86_64-osx/8cbbbf4c1a2cdf46e45d5d32e8b22ceac2ffa8f98c48498f8584c0b75853ef9e/8.8.3/pkgdb:/Users/username/.stack/snapshots/x86_64-osx/8cbbbf4c1a2cdf46e45d5d32e8b22ceac2ffa8f98c48498f8584c0b75853ef9e/8.8.3/pkgdb:/Users/username/.stack/programs/x86_64-osx/ghc-8.8.3/lib/ghc-8.8.3/package.conf.d
2020-07-24 17:47:06.288032 [ThreadId 63] - Using interface files cache dir: /Users/username/.cache/ghcide/main-0388985ec2f0aaccc27294fcba59c896addf1a9d
2020-07-24 17:47:06.288286 [ThreadId 63] - Making new HscEnv[main]
2020-07-24 17:47:06.322344 [ThreadId 148] - Plugin.makeCodeLens (ideLogger)
[Error - 5:47:08 PM] Connection to server got closed. Server will not be restarted.
[Error - 5:47:08 PM] Request textDocument/codeLens failed.
Error: Connection got disposed.
    at Object.dispose (/Users/username/.vscode/extensions/alanz.vscode-hie-server-0.1.1/dist/extension.js:1:90976)
    at Object.dispose (/Users/username/.vscode/extensions/alanz.vscode-hie-server-0.1.1/dist/extension.js:1:74249)
    at D.handleConnectionClosed (/Users/username/.vscode/extensions/alanz.vscode-hie-server-0.1.1/dist/extension.js:1:74423)
    at D.handleConnectionClosed (/Users/username/.vscode/extensions/alanz.vscode-hie-server-0.1.1/dist/extension.js:247:8769)
    at t (/Users/username/.vscode/extensions/alanz.vscode-hie-server-0.1.1/dist/extension.js:1:72574)
    at n.invoke (/Users/username/.vscode/extensions/alanz.vscode-hie-server-0.1.1/dist/extension.js:1:233192)
    at i.fire (/Users/username/.vscode/extensions/alanz.vscode-hie-server-0.1.1/dist/extension.js:1:233922)
    at G (/Users/username/.vscode/extensions/alanz.vscode-hie-server-0.1.1/dist/extension.js:1:82885)
    at n.invoke (/Users/username/.vscode/extensions/alanz.vscode-hie-server-0.1.1/dist/extension.js:1:233192)
    at i.fire (/Users/username/.vscode/extensions/alanz.vscode-hie-server-0.1.1/dist/extension.js:1:233922)
    at u.fireClose (/Users/username/.vscode/extensions/alanz.vscode-hie-server-0.1.1/dist/extension.js:1:252616)
    at Socket.<anonymous> (/Users/username/.vscode/extensions/alanz.vscode-hie-server-0.1.1/dist/extension.js:1:253373)
    at Socket.emit (events.js:208:15)
    at Socket.EventEmitter.emit (domain.js:476:20)
    at Pipe.<anonymous> (net.js:588:12)

And yes, it's only os x problem, i use haskell-ide-engine with vim on ubuntu without any problems. Half a year ago i find workaround: using haskell-ide-engine from nix build. I don't know why, but it work without any problems. It was good a half year ago. But all-hies project stops to update... And workaround not working for 8.8.3 and newer

jneira commented 4 years ago

And the executable was automatic downloaded by the extension so it comes from the release of this repo. Maybe @bubba can help, given the tip about the nix build you mentioned.

makarenya commented 4 years ago

Can I somehow help identify the problem? For example, I can try to localize the source of the segfault. In the case of haskell-ide-engine, I have already done this, I wrote it off earlier. And for haskell-language-server, this is one of 2 places (errors occur sometimes in one, sometimes in another) ghcide/src/Development/IDE/Session.hs:291

hPutStrLn stderr $ "Output from setting up the cradle... " <> show cradle
    cradleRes <- runCradle (cradleOptsProg cradle) showLine file -- first place
    hPutStrLn stderr $ "Cradle ready"
    case cradleRes of
        CradleSuccess r -> do
            hPutStrLn stderr $ "Cradle ready 2"
            -- Now get the GHC lib dir
            libDirRes <- getRuntimeGhcLibDir cradle -- second place
            hPutStrLn stderr $ "Cradle ready 3"
            case libDirRes of

with this debugging prints, i got one of:

[INFO] Consulting the cradle for "/Users/makarenya/projects/yolo/test/Handler/ProfileSpec.hs"
Output from setting up the cradle... Cradle {cradleRootDir = "/Users/makarenya/projects/yolo", cradleOptsProg = CradleAction: Stack}
> Using main module: 1. Package `yolo' component yolo:test:yolo-test with main-is file: /Users/makarenya/projects/yolo/test/Spec.hs
> Configuring GHCi with the following packages: yolo
>
> Warning: Didn't find expected autogen file:
>          /Users/makarenya/projects/yolo/.stack-work/dist/x86_64-osx/Cabal-3.0.1.0/build/yolo-test/autogen/cabal_macros.h
> /Users/makarenya/projects/yolo/.stack-work/install/x86_64-osx/8cbbbf4c1a2cdf46e45d5d32e8b22ceac2ffa8f98c48498f8584c0b75853ef9e/8.8.3/pkgdb:/Users/makarenya/.stack/snapshots/x86_64-osx/8cbbbf4c1a2cdf46e45d5d32e8b22ceac2ffa8f98c48498f8584c0b75853ef9e/8.8.3/pkgdb:/Users/makarenya/.stack/programs/x86_64-osx/ghc-8.8.3/lib/ghc-8.8.3/package.conf.d
Cradle ready
Cradle ready 2
Cradle ready 3
Cradle ready 4
Cradle ready 5
[INFO] Consulting the cradle for "/Users/makarenya/projects/yolo/test/Spec.hs"
Output from setting up the cradle... Cradle {cradleRootDir = "/Users/makarenya/projects/yolo", cradleOptsProg = CradleAction: Stack}
> Using main module: 1. Package `yolo' component yolo:test:yolo-test with main-is file: /Users/makarenya/projects/yolo/test/Spec.hs
> Configuring GHCi with the following packages: yolo
>
> Warning: Didn't find expected autogen file:
>          /Users/makarenya/projects/yolo/.stack-work/dist/x86_64-osx/Cabal-3.0.1.0/build/yolo-test/autogen/cabal_macros.h
> /Users/makarenya/projects/yolo/.stack-work/install/x86_64-osx/8cbbbf4c1a2cdf46e45d5d32e8b22ceac2ffa8f98c48498f8584c0b75853ef9e/8.8.3/pkgdb:/Users/makarenya/.stack/snapshots/x86_64-osx/8cbbbf4c1a2cdf46e45d5d32e8b22ceac2ffa8f98c48498f8584c0b75853ef9e/8.8.3/pkgdb:/Users/makarenya/.stack/programs/x86_64-osx/ghc-8.8.3/lib/ghc-8.8.3/package.conf.d
Cradle ready
Cradle ready 2
[1]    75804 segmentation fault  haskell-language-server

or

[INFO] Consulting the cradle for "/Users/makarenya/projects/yolo/app/devel.hs"
Output from setting up the cradle... Cradle {cradleRootDir = "/Users/makarenya/projects/yolo", cradleOptsProg = CradleAction: Stack}
Cradle ready
[INFO] Consulting the cradle for "/Users/makarenya/projects/yolo/test/Handler/ProfileSpec.hs"
Output from setting up the cradle... Cradle {cradleRootDir = "/Users/makarenya/projects/yolo", cradleOptsProg = CradleAction: Stack}
File:     /Users/makarenya/projects/yolo/app/DevelMain.hs
Hidden:   no
Range:    9:0-35:46
Source:   parser
Severity: DsWarning
Message:
  Haddock parse error on input ‘-- $ stack ghci yolo:lib --no-load --work-dir .stack-work-devel
  --
  -- 2. Load this module
  --
  -- > :l app/DevelMain.hs
  --
  -- 3. Run @update@
  --
  -- > DevelMain.update
  --
  -- 4. Your app should now be running, you can connect at http://localhost:3000
  --
  -- 5. Make changes to your code
  --
  -- 6. After saving your changes, reload by running:
  --
  -- > :r
  -- > DevelMain.update
  --
  -- You can also call @DevelMain.shutdown@ to stop the app
  --
  -- There is more information about this approach,
  -- on the wiki: https://github.com/yesodweb/yesod/wiki/ghci
  --
  -- WARNING: GHCi does not notice changes made to your template files.
  -- If you change a template, you'll need to either exit GHCi and reload,
  -- or manually @touch@ another Haskell module.’
> Using main module: 1. Package `yolo' component yolo:test:yolo-test with main-is file: /Users/makarenya/projects/yolo/test/Spec.hs
> Configuring GHCi with the following packages: yolo
>
> Warning: Didn't find expected autogen file:
>          /Users/makarenya/projects/yolo/.stack-work/dist/x86_64-osx/Cabal-3.0.1.0/build/yolo-test/autogen/cabal_macros.h
[1]    75511 segmentation fault  haskell-language-server
MaxGabriel commented 4 years ago

You can get same repo, just typing stack new yolo yesodweb/sqlite, ghc 8.8.3 System: macOs Catalina. And it's not new bug for me, it reproduced on previous mac os on ghc 8.6.5

One thing to note is that stack new won't necessarily give the same results over time:

  1. The underlying template may change
  2. stack new will choose a Stackage version for you, that also might change over time

So, probably best to create a new Github repo with the exact configuration you have to help people reproduce

lukel97 commented 4 years ago

Just double checked here, this happens on HLS built from source as well, not just with the static binaries

navilan commented 4 years ago

@bubba - I got the same thing with both hls and ghcide. In my case, I was using the path library and the mkAbsFile family of template haskell functions. Once I removed those, segmentation fault disappears in both applications. I suspect that #230 and #277 are duplicates.

makarenya commented 4 years ago

Hi. Sorry for the long delay. My repo: https://github.com/makarenya/yolo Over the past time, I managed:

makarenya commented 4 years ago

UP. I tried to reproduce error on MacBook Pro (Late 2013) with macOS Catalina. And it reproduced. So. macOS Catalina. and only it.

navilan commented 4 years ago

I'm on Mojave - so I guess whatever the issue is, it got fixed on high sierra it got created in mojave :)

makarenya commented 4 years ago

Catalina is the latest version of macOS. Fixed in High Sierra but reproducible on Catalina? Strange ...

navilan commented 4 years ago

Yeah, I got my Mac OS X version chronology wrong :)

vikrem commented 4 years ago

Also running into this, using MacOS 10.14.6 (Mojave). Are there any recent updates on this?

sordina commented 3 years ago

+1

Fails on version 0.5 and 0.6 and master of haskell-language-server. OSX Darwin difference.local 18.7.0 Darwin Kernel Version 18.7.0: Mon Aug 31 20:53:32 PDT 2020; root:xnu-4903.278.44~1/RELEASE_X86_64 x86_64. Specific project only, works on others.

pepeiborra commented 3 years ago

Likely duplicate of #469 which is a bug upstream in GHC. There are more details in that issue, including a workaround.

dcastro commented 3 years ago

Since everyone else having this problem seems to be on macOS, I'm just leaving a comment to say I've also had this problem on Ubuntu 20.04.3 LTS.

As pointed out in other issues, running cabal configure --enable-executable-dynamic and compiling from source fixed the issue for me.