Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

stack build failing on Windows and ghc-8.8.3: Access violation in generated code #1779

Open
a-churchill opened this issue May 28, 2020 · 2 comments

Comments

@a-churchill
Copy link

a-churchill commented May 28, 2020

Hello, I'm trying to install hie with stack ./install.hs hie-8.8.3 and the build fails every time. FYI this is in a short path (C:\hie) and I have also enabled Win32 long paths.

Here is the full output:

PS C:\hie> stack install.hs hie-8.8.3
# stack (for check)
# git (for submodules)
# git (for submodules)
Options:
    Verbosity level: Info
# stack (for hie-8.8.3)
Linking C:\\sr\\setup-exe-cache\\x86_64-windows\\tmp-Cabal-simple_Z6RU0evB_3.0.1.0_ghc-8.8.3.exe ...

Access violation in generated code when writing 0x0

 Attempting to reconstruct a stack trace...

   Frame        Code address
 * 0x461da80    0x37f7b66 C:\Users\chuan\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\bin\ghc.exe+0x33f7b66
 * 0x461da88    0x3277bb9 C:\Users\chuan\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\bin\ghc.exe+0x2e77bb9
 * 0x461da90    0x3
 * 0x461da98    0x69a2db1
 * 0x461daa0    0x3d80c90 C:\Users\chuan\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\bin\ghc.exe+0x3980c90
 * 0x461daa8    0x76e6c30


--  While building simple Setup.hs using:
      C:\Users\chuan\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\bin\ghc-8.8.3.EXE -rtsopts -threaded -clear-package-db -global-package-db -hide-all-packages -package base -main-is StackSetupShim.mainOverride -package Cabal-3.0.1.0 C:\sr\setup-exe-src\setup-Z6RU0evB.hs C:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs -o C:\sr\setup-exe-cache\x86_64-windows\tmp-Cabal-simple_Z6RU0evB_3.0.1.0_ghc-8.8.3.exe
    Process exited with code: ExitFailure 11

********************************************************************************
Building failed, Try running `stack clean` and restart the build
If this does not work, open an issue at
        https://github.com/haskell/haskell-ide-engine
********************************************************************************

Error when running Shake build system:
  at want, called at src\Development\Shake\Internal\Args.hs:83:69 in shake-0.18.5-7VS8ovPeUeSCopHgkQQ1Vu:Development.Shake.Internal.Args
* Depends on: hie-8.8.3
  at command, called at src\\Stack.hs:80:3 in hie-install-0.8.1.0-92nHWHZTzvm7FeYed5xR9u:Stack
* Raised the exception:
Development.Shake.command, system command failed
Command line: stack --stack-yaml=stack-8.8.3.yaml install --verbosity=info
Exit code: 1
Stderr:
Linking C:\\sr\\setup-exe-cache\\x86_64-windows\\tmp-Cabal-simple_Z6RU0evB_3.0.1.0_ghc-8.8.3.exe ...

Access violation in generated code when writing 0x0

 Attempting to reconstruct a stack trace...

   Frame        Code address
 * 0x461da80    0x37f7b66 C:\Users\chuan\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\bin\ghc.exe+0x33f7b66
 * 0x461da88    0x3277bb9 C:\Users\chuan\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\bin\ghc.exe+0x2e77bb9
 * 0x461da90    0x3
 * 0x461da98    0x69a2db1
 * 0x461daa0    0x3d80c90 C:\Users\chuan\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\bin\ghc.exe+0x3980c90
 * 0x461daa8    0x76e6c30


--  While building simple Setup.hs using:
      C:\Users\chuan\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\bin\ghc-8.8.3.EXE -rtsopts -threaded -clear-package-db -global-package-db -hide-all-packages -package base -main-is StackSetupShim.mainOverride -package Cabal-3.0.1.0 C:\sr\setup-exe-src\setup-Z6RU0evB.hs C:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs -o C:\sr\setup-exe-cache\x86_64-windows\tmp-Cabal-simple_Z6RU0evB_3.0.1.0_ghc-8.8.3.exe
    Process exited with code: ExitFailure 11

I have also followed the advice in the error message and ran stack clean before rerunning the same command, but it gets the same error.

Also it's worth mentioning, stack and git are on my PATH, as is the Stack local bin directory

@jneira
Copy link
Member

jneira commented May 28, 2020

Hi! i am afraid the error is due a general ghc bug and it is triggered for lot of packages, see for example haskell/haskell-language-server#86
We cant do much things here but suggest some workarounds until a ghc release that fixes it:

  • build with cabal instead stack
  • use stack-8.6.5.yaml

@jneira jneira changed the title Build failing on Windows Build failing on Windows: Access violation in generated code May 28, 2020
@jneira jneira changed the title Build failing on Windows: Access violation in generated code Build failing on Windows and ghc-8.8.3: Access violation in generated code May 28, 2020
@jneira jneira changed the title Build failing on Windows and ghc-8.8.3: Access violation in generated code stack build failing on Windows and ghc-8.8.3: Access violation in generated code May 29, 2020
@jneira
Copy link
Member

jneira commented May 29, 2020

I've just seen that the fix for that bug will be backported to ghc.8.8.4, 🎉 : https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3373

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants