-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
assertion failure from hls and ghc 8.10: `freesize < size' failed #429
Comments
Hi, i cant reproduce in windows and ghc-8.10.1, following the git+cabal steps.
But i dont get |
I can reproduce this from a fresh copy of the example by copy and pasting the git steps I gave above. Probably something different about my system. I'm running Ubuntu, and the docker container is based on Debian, so its pretty similar to my real environment and quite different than your Windows one. If you delete the "{-# OPTIONS_GHC -fplugin SomePlugin #-}" from app/Main.hs, and try "haskell-language-server-wrapper" again, does the "[INFO] finish: User TypeCheck (took 0.59s)" show up? Sorry, I was hoping this would be easier to reproduce. If it doesn't show up for other people it might not be worth your time to investigate. |
No worries, others can try it in linux or macos to confirm it.
Nop, i got the same output as without it (last line is |
For what it's worth, if I run the docker container in the original issue on my system (Arch Linux), it downloads HLS 0.5.1; I do get the I ran into this issue on a larger project; on https://github.com/AccelerateHS/accelerate, branch |
I just got this issue on my work codebase:
|
I have a minimal reproducible example (without any GHC plugins, only Run
and then run the pre-built binaries for 0.8.0 (I use GHC 8.10.3)
If I build 0.8.0 from source locally, everything works fine:
tool probe (prebuilt binaries)
tool probe (built from source)
|
amesgen's example works for me too. Assertion failure with haskell-language-server-8.10.3, 0.8.0 from ghcup, no failure with a local build of 0.8.0. It's the same with my own project (on ghc 8.10.2), the one that prompted me to open this ticket in the first place. The released haskell-language-8.10.2, 0.8.0 from ghcup has the assertion failure, and a local build does not. My local builds were created off the 0.8.0 tag:
That assertion failure is coming from glibc afaict. Here are my logs from trying amesgen's example. Release build (assertion failure):peter@gtower:~/stuff$ haskell-language-server-8.10.3 haskell-language-server version: 0.8.0.0 (GHC: 8.10.3) (PATH: /home/peter/.ghcup/bin/haskell-language-server-8.10.3~0.8.0) (GIT hash: eb58f13f7b8e4f9bc771af30ff9fd82dc4309ff5) (haskell-language-server)Ghcide setup tester in /home/peter/stuff. Report bugs at https://github.com/haskell/haskell-language-server/issues Local build (works):peter@gtower:~/stuff$ /home/peter/haskell-language-server/.stack-work/install/x86_64-linux-tinfo6/e4e793ae54282cfab5fadd3dd590c27a6b9923a017fc9eee82e8fdc0fd390547/8.10.3/bin/haskell-language-server haskell-language-server version: 0.8.0.0 (GHC: 8.10.3) (PATH: /home/peter/haskell-language-server/.stack-work/install/x86_64-linux-tinfo6/e4e793ae54282cfab5fadd3dd590c27a6b9923a017fc9eee82e8fdc0fd390547/8.10.3/bin/haskell-language-server) (GIT hash: eb58f13f7b8e4f9bc771af30ff9fd82dc4309ff5) (haskell-language-server)Ghcide setup tester in /home/peter/stuff. Report bugs at https://github.com/haskell/haskell-language-server/issues Incidentally: the way you make these nice foldable detail sections is like this: "(details) (summary) blah blah (/summary) (pre) blah blah (/pre) (/details)", except with angle brackets not parenthesis. It's html not markdown I think. Maybe that's obvious to other people but it took me a few tries. |
Maybe statically linking glibc (which is not really well supported: src) is the issue. Also, there are linker warnings (src):
I built haskell-language-server 0.8.0 ghc 8.10.3 with musl here, but it fails with
due to 39ce701, but it also happens if I disable it (use this build), as it is probably also loaded later either way. |
I didn't try the reproducing examples above, but for me a local build of HLS (current master, 16aee6e, ghc 8.8.4) works on https://github.com/AccelerateHS/accelerate whereas the version from ghcup does not, with the familiar allocatestack error. Sorry for spamming; perhaps if more people try the "local build" workaround and it works for them, upvote this message. |
Yeah I can confirm that part too. Building locally produces a good binary, but building locally with --enable-executable-static produces a binary that segfaults. buildpeter@gtower:~/haskell-language-server$ cabal build exe:haskell-language-server --enable-executable-static Build profile: -w ghc-8.10.3 -O1 In order, the following will be built (use -v for more details): - hie-compat-0.1.0.0 (lib) (configuration changed) - hls-plugin-api-0.6.0.0 (lib) (configuration changed) - ghcide-0.7.0.0 (lib) (configuration changed) - hls-tactics-plugin-0.5.1.0 (lib) (configuration changed) - hls-retrie-plugin-0.1.0.0 (lib) (configuration changed) - hls-hlint-plugin-0.1.0.0 (lib) (configuration changed) - hls-explicit-imports-plugin-0.1.0.0 (lib) (configuration changed) - hls-eval-plugin-0.1.0.0 (lib) (configuration changed) - hls-class-plugin-0.1.0.0 (lib) (configuration changed) - haskell-language-server-0.8.0.0 (lib) (configuration changed) - haskell-language-server-0.8.0.0 (exe:haskell-language-server) (configuration changed) Configuring library for hie-compat-0.1.0.0.. Configuring library for hls-plugin-api-0.6.0.0.. Preprocessing library for hie-compat-0.1.0.0.. Building library for hie-compat-0.1.0.0.. Preprocessing library for hls-plugin-api-0.6.0.0.. Building library for hls-plugin-api-0.6.0.0.. Configuring library for ghcide-0.7.0.0.. Preprocessing library for ghcide-0.7.0.0.. Building library for ghcide-0.7.0.0.. Configuring library for hls-tactics-plugin-0.5.1.0.. Configuring library for hls-hlint-plugin-0.1.0.0.. Configuring library for hls-retrie-plugin-0.1.0.0.. Configuring library for hls-explicit-imports-plugin-0.1.0.0.. Preprocessing library for hls-hlint-plugin-0.1.0.0.. Building library for hls-hlint-plugin-0.1.0.0.. Preprocessing library for hls-explicit-imports-plugin-0.1.0.0.. Building library for hls-explicit-imports-plugin-0.1.0.0.. Preprocessing library for hls-retrie-plugin-0.1.0.0.. Building library for hls-retrie-plugin-0.1.0.0.. Preprocessing library for hls-tactics-plugin-0.5.1.0.. Building library for hls-tactics-plugin-0.5.1.0.. Configuring library for hls-eval-plugin-0.1.0.0.. Configuring library for hls-class-plugin-0.1.0.0.. Configuring library for haskell-language-server-0.8.0.0.. Preprocessing library for hls-eval-plugin-0.1.0.0.. Building library for hls-eval-plugin-0.1.0.0.. Preprocessing library for hls-class-plugin-0.1.0.0.. Building library for hls-class-plugin-0.1.0.0.. Preprocessing library for haskell-language-server-0.8.0.0.. Building library for haskell-language-server-0.8.0.0.. Configuring executable 'haskell-language-server' for haskell-language-server-0.8.0.0.. Warning: The package has an extraneous version range for a dependency on an internal library: haskell-language-server -any && ==0.8.0.0, haskell-language-server -any && ==0.8.0.0. This version range includes the current package but isn't needed as the current package's library will always be used. Preprocessing executable 'haskell-language-server' for haskell-language-server-0.8.0.0.. Building executable 'haskell-language-server' for haskell-language-server-0.8.0.0.. Linking /home/peter/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-8.10.3/haskell-language-server-0.8.0.0/x/haskell-language-server/build/haskell-language-server/haskell-language-server ... /home/peter/.ghcup/ghc/8.10.3/lib/ghc-8.10.3/process-1.6.9.0/libHSprocess-1.6.9.0.a(runProcess.o):runProcess.c:function runInteractiveProcess: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /home/peter/.ghcup/ghc/8.10.3/lib/ghc-8.10.3/process-1.6.9.0/libHSprocess-1.6.9.0.a(runProcess.o):runProcess.c:function runInteractiveProcess: warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /home/peter/.ghcup/ghc/8.10.3/lib/ghc-8.10.3/unix-2.7.2.2/libHSunix-2.7.2.2.a(User.o):ghc_2.c:function ghczuwrapperZC0ZCunixzm2zi7zi2zi2ZCSystemziPosixziUserZCendpwent: warning: Using 'endpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /home/peter/.ghcup/ghc/8.10.3/lib/ghc-8.10.3/unix-2.7.2.2/libHSunix-2.7.2.2.a(User.o):ghc_2.c:function ghczuwrapperZC1ZCunixzm2zi7zi2zi2ZCSystemziPosixziUserZCsetpwent: warning: Using 'setpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /home/peter/.ghcup/ghc/8.10.3/lib/ghc-8.10.3/unix-2.7.2.2/libHSunix-2.7.2.2.a(User.o):ghc_2.c:function ghczuwrapperZC2ZCunixzm2zi7zi2zi2ZCSystemziPosixziUserZCgetpwent: warning: Using 'getpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /home/peter/.ghcup/ghc/8.10.3/lib/ghc-8.10.3/unix-2.7.2.2/libHSunix-2.7.2.2.a(User.o):ghc_2.c:function ghczuwrapperZC3ZCunixzm2zi7zi2zi2ZCSystemziPosixziUserZCgetpwnamzur: warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /home/peter/.ghcup/ghc/8.10.3/lib/ghc-8.10.3/unix-2.7.2.2/libHSunix-2.7.2.2.a(User.o):ghc_2.c:function ghczuwrapperZC4ZCunixzm2zi7zi2zi2ZCSystemziPosixziUserZCgetpwuidzur: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /home/peter/.ghcup/ghc/8.10.3/lib/ghc-8.10.3/unix-2.7.2.2/libHSunix-2.7.2.2.a(User.o):ghc_2.c:function ghczuwrapperZC5ZCunixzm2zi7zi2zi2ZCSystemziPosixziUserZCgetgrnamzur: warning: Using 'getgrnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /home/peter/.ghcup/ghc/8.10.3/lib/ghc-8.10.3/unix-2.7.2.2/libHSunix-2.7.2.2.a(User.o):ghc_2.c:function ghczuwrapperZC6ZCunixzm2zi7zi2zi2ZCSystemziPosixziUserZCgetgrgidzur: warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking logpeter@gtower:~/stuff$ /home/peter/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-8.10.3/haskell-language-server-0.8.0.0/x/haskell-language-server/build/haskell-language-server/haskell-language-server haskell-language-server version: 0.8.0.0 (GHC: 8.10.3) (PATH: /home/peter/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-8.10.3/haskell-language-server-0.8.0.0/x/haskell-language-server/build/haskell-language-server/haskell-language-server) (GIT hash: eb58f13f7b8e4f9bc771af30ff9fd82dc4309ff5) (haskell-language-server)Ghcide setup tester in /home/peter/stuff. Report bugs at https://github.com/haskell/haskell-language-server/issues |
Getting the same error when opening the I'm also getting GHC panics, although I'm not sure if that's related to the HLS issue. |
afaiu building from source seems to workaround the issue, correct me if that is not the case |
@jneira Yes, it works just fine after building from source, thanks everyone. This is probably worth opening an issue on the |
@dreamsmasher ghcup just uses the pre-built static binaries from the releases page, see here. Also to reiterate what @peterwicksstringfield said: Locally building only fixes the issue if one does not use |
Not very helpful ... gdb traceback... [INFO] finish: User TypeCheck (took 0.55s) |
The error has emerged in #1639 and compile hls from source fixed it, afaik there is no compiler plugin related but template haskell |
Another issue produced by ghc linker and workarounded building dinamycally hls from source |
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) |
Subject of the issue
When I try to use haskell language server 0.4.0 on my project, which uses GHC 8.10.2 and a typechecker plugin, I get an error message:
and the language server does not load.
Here is a simple test-project, consisting of a cabal file, an hie.yaml, and two source files, one of which defines a (stubbed out) typechecker plugin, and the other of which invokes the plugin. The -fobject-code flag is set in the cabal file.
src/SomePlugin.hs:
app/Main.hs:
https://github.com/peterwicksstringfield/hls-assertion-failure-example
If you have git and docker, you should be able to replicate the error like this:
If you don't have docker, but you do have git, ghc-8.10.2, and cabal, then this should work too:
Maybe I'm doing something wrong, but even if I am, I don't think I should be seeing raw assertion failures?
When i delete the "{-# OPTIONS_GHC -fplugin SomePlugin #-}" line, there are no errors and hls is able to load.
Also, the code itself works fine. Inside the container:
Your environment
Inside the container:
The lsp-client is irrelevant, but I use emacs.
component.cabal:
No stack.yaml or package.yaml. Cabal only.
hie.yaml:
Include debug information
I deleted the details tags because they seemed to be breaking the formatting for the code tags. (???).
The text was updated successfully, but these errors were encountered: