Skip to content

Compiler segfault building floskell in windows 10

Summary

Compiler throws not deterministic segfaults in the floskell package, in the module Floskell.Pretty when building it as dependency of haskell-language-server in windows.

With ghc-8.8.4 and ghc-8.8.3 i ve got:

[10 of 12] Compiling Floskell.Pretty  ( src\Floskell\Pretty.hs, dist\build\Floskell\Pretty.o )

Access violation in generated code when executing data at 0xffffffff8237cb40

 Attempting to reconstruct a stack trace...

   Frame        Code address
 * 0x461dab0    0xffffffff8237cb40
 * 0x461dab8    0x2d006300680067
 * 0x461dac0    0x2e0038002e0038
 * 0x461dac8    0x690000005c0034
 * 0x461dad0    0x5c006e D:\bin\stack\x86_64-windows\ghc-8.8.4\bin\ghc.exe+0x1c006e

D:\bin\stack\x86_64-windows\ghc-8.8.4\bin\ghc-8.8.4.exe returned ExitFailure
11

With ghc-8.10.1:

[10 of 12] Compiling Floskell.Pretty  ( src\Floskell\Pretty.hs, dist\build\Floskell\Pretty.o )
D:\bin\stack\x86_64-windows\ghc-8.10.1\bin\ghc-8.10.1.exe returned ExitFailure
(-1073740791)

Despite the ghc paths i have tested it building with cabal, but the error is thrown with stack as well: Full logs:

However, i have not able to reproduce the error consistently but with windows 10 and ghc-8.8.4.

  • building the package itself works for all ghc versions most of the times
    • so setting the project as a local package in the cabal.project of hls makesthe build work, most of the times
  • i am not able to reproduce it at all in windows 7

Steps to reproduce

Please provide a set of concrete steps to reproduce the issue.

  • pull the haskell-language-server project
  • build with `cabal --store-dir \path\to\new\store build -w ghc-8.8.4

Expected behavior

The compiler should build the module succesfully.

Environment

  • GHC version used: 8.8.3, 8.8.4 and 8.10.1

Optional:

  • Operating System: Windows 10
  • System Architecture: 64 bits

Context: reported originally in the floskell repo: https://github.com/ennocramer/floskell/issues/50

/cc @bgamari

Edited by Javier Neira
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information