Skip to content

Access violation building GHC sanity check on Windows 10 64-bit during stack setup

After installing on Windows 10 using standard powershell command on the GHCup web site when accessed from Windows 10. Install was run from non-Admim powershell. Mingw haskell shell works fine.

First use of stack setup fails sanity check for GHC.exe

Running Edition: Windows 10 Home Version: 21H2 OS build: 19044.1645 64-bit OS on 64-bit processor

$ stack setup
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Preparing to download ghc-8.8.3 ...
ghc-8.8.3: download has begun
ghc-8.8.3:   23.75 MiB / 195.22 MiB ( 12.17%) downloaded...
ghc-8.8.3:   54.18 MiB / 195.22 MiB ( 27.75%) downloaded...
ghc-8.8.3:   90.15 MiB / 195.22 MiB ( 46.18%) downloaded...
ghc-8.8.3:  128.85 MiB / 195.22 MiB ( 66.00%) downloaded...
ghc-8.8.3:  171.24 MiB / 195.22 MiB ( 87.72%) downloaded...
ghc-8.8.3:  195.22 MiB / 195.22 MiB (100.00%) downloaded...
Downloaded ghc-8.8.3.
Preparing to download 7z.dll ...
7z.dll: download has begun
7z.dll:  437.00 KiB / 437.00 KiB (100.00%) downloaded...
Downloaded 7z.dll.
Preparing to download 7z.exe ...
7z.exe: download has begun
7z.exe:   72.00 KiB / 72.00 KiB (100.00%) downloaded...
Downloaded 7z.exe.
Decompressing ghc-8.8.3.tar.xz...

7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18

Processing archive: C:\Users\Mark\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3.tar.xz

Extracting  ghc-8.8.3.tar

Everything is Ok

Size:       2555330560
Compressed: 204702116
Extracting ghc-8.8.3.tar...
Extracted 72 files
Extracted 134 files
...
Extracted 10091 files
Extracted total of 10091 files from ghc-8.8.3.tar
GHC installed to C:\Users\Mark\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\
The GHC located at C:\Users\Mark\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\bin\ghc-8.8.3.exe failed to compile a sanity check. Please see:

    http://docs.haskellstack.org/en/stable/install_and_upgrade/

for more information. Exception was:
Received ExitFailure 11 when running
Raw command: "C:\\Users\\Mark\\AppData\\Local\\Programs\\stack\\x86_64-windows\\ghc-8.8.3\\bin\\ghc-8.8.3.exe" "C:\\ghcup\\msys64\\tmp\\stack-sanity-check-3c4ddf5d50f0686c\\Main.hs" -no-user-package-db
Run from: C:\ghcup\msys64\tmp\stack-sanity-check-3c4ddf5d50f0686c\
Standard output:

[1 of 1] Compiling Main             ( C:\\ghcup\msys64\tmp\stack-sanity-check-3c4ddf5d50f0686c\Main.hs, C:\\ghcup\msys64\tmp\stack-sanity-check-3c4ddf5d50f0686c\Main.o )
Standard error:


Access violation in generated code when writing 0x0

 Attempting to reconstruct a stack trace...

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



Mark@DESKTOP-TTIHNKD MSYS ~/proteaaudio
$
Edited by Mark Cornwell
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information