-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
SIGSEGV (address boundary error) in Mac OS when encountering Template Haskell splice #469
Comments
For a commit of the project on which |
If this is relevant, here’s the code generated by the splice:
|
Remembered that is probably a duplicate of https://github.com/haskell/ghcide/issues/775 |
It is almost identical so i would close one of both (the older one?) |
Could be related to https://github.com/haskell/ghcide/issues/854 |
This one may be fixed in master (and the incoming hls 0.5 release) via ghcide-0.5, @patrickt could you check if master fix the issue for you? |
@jneira I’m afraid not; compiling with the latest HEAD gives me
|
Oh, thanks for trying it anyways, i am afraid that th support needs more work to be reliable enough 😟 |
Some more information: here’s the DWARF backtrace (EDIT: the line numbers here don’t seem to be hugely reliable)
|
@bgamari any idea what is going on here? |
A debug print of the
|
I think it would be useful if you compiled ghcide with |
BTW, the original code snippet you linked to doesn't point to any Template Haskell anymore. |
@wz1000 Fixed the original code snippet. Building with |
@wz1000 The result of executing |
Huh, I can't reproduce this locally on linux with |
I'd like to advance the theory that this might be restricted to MacOS. My colleague is also experiencing something like this on Mac, but if I try on Linux with her exact same project, I cannot repro. I'm about to dust off my old Mac to see if there's any credibility to this idea. |
It would be helpful if someone could come up with a test case that fails on the newly added MacOS CI on |
The test case that is failing for my colleague is actually quite easy to produce:
|
The backtrace is super useful. It might be possible to repro without ghcide, if you have a ghc binary built with And if you link ghcide/HLS with |
@ProofOfKeags @wz1000 Good to hear that this doesn’t repro on Linux: given that this this is dying in the guts of relocating sections in Mach-O executables, we can assume it’s something macOS specific. |
@pepeiborra Wow, compiling with |
@patrickt @pepeiborra do you just put the -dynamic flag in hls' cabal file? or is this something that goes into the various |
@ProofOfKeags Run |
Dynamic linking fixed this for us too. So am I to understand that this issue is in GHC? |
Yes, GHC has its own dynamic linker, in the rts, and it gets used in certain cases:
Implementing a dynamic linker with support for >=3 platforms is a risky and complex exercise. Fortunately there is an easy opt-out ( As I mentioned it would be great if you can minify this bug and report it upstream in GHC. |
+1 Confirmed the |
+1. It solved an issue with Template Haskell. HLS was reporting an issue with the linux ld object, that it could not find.
Adding Now I still have useless warning waves under quasiquotes of template haskell though. |
Where did you local GHC installation come from? Is it a custom build with |
Strange, I think I really use My ghc comes from |
I’ve filed a bug upstream to inform about the dynamic linker issue. Anyone who wanted to help minimize the test case would win my infinite gratitude. |
isTesting got added to ShakeExtras unnecessarily
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
I encounter segfaults when attempting to run
haskell-language-server-wrapper
in the root of my project (or from within my editor). They only go away when I remove this Template Haskell invocation.I have tried removing the
~/.cache/ghcide
folder, ensuring there are no oldhaskell-language-server
binaries on my PATH, and adding acabal.project
to the project. This happens with versions 0.4 and 0.5. I’m using the latest release of macOS.EDIT: compiling haskell-language-server from source, passing in
--enable-executable-dynamic
toconfigure
, appears to be a successful workaround.Your environment
Which lsp-client do you use
Emacs (though this happens at the command line)
Describe your project (alternative: link to the project)
https://github.com/patrickt/possession
Steps to reproduce
Expected behaviour
Successful project compilation
Actual behaviour
Include debug information
Debug output:
The text was updated successfully, but these errors were encountered: