-
-
Notifications
You must be signed in to change notification settings - Fork 389
Crash Loop in VSCode Extension using Template Haskell #1297
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
Comments
@FinleyMcIlwaine What do you mean exactly by a "large TH splice"? Are you saying this only reproduces when loading the project into VSCode but not when running on the command line? |
Could you also try on a commit before 0403dbf |
I tried your repro, and I cannot |
Apologies for being unclear. I mean when quoting larger, more complex functions, I have had the Logs from running `haskell-language-server --debug` on that project
Both that project and the one I linked to in the original comment build for me with I will give a try with an earlier commit right now! Thanks again for the help with this! |
When I tried (And it looks like their repo indeed deleted |
@Ailrun Whoops, sorry about that. Had a different local copy of that git dependency. That should be fixed in the latest commit on my repo. |
Just tried commit 6f105bd and it's doing the same. Server logs
Debug logs
I'll try going back farther. This is a pretty recent issue, I used HLS on these projects with no issues for a long time before this. |
I've determined that this problem started happening in release 0.6.0 of HLS. Releases up to that version are working for me. The release notes for 0.6.0 do mention an update to ghcide. I haven't yet dug much further to figure out exactly which changes introduced this issue, happy to try some things out if anyone has ideas! |
OK, I'm not able to reproduce it on Emacs with the latest commit of HLS. Could you check other editors than VSCode? |
@wz1000 I'm on macOS 11.2. Trying out neovim right now, will report back. |
@wz1000 If it hasn't ever fixed, then I think it's either editor-specific or OS-specific. At least I cannot reproduce it with Emacs in Manjaro |
Can it be reproduced from the command line using |
@wz1000 Just tried that on this file and got a segfault with hls 0.9.0. Output below. Output
|
@Ailrun I'm no good at retrieving output from the language server in vim, but it entered another crash loop and then failed. |
It does not crash for the command too. Maybe MacOS specific? |
Could be! Tried some different versions in vim and again it starts crashing sometime between 0.5.1 and 0.6.0. |
I also have this issue on macOS for VSCodium when I have Template Haskell in my project (from the lens or optics libraries). |
Having the same issue on Ubuntu WSL. When I comment out the template haskell code, hls runs normally.
|
I tried this with GHC 8.8.4, 8.10.2 and 8.10.4. The output for the other 2 versions was almost identical, just the second to last line was missing. |
I'm not familiar with HLS internals but I would love to help fix this issue if a lack of volunteers is the problem because it is a daily annoyance to have to choose between Template Haskell and a nice IDE experience. |
@andreasewering It's a segfault problem, so probably unrelated to this; maybe to do with #800? |
Comment from #1342 tham might be useful:
|
@brightly-salty that would be really awesome; sadly i have not the required knowledge of hls+ghc to tacke this neither. Maybe an issue in the ghc issue tracker could help 🤔 |
Having this problem as well, where it reports crashing 5 times in 3 minutes. Big Sur (11.04) |
I was having the error |
I encountered the very same problem with |
I get the same problem with HLS crashes when opening this project in VSCode: I'm running the vscode extension with default settings. The project i being built using stack (and the built application runs just fine). Operating system is Linux Mint 19.1 Cinnamon. Would love to help doing som diagnostics but pretty new to the whole Haskell ecosystem so I will need some direction. |
@konnik and the rest of reporters i wonder if the workaround of using a hls version dinamically linked could help here too, see |
I am gonna close this issue as all compiler crashes seems to have the same root cause:
If any of you think the issue should not be included generically feel free to reopen it (with a brief explanation if possible) |
I've recently started encountering something that looks like #800 using the VSCode extension. However, I was told in that thread that this issue does not seem related and that I should make another ticket.
I've attempted to create a minimum reproduction of this issue at the project linked here: https://github.com/FinleyMcIlwaine/hls-issue
That project uses some third party libraries to compile Haskell code to an alternative target using GHC plugins. The compilation function accepts a typed template haskell expression. If you comment out the
addCompiled
function, the project loads successfully. If you uncomment it, the server connection closes.Similarly to what is mentioned in #800, running the HLS in debug mode only results in a segmentation fault if I use large TH splices. For the example project here, it doesn't segfault because it's splicing a simple add function. The HLS plugin in VSCode still crash-loops with the project, however. I've included all of my logs and such below and am happy to provide any more necessary info.
Thank you all for all of the work you do!
Your environment
Output of
haskell-language-server --probe-tools
orhaskell-language-server-wrapper --probe-tools
:haskell-language-server version: 0.9.0.0 (GHC: 8.10.2) (PATH: /Users/finley/Library/Application Support/Code/User/globalStorage/haskell.haskell/haskell-language-server-0.9.0-darwin-8.10.2) (GIT hash: 46d2a3dc7ef49ba57b2706022af1801149ab3f2b) Tool versions found on the $PATH cabal: 3.2.0.0 stack: 2.5.1 ghc: 8.10.2
Which lsp-client do you use: VSCode
Describe your project (alternative: link to the project): https://github.com/FinleyMcIlwaine/hls-issue is a minimum reproduction of this issue.
Contents of
hie.yaml
:Steps to reproduce
Open the project linked above with the Haskell extension enabled in VSCode.
Expected behaviour
I would expect the project to load correctly and get all of the nice IDE features of HLS.
Actual behaviour
As soon as the plugin resolves the dependencies and starts loading in the source files, it crashes saying the connection to the server got closed and then attempts to reinitialize the project.
Include debug information
Execute in the root of your project the command
haskell-language-server --debug .
and paste the logs here:Debug output:
Paste the logs from the lsp-client, e.g. for VS Code
Server logs
The text was updated successfully, but these errors were encountered: