Skip to content

Segfault non-deterministically on Big Sur (M1/Aarch64) #1761

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

Closed
jakzale opened this issue Apr 19, 2021 · 2 comments
Closed

Segfault non-deterministically on Big Sur (M1/Aarch64) #1761

jakzale opened this issue Apr 19, 2021 · 2 comments
Labels
os: macos type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@jakzale
Copy link

jakzale commented Apr 19, 2021

Not sure if this is a single bug, or 5 different ones, but I noticed that HLS seems to segfault at 5 various distinct points in a project.

Your environment

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

haskell-language-server version: 1.1.0.0 (GHC: 8.10.2.20201118) (PATH: /nix/store/1l6ajln74mljnqsv91mjwvp7s4mfi3pp-haskell-language-server-exe-haskell-language-server-1.1.0.0/bin/haskell-language-server)
Tool versions found on the $PATH
cabal:		3.4.0.0
stack:		2.5.1.1
ghc:		8.10.2.20201118

Which OS do you use:

macOS Big Sur 11.2.3 (M1/Aarch64).

Which lsp-client do you use:

N/A

Describe your project (alternative: link to the project):
plutus-core

Contents of hie.yaml:

N/A (implicit hie)

Steps to reproduce

The issue seems to isolated to either macOS 11 or M1:

  1. git clone https://github.com/input-output-hk/plutus
  2. cd plutus/plutus-core
  3. nix-shell ../shell.nix
  4. haskell-language-server --debug

Expected behaviour

Typecheck the whole directory.

Actual behaviour

Segfault with 5 different log outputs non-deterministically.

Include debug information

Execute in the root of your project the command haskell-language-server --debug . and paste the logs here:

Debug output 1:

plutus-core1.log

Debug output 2:

plutus-core2.log

Debug output 3:

plutus-core3.log

Debug output 4:

plutus-core4.log

Debug output 5:

plutus-core5.log

@Ailrun Ailrun added type: template haskell related type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Apr 19, 2021
@jakzale
Copy link
Author

jakzale commented Apr 20, 2021

I recompiled haskell-language-server with -g and now I am getting actual errors instead of segfaults.

I got two GHC errors:

GHC error in desugarer lookup in Ghci1:
  attempting to use module ‘main:UntypedPlutusCore.Core.Type’ (/Users/jakub/Developer/plutus/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Core/Type.hs) which is not loaded
GHC error in desugarer lookup in Ghci1:
  Can't find interface-file declaration for variable $tcTerm
    Probable cause: bug in .hi-boot file, or inconsistent .hi file
    Use -ddump-if-trace to get an idea of which file caused the error

aside from the usual suspect of suspect of an exception when executing Template Haskell:

  • Exception when trying to run compile-time code:
  setResourceLimit: permission denied (Operation not permitted)
  Code: template-haskell-2.16.0.0:Language.Haskell.TH.Quote.quoteExp
  r
  "\n\
  \ source(\"cost-model/data/models.R\")\n\
  \ modelFun(\"cost-model/data/benching.csv\")\n\
  \ "
  • In the quasi-quotation:
  [r|
  source("cost-model/data/models.R")
  modelFun("cost-model/data/benching.csv")
  |]

Full debug output attached below.

Debug output

plutus-core6.log

@jakzale
Copy link
Author

jakzale commented Apr 20, 2021

Upon closer inspection, I think this was a variation of #1160.

I tried the fix mentioned by @Naveenaidu and it seems to resolve the issue.

@jakzale jakzale closed this as completed Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os: macos 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

3 participants