Stack: Stack build - Access violation error

Created on 13 Jan 2018  ·  53Comments  ·  Source: commercialhaskell/stack

I've been trying to build my Haskell project for the last couple days using stack and I'm getting an access violation error. From what I understand I have the latest stack version and GHC.

This was all originally working until I added a library to my cabal file. I've now removed it but the error still occurs. I've also reverted back to when my code was definitely working so I'm sure this is something caused by stack.

I've tried uninstalling stack, deleting .stack-work and reinstalling. I've tried many variations of commands but no results. Apologies if this is a duplicate.

stack build

Building all executables for `haskell-project' once. After a successful build of all of them, only specified executables will be rebuilt.
haskell-project-0.1.0.0: configure (exe)
Access violation in generated code when reading 000000000e58391a

--  While building custom Setup.hs for package haskell-project-0.1.0.0 using:
    C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --builddir=.stack-work\dist\5c8418a7 configure --with-ghc=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\13cecb13\pkgdb --package-db=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\pkgdb --libdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\lib --bindir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\bin --datadir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\share --libexecdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\libexec --sysconfdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\etc --docdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\doc\haskell-project-0.1.0.0 --htmldir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\doc\haskell-project-0.1.0.0 --haddockdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\doc\haskell-project-0.1.0.0 --dependency=base=base-4.10.1.0 --dependency=containers=containers-0.5.10.2 --dependency=mtl=mtl-2.2.1-DscMMmDQUE6GBfOSl4qMUH --dependency=parsec=parsec-3.1.11-3BgBURmbRiVF8fgoxhAiBa --dependency=pretty-simple=pretty-simple-2.0.1.0-J3QTM6x6LHL5fhqavYvVhJ --dependency=text=text-1.2.2.2-9VTsh6V7U7hpagw2HDvpZ --extra-include-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib --enable-tests --enable-benchmarks
Process exited with code: ExitFailure 1

OS

Windows

Stack version

Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0

Method of installation

  • Windows installer

Associated Stack Overflow

https://stackoverflow.com/questions/48232637/haskell-stack-access-violation-error-during-build

upstream issue

Most helpful comment

I am having the same issue with the stack-1.9.1, lts-12.17, ghc-8.4.4 combo. My machine is Windows 10... and here is a clue. I found that I can trigger and then fix the problem by setting/unsetting the __COMPAT_LAYER environment variable:

C:\>set __COMPAT_LAYER=Installer
C:\>stack --version
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 hpack-0.31.0
Access violation in generated code when reading 0000000094c8bcba
C:\>set __COMPAT_LAYER=
C:\>stack --version
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 hpack-0.31.0
C:\>

The culprit seems to set it to the "Installer" value. I tried a couple of others, and that did not seem to have any effect.

All 53 comments

Copying your workaround from stackoverflow:

I managed to find a temporary solution for anybody who is having the same issue.

I downgraded cabal to version 1.24.0.2 and changed the resolver to using GHC version 8.0.1 (resolver: ghc-8.0.1).

After then running stack solver I'm now able to build.

Can you please post a verbose + cabal-verbose log? (stack build -v --cabal-verbose). I am thinking this is an error thrown by either cabal or ghc, and so should be reported upstream.

This is a bit difficult as I've finally managed to get it working and I don't want to risk having the error occur again as it stopped me coding a few days. If nobody is able to recreate it I may be able to on another PC by the end of the week. I'll be surprised if nobody else gets this as I don't believe I did anything out of the ordinary,
It should be a matter of updating GHC and Cabal to reproduce it on Windows 10 if anybody is able to.
It didn't fix it when I just downgraded Cabal. When I then changed the resolver to point at ghc-8.0.1 it was then fixed. So to me it seems more likely to be a GHC issue unless it's a combination of both changes that fixed it.

Ok! I'll just close this for now and we'll see if it crops up again.

I've managed to recreate the issue again by using resolver lts-10.3. At least thats what I think caused it as I was moving some directories around.

C:\Users\Michael\Desktop\Cobalt\compiler>stack build -v --cabal-verbose
Version 1.6.1, Git revision f25811329bbc40b0c21053a8160c56f923e1201b (5435 commits) x86_64 hpack-0.20.0
2018-01-22 22:10:35.275655: [debug] Checking for project config at: C:\Users\Michael\Desktop\Cobalt\compiler\stack.yaml
@(Stack\Config.hs:842:9)
2018-01-22 22:10:35.277641: [debug] Loading project config file stack.yaml
@(Stack\Config.hs:868:13)
2018-01-22 22:10:35.282644: [debug] Decoding build plan from: C:\sr\build-plan\lts-10.3.yaml
@(Stack\Snapshot.hs:150:5)
2018-01-22 22:10:35.284645: [debug] Trying to decode C:\sr\build-plan-cache\lts-10.3.cache
@(Data\Store\VersionTagged.hs:66:5)
2018-01-22 22:10:35.289656: [debug] Success decoding C:\sr\build-plan-cache\lts-10.3.cache
@(Data\Store\VersionTagged.hs:70:13)
2018-01-22 22:10:35.292649: [debug] Using standard GHC build
@(Stack\Setup.hs:619:9)
2018-01-22 22:10:35.296155: [debug] Getting global package database location
@(Stack\GhcPkg.hs:46:5)
2018-01-22 22:10:35.297657: [debug] Asking GHC for its version
@(Stack\Setup\Installed.hs:98:13)
2018-01-22 22:10:35.299160: [debug] Getting Cabal package version
@(Stack\GhcPkg.hs:185:5)
2018-01-22 22:10:35.300162: [debug] Run process: C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db list --global
@(System\Process\Log.hs:37:3)
2018-01-22 22:10:35.301163: [debug] Run process: C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --numeric-version
@(System\Process\Log.hs:37:3)
2018-01-22 22:10:35.309681: [debug] Run process: C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db field --simple-output Cabal version
@(System\Process\Log.hs:37:3)
2018-01-22 22:10:35.349794: [debug] Process finished in 49ms: C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db list --global
@(System\Process\Log.hs:44:3)
2018-01-22 22:10:35.351795: [debug] Process finished in 46ms: C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --numeric-version
@(System\Process\Log.hs:44:3)
2018-01-22 22:10:35.352796: [debug] GHC version is: ghc-8.2.2
@(Stack\Setup\Installed.hs:102:13)
2018-01-22 22:10:35.362800: [debug] Process finished in 41ms: C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db field --simple-output Cabal version
@(System\Process\Log.hs:44:3)
2018-01-22 22:10:35.363801: [debug] Resolving package entries
@(Stack\Setup.hs:252:5)
2018-01-22 22:10:35.364801: [debug] Trying to decode C:\sr\loaded-snapshot-cache\x86_64-windows\ghc-8.2.2\lts-10.3.cache
@(Data\Store\VersionTagged.hs:66:5)
2018-01-22 22:10:35.393816: [debug] Success decoding C:\sr\loaded-snapshot-cache\x86_64-windows\ghc-8.2.2\lts-10.3.cache
@(Data\Store\VersionTagged.hs:70:13)
2018-01-22 22:10:35.395324: [debug] Starting to execute command inside EnvConfig
@(Stack\Runners.hs:170:18)
2018-01-22 22:10:35.395825: [debug] Parsing the targets
@(Stack\Build\Target.hs:460:3)
2018-01-22 22:10:35.429360: [debug] Exception ignored when attempting to load C:\Users\Michael\Desktop\Cobalt\compiler\.stack-work\dist\5c8418a7\stack-build-cache: C:\Users\Michael\Desktop\Cobalt\compiler\.stack-work\dist\5c8418a7\stack-build-cache: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-01-22 22:10:35.430371: [debug] Start: getPackageFiles C:\Users\Michael\Desktop\Cobalt\compiler\haskell-project.cabal
@(Stack\PrettyPrint.hs:134:16)
2018-01-22 22:10:35.457386: [warn]
Warning: File listed in haskell-project.cabal file does not exist: ChangeLog.md
@(Stack\PrettyPrint.hs:63:22)
2018-01-22 22:10:35.459375: [debug] Finished in 27ms: getPackageFiles C:\Users\Michael\Desktop\Cobalt\compiler\haskell-project.cabal
@(Stack\PrettyPrint.hs:134:16)
2018-01-22 22:10:35.463377: [debug] Finding out which packages are already installed
@(Stack\Build\Installed.hs:60:5)
2018-01-22 22:10:35.466379: [debug] Run process: C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --global --no-user-package-db dump --expand-pkgroot
@(System\Process\Log.hs:37:3)
2018-01-22 22:10:35.513015: [debug] Process finished in 45ms: C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --global --no-user-package-db dump --expand-pkgroot
@(System\Process\Log.hs:44:3)
2018-01-22 22:10:35.514018: [debug] Ignoring package haskeline due to wanting version 0.7.4.2 instead of 0.7.4.0
@(Stack\Build\Installed.hs:190:5)
2018-01-22 22:10:35.516018: [debug] Ignoring package Cabal due to wanting version 2.0.1.1 instead of 2.0.1.0
@(Stack\Build\Installed.hs:190:5)
2018-01-22 22:10:35.517018: [debug] Run process: C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapshots\13cecb13\pkgdb dump --expand-pkgroot
@(System\Process\Log.hs:37:3)
2018-01-22 22:10:35.589053: [debug] Process finished in 71ms: C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapshots\13cecb13\pkgdb dump --expand-pkgroot
@(System\Process\Log.hs:44:3)
2018-01-22 22:10:35.591071: [debug] Run process: C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\Users\Michael\Desktop\Cobalt\compiler\.stack-work\install\ccbce92a\pkgdb dump --expand-pkgroot
@(System\Process\Log.hs:37:3)
2018-01-22 22:10:35.631450: [debug] Process finished in 39ms: C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\Users\Michael\Desktop\Cobalt\compiler\.stack-work\install\ccbce92a\pkgdb dump --expand-pkgroot
@(System\Process\Log.hs:44:3)
2018-01-22 22:10:35.633442: [debug] Constructing the build plan
@(Stack\Build\ConstructPlan.hs:180:5)
2018-01-22 22:10:35.634442: [debug] Trying to decode C:\sr\indices\Hackage\01-index.cache
@(Data\Store\VersionTagged.hs:66:5)
2018-01-22 22:10:35.769547: [debug] Success decoding C:\sr\indices\Hackage\01-index.cache
@(Data\Store\VersionTagged.hs:70:13)
2018-01-22 22:10:35.775536: [debug] Checking if we are going to build multiple executables with the same name
@(Stack\Build.hs:177:5)
2018-01-22 22:10:35.775536: [debug] Executing the build plan
@(Stack\Build\Execute.hs:490:5)
2018-01-22 22:10:35.777537: [debug] Getting global package database location
@(Stack\GhcPkg.hs:46:5)
2018-01-22 22:10:35.778537: [debug] Run process: C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db list --global
@(System\Process\Log.hs:37:3)
2018-01-22 22:10:35.817596: [debug] Process finished in 37ms: C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db list --global
@(System\Process\Log.hs:44:3)
2018-01-22 22:10:35.819597: [debug] Exception ignored when attempting to load C:\sr\precompiled\x86_64-windows\ghc-8.2.2\2.0.1.0\cGFyc2VyLWNvbWJpbmF0b3JzLTAuNC4wQHNoYTI1NjoxZDAwZDAzM2QxN2Y2NDQ3N2ZhMjYyZTU4MmRkOTlhODRmZTBkNzQ4NWI1YzVjYmExOGNkOTQ3NDcyYTc0OTQ0LDE1ODQ=\8V017xAosBCXvyebOCY5j5EHzsEQtvZf18DNSziu5Ws=: C:\sr\precompiled\x86_64-windows\ghc-8.2.2\2.0.1.0\cGFyc2VyLWNvbWJpbmF0b3JzLTAuNC4wQHNoYTI1NjoxZDAwZDAzM2QxN2Y2NDQ3N2ZhMjYyZTU4MmRkOTlhODRmZTBkNzQ4NWI1YzVjYmExOGNkOTQ3NDcyYTc0OTQ0LDE1ODQ=\8V017xAosBCXvyebOCY5j5EHzsEQtvZf18DNSziu5Ws=: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-01-22 22:10:35.859617: [debug] Exception ignored when attempting to load C:\Users\Michael\AppData\Local\Temp\stack14368\parser-combinators-0.4.0\.stack-work\dist\5c8418a7\stack-config-cache: C:\Users\Michael\AppData\Local\Temp\stack14368\parser-combinators-0.4.0\.stack-work\dist\5c8418a7\stack-config-cache: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-01-22 22:10:35.860620: [debug] Exception ignored when attempting to load C:\Users\Michael\AppData\Local\Temp\stack14368\parser-combinators-0.4.0\.stack-work\dist\5c8418a7\stack-cabal-mod: C:\Users\Michael\AppData\Local\Temp\stack14368\parser-combinators-0.4.0\.stack-work\dist\5c8418a7\stack-cabal-mod: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-01-22 22:10:35.861618: [info] parser-combinators-0.4.0: configure
@(Stack\Build\Execute.hs:859:23)
2018-01-22 22:10:35.908427: [debug] Run process: C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --verbose --builddir=.stack-work\dist\5c8418a7 configure --with-ghc=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\13cecb13\pkgdb --libdir=C:\sr\snapshots\13cecb13\lib --bindir=C:\sr\snapshots\13cecb13\bin --datadir=C:\sr\snapshots\13cecb13\share --libexecdir=C:\sr\snapshots\13cecb13\libexec --sysconfdir=C:\sr\snapshots\13cecb13\etc --docdir=C:\sr\snapshots\13cecb13\doc\parser-combinators-0.4.0 --htmldir=C:\sr\snapshots\13cecb13\doc\parser-combinators-0.4.0 --haddockdir=C:\sr\snapshots\13cecb13\doc\parser-combinators-0.4.0 --dependency=base=base-4.10.1.0 --extra-include-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib
@(System\Process\Log.hs:37:3)
Progress: 1/3
--  While building custom Setup.hs for package parser-combinators-0.4.0 using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --verbose --builddir=.stack-work\dist\5c8418a7 configure --with-ghc=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\13cecb13\pkgdb --libdir=C:\sr\snapshots\13cecb13\lib --bindir=C:\sr\snapshots\13cecb13\bin --datadir=C:\sr\snapshots\13cecb13\share --libexecdir=C:\sr\snapshots\13cecb13\libexec --sysconfdir=C:\sr\snapshots\13cecb13\etc --docdir=C:\sr\snapshots\13cecb13\doc\parser-combinators-0.4.0 --htmldir=C:\sr\snapshots\13cecb13\doc\parser-combinators-0.4.0 --haddockdir=C:\sr\snapshots\13cecb13\doc\parser-combinators-0.4.0 --dependency=base=base-4.10.1.0 --extra-include-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib
    Process exited with code: ExitFailure 1
    Logs have been written to: C:\Users\Michael\Desktop\Cobalt\compiler\.stack-work\logs\parser-combinators-0.4.0.log

    Access violation in generated code when reading 000000000e58391a

If there is anything else I can do to help let me know soon so I can do it before I fix the problem again. I feel this probably should be reopened as this is causing me to have to use an older version for the time being.

I have the same problem with stack-10.8
When I do stack build with the menu I see the same error.

When I do the stack build -v --cabal-verbose it builds fine but with type errrors :

``` stack build -v --cabal-verbose Version 1.6.5, Git revision 24ab0d6ff07f28276e082c3ce74dfdeb1a2ca9e9 (5514 commits) x86_64 hpack-0.20.0 2018-03-12 16:55:06.389792: [debug] Checking for project config at: C:\Users\rwobb\Documents\haskell\exercises\chapter10\stack.yaml @(Stack\Config.hs:842:9) 2018-03-12 16:55:06.392483: [debug] Loading project config file stack.yaml @(Stack\Config.hs:868:13) 2018-03-12 16:55:06.408444: [debug] Decoding build plan from: C:\sr\build-plan\lts-10.8.yaml @(Stack\Snapshot.hs:150:5) 2018-03-12 16:55:06.408444: [debug] Trying to decode C:\sr\build-plan-cache\lts-10.8.cache @(Data\Store\VersionTagged.hs:66:5) 2018-03-12 16:55:06.416137: [debug] Success decoding C:\sr\build-plan-cache\lts-10.8.cache @(Data\Store\VersionTagged.hs:70:13) 2018-03-12 16:55:06.420151: [debug] Using standard GHC build @(Stack\Setup.hs:617:9) 2018-03-12 16:55:06.422641: [debug] Getting global package database location @(Stack\GhcPkg.hs:46:5) 2018-03-12 16:55:06.424643: [debug] Getting Cabal package version @(Stack\GhcPkg.hs:185:5) 2018-03-12 16:55:06.425739: [debug] Asking GHC for its version @(Stack\Setup\Installed.hs:98:13) 2018-03-12 16:55:06.428472: [debug] Run process: C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db list --global @(System\Process\Log.hs:37:3) 2018-03-12 16:55:06.449730: [debug] Run process: C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db field --simple-output Cabal version @(System\Process\Log.hs:37:3) 2018-03-12 16:55:06.465358: [debug] Run process: C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --numeric-version @(System\Process\Log.hs:37:3) 2018-03-12 16:55:06.489515: [debug] Process finished in 61ms: C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db list --global @(System\Process\Log.hs:44:3) 2018-03-12 16:55:06.508451: [debug] Process finished in 31ms: C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --numeric-version @(System\Process\Log.hs:44:3) 2018-03-12 16:55:06.508451: [debug] GHC version is: ghc-8.2.2 @(Stack\Setup\Installed.hs:102:13) 2018-03-12 16:55:06.512105: [debug] Process finished in 58ms: C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db field --simple-output Cabal version @(System\Process\Log.hs:44:3) 2018-03-12 16:55:06.512105: [debug] Resolving package entries @(Stack\Setup.hs:250:5) 2018-03-12 16:55:06.512105: [debug] Trying to decode C:\sr\loaded-snapshot-cache\x86_64-windows\ghc-8.2.2\lts-10.8.cache @(Data\Store\VersionTagged.hs:66:5) 2018-03-12 16:55:06.543358: [debug] Success decoding C:\sr\loaded-snapshot-cache\x86_64-windows\ghc-8.2.2\lts-10.8.cache @(Data\Store\VersionTagged.hs:70:13) 2018-03-12 16:55:06.543358: [debug] Starting to execute command inside EnvConfig @(Stack\Runners.hs:170:18) 2018-03-12 16:55:06.543358: [debug] Parsing the targets @(Stack\Build\Target.hs:460:3) 2018-03-12 16:55:06.543358: [debug] Running hpack on C:\Users\rwobb\Documents\haskell\exercises\chapter10\package.yaml @(Stack\PrettyPrint.hs:63:22) 2018-03-12 16:55:06.621487: [warn] Warning: WARNING: C:\Users\rwobb\Documents\haskell\exercises\chapter10\chapter10.cabal was modified manually. Ignoring package.yaml in favor of cabal file. If you want to use package.yaml instead of the cabal file, then please delete the cabal file. @(Stack\PrettyPrint.hs:63:22) 2018-03-12 16:55:06.652737: [debug] Start: getPackageFiles C:\Users\rwobb\Documents\haskell\exercises\chapter10\chapter10.cabal @(Stack\PrettyPrint.hs:134:16) 2018-03-12 16:55:06.668362: [debug] Finished in 10ms: getPackageFiles C:\Users\rwobb\Documents\haskell\exercises\chapter10\chapter10.cabal @(Stack\PrettyPrint.hs:134:16) 2018-03-12 16:55:06.668362: [debug] Exception ignored when attempting to load C:\Users\rwobb\Documents\haskell\exercises\chapter10\.stack-work\dist\5c8418a7\stack-build-caches\exe-chapter10-exe: C:\Users\rwobb\Documents\haskell\exercises\chapter10\.stack-work\dist\5c8418a7\stack-build-caches\exe-chapter10-exe: openBinaryFile: does not exist (No such file or directory) @(Data\Store\VersionTagged.hs:84:9) 2018-03-12 16:55:06.668362: [debug] Finding out which packages are already installed @(Stack\Build\Installed.hs:60:5) 2018-03-12 16:55:06.668362: [debug] Run process: C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --global --no-user-package-db dump --expand-pkgroot @(System\Process\Log.hs:37:3) 2018-03-12 16:55:06.744179: [debug] Process finished in 62ms: C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --global --no-user-package-db dump --expand-pkgroot @(System\Process\Log.hs:44:3) 2018-03-12 16:55:06.744179: [debug] Ignoring package haskeline due to wanting version 0.7.4.2 instead of 0.7.4.0 @(Stack\Build\Installed.hs:190:5) 2018-03-12 16:55:06.759818: [debug] Ignoring package Cabal due to wanting version 2.0.1.1 instead of 2.0.1.0 @(Stack\Build\Installed.hs:190:5) 2018-03-12 16:55:06.759818: [debug] Run process: C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapshots\180ba486\pkgdb dump --expand-pkgroot @(System\Process\Log.hs:37:3) 2018-03-12 16:55:06.865105: [debug] Process finished in 97ms: C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapshots\180ba486\pkgdb dump --expand-pkgroot @(System\Process\Log.hs:44:3) 2018-03-12 16:55:06.865105: [debug] Run process: C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\Users\rwobb\Documents\haskell\exercises\chapter10\.stack-work\install\4cb44db3\pkgdb dump --expand-pkgroot @(System\Process\Log.hs:37:3) 2018-03-12 16:55:06.922330: [debug] Process finished in 53ms: C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\Users\rwobb\Documents\haskell\exercises\chapter10\.stack-work\install\4cb44db3\pkgdb dump --expand-pkgroot @(System\Process\Log.hs:44:3) 2018-03-12 16:55:06.922330: [debug] Constructing the build plan @(Stack\Build\ConstructPlan.hs:180:5) 2018-03-12 16:55:06.922330: [debug] Checking if we are going to build multiple executables with the same name @(Stack\Build.hs:177:5) 2018-03-12 16:55:06.922330: [debug] Executing the build plan @(Stack\Build\Execute.hs:490:5) 2018-03-12 16:55:06.937957: [debug] Getting global package database location @(Stack\GhcPkg.hs:46:5) 2018-03-12 16:55:06.937957: [debug] Run process: C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db list --global @(System\Process\Log.hs:37:3) 2018-03-12 16:55:06.992904: [debug] Process finished in 52ms: C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db list --global @(System\Process\Log.hs:44:3) 2018-03-12 16:55:06.992904: [info] Building all executables forchapter10' once. After a successful build of all of them, only specified executables will be rebuilt.
@(Stack\Build\Execute.hs:1331:19)
2018-03-12 16:55:06.992904: [debug] Encoding C:\Users\rwobb\Documents\haskell\exercises\chapter10.stack-work\dist\5c8418a7\stack-build-caches\lib
@(Data\Store\VersionTagged.hs:48:5)
2018-03-12 16:55:07.008552: [debug] Finished writing C:\Users\rwobb\Documents\haskell\exercises\chapter10.stack-work\dist\5c8418a7\stack-build-caches\lib
@(Data\Store\VersionTagged.hs:53:5)
2018-03-12 16:55:07.008552: [debug] Encoding C:\Users\rwobb\Documents\haskell\exercises\chapter10.stack-work\dist\5c8418a7\stack-build-caches\exe-chapter10-exe
@(Data\Store\VersionTagged.hs:48:5)
2018-03-12 16:55:07.008552: [debug] Finished writing C:\Users\rwobb\Documents\haskell\exercises\chapter10.stack-work\dist\5c8418a7\stack-build-caches\exe-chapter10-exe
@(Data\Store\VersionTagged.hs:53:5)
2018-03-12 16:55:07.008552: [info] chapter10-0.1.0.0: build (lib + exe)
@(Stack\Build\Execute.hs:859:23)
2018-03-12 16:55:07.008552: [debug] Run process: C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --verbose --builddir=.stack-work\dist\5c8418a7 build lib:chapter10 exe:chapter10-exe --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
@(System\Process\Log.hs:37:3)
2018-03-12 16:55:07.133535: [info] Component build order: library, executable 'chapter10-exe'
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:07.133535: [info] "C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE" "init" ".stack-work\dist\5c8418a7\package.conf.inplace"
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:07.176609: [info] creating .stack-work\dist\5c8418a7\build
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:07.176609: [info] creating .stack-work\dist\5c8418a7\build\autogen
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:07.192234: [info] creating .stack-work\dist\5c8418a7\build\autogen
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:07.192234: [info] Preprocessing library for chapter10-0.1.0.0..
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:07.192234: [info] Building library for chapter10-0.1.0.0..
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:07.192234: [info] creating .stack-work\dist\5c8418a7\build
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:07.192234: [info] "C:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE" "--make" "-fbuilding-cabal-package" "-O" "-outputdir" ".stack-work\dist\5c8418a7\build" "-odir" ".stack-work\dist\5c8418a7\build" "-hidir" ".stack-work\dist\5c8418a7\build" "-stubdir" ".stack-work\dist\5c8418a7\build" "-i" "-i.stack-work\dist\5c8418a7\build" "-isrc" "-i.stack-work\dist\5c8418a7\build\autogen" "-i.stack-work\dist\5c8418a7\build\global-autogen" "-I.stack-work\dist\5c8418a7\build\autogen" "-I.stack-work\dist\5c8418a7\build\global-autogen" "-I.stack-work\dist\5c8418a7\build" "-IC:\Users\rwobb\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include" "-optP-include" "-optP.stack-work\dist\5c8418a7\build\autogen\cabal_macros.h" "-this-unit-id" "chapter10-0.1.0.0-1RglaOrbgWD9lMAlFUiKVc" "-hide-all-packages" "-Wmissing-home-modules" "-no-user-package-db" "-package-db" "C:\sr\snapshots180ba486\pkgdb" "-package-db" "C:\Users\rwobb\Documents\haskell\exercises\chapter10.stack-work\install\4cb44db3\pkgdb" "-package-db" ".stack-work\dist\5c8418a7\package.conf.inplace" "-package-id" "base-4.10.1.0" "-package-id" "time-1.8.0.2" "-XHaskell2010" "Lib" "Paths_chapter10" "-ddump-hi" "-ddump-to-file" "-fdiagnostics-color=always"
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:10.998929: [info] [1 of 2] Compiling Lib ( src\Lib.hs, .stack-work\dist\5c8418a7\build\Lib.o )
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.292458: [warn]
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.308081: [warn] src\Lib.hs:162:13: error:
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.323697: [warn] * Variable not in scope: myAny' :: (a -> Bool) -> [a] -> Bool
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.323697: [warn] * Perhaps you meant myAny' (line 153) @(Stack\Build\Execute.hs:1126:67) 2018-03-12 16:55:11.323697: [warn] | @(Stack\Build\Execute.hs:1126:67) 2018-03-12 16:55:11.323697: [warn] 162 | myElem' x = myAny' (== x) @(Stack\Build\Execute.hs:1126:67) 2018-03-12 16:55:11.323697: [warn] | ^^^^^^ @(Stack\Build\Execute.hs:1126:67) 2018-03-12 16:55:11.323697: [warn] @(Stack\Build\Execute.hs:1126:67) 2018-03-12 16:55:11.323697: [warn] src\Lib.hs:209:24: error: @(Stack\Build\Execute.hs:1126:67) 2018-03-12 16:55:11.323697: [warn] * Couldn't match expected typet0 -> a' with actual type a' @(Stack\Build\Execute.hs:1126:67) 2018-03-12 16:55:11.323697: [warn]a' is a rigid type variable bound by
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.323697: [warn] the type signature for:
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.339320: [warn] myMinimumBy :: forall a. (a -> a -> Ordering) -> [a] -> a
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.339320: [warn] at src\Lib.hs:208:1-47
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.339320: [warn] * The function foldr' is applied to four arguments, @(Stack\Build\Execute.hs:1126:67) 2018-03-12 16:55:11.339320: [warn] but its type(a -> a -> a) -> a -> [a] -> a' has only three
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.339320: [warn] In the expression:
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.339320: [warn] foldr (\ b a -> if f a b == GT then b else a) x xs p
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.339320: [warn] In an equation for `myMinimumBy':
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.339320: [warn] myMinimumBy f (x : xs)
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.354946: [warn] = foldr (\ b a -> if f a b == GT then b else a) x xs p
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.354946: [warn] * Relevant bindings include
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.354946: [warn] xs :: [a] (bound at src\Lib.hs:209:18)
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.354946: [warn] x :: a (bound at src\Lib.hs:209:16)
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.354946: [warn] f :: a -> a -> Ordering (bound at src\Lib.hs:209:13)
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.354946: [warn] myMinimumBy :: (a -> a -> Ordering) -> [a] -> a
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.354946: [warn] (bound at src\Lib.hs:209:1)
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.354946: [warn] |
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.354946: [warn] 209 | myMinimumBy f (x:xs) = foldr (\b a -> if f a b == GT then b else a) x xs p
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.370572: [warn] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.370572: [warn]
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.370572: [warn] src\Lib.hs:209:74: error: Variable not in scope: p
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.370572: [warn] |
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.370572: [warn] 209 | myMinimumBy f (x:xs) = foldr (\b a -> if f a b == GT then b else a) x xs p
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.370572: [warn] | ^
@(Stack\Build\Execute.hs:1126:67)
2018-03-12 16:55:11.370572: [warn]
@(Stack\Build\Execute.hs:1126:67)

-- While building custom Setup.hs for package chapter10-0.1.0.0 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --verbose --builddir=.stack-work\dist\5c8418a7 build lib:chapter10 exe:chapter10-exe --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
PS C:\Users\rwobb\Documents\haskell\exercises\chapter10>
```

I have the same issue.

One of my students has the same issue.

Access violation in generated code when reading 000000000465d0f6

when starting ghci or compiling anything. even through stack ghc/ghci

I have an identical problem to @paul-kline 's student. I'm on Windows 10. Same read location causing the access violation.

I'm confident it's ghc or ghci because I first had this issue repeatedly with stack, whereupon I uninstalled that as completely as I could, and installed ghc/ghci separately.

I see

>ghci
GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help
Access violation in generated code when reading 000000000465d0f6

Confirmed ghci 8.0.1 does not present this issue.

>ghci
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Prelude> 2 * 3 * 7
42
Prelude> :q
Leaving GHCi.

I'm not sure if this is helpful or not, but I decided to give Stack another go. Installed latest on Windows 10. I see a similar error for most stack commands.

> stack --version
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2
Access violation in generated code when reading 0000000094c22cc6

I also have the same issue with ghc 8.2.2 on Windows 10.
stack build fail with:

~
Access violation in generated code when reading 000000000e58391a
~

Error log:

~~~
C:\Users\nao\xyzzyi>stack build -v --cabal-verbose
Version 1.6.1, Git revision f25811329bbc40b0c21053a8160c56f923e1201b (5435 commits) x86_64 hpack-0.20.0
2018-06-22 02:06:08.210333: [debug] Checking for project config at: C:\Users\nao\xyzzyi\stack.yaml
@(Stack\Config.hs:842:9)
2018-06-22 02:06:08.210333: [debug] Loading project config file stack.yaml
@(Stack\Config.hs:868:13)
2018-06-22 02:06:08.227022: [debug] Decoding build plan from: C:\sr\build-plan\lts-11.14.yaml
@(Stack\Snapshot.hs:150:5)
2018-06-22 02:06:08.227022: [debug] Trying to decode C:\sr\build-plan-cache\lts-11.14.cache
@(Data\Store\VersionTagged.hs:66:5)
2018-06-22 02:06:08.228438: [debug] Success decoding C:\sr\build-plan-cache\lts-11.14.cache
@(Data\Store\VersionTagged.hs:70:13)
2018-06-22 02:06:08.231032: [debug] Using standard GHC build
@(Stack\Setup.hs:619:9)
2018-06-22 02:06:08.234944: [debug] Asking GHC for its version
@(Stack\Setup\Installed.hs:98:13)
2018-06-22 02:06:08.234944: [debug] Run process: C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --numeric-version
@(System\Process\Log.hs:37:3)
2018-06-22 02:06:08.241711: [debug] Getting Cabal package version
@(Stack\GhcPkg.hs:185:5)
2018-06-22 02:06:08.243011: [debug] Run process: C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db field --simple-output Cabal version
2018-06-22 02:06:08.234319: [debug] Getting global package database location
@(System\Process\Log.hs:37:3)@(Stack\GhcPkg.hs:46:5)

2018-06-22 02:06:08.254836: [debug] Run process: C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db list --global
@(System\Process\Log.hs:37:3)
2018-06-22 02:06:08.302507: [debug] Process finished in 66ms: C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --numeric-version
@(System\Process\Log.hs:44:3)
2018-06-22 02:06:08.302507: [debug] GHC version is: ghc-8.2.2
@(Stack\Setup\Installed.hs:102:13)
2018-06-22 02:06:08.308951: [debug] Process finished in 63ms: C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db field --simple-output Cabal version
@(System\Process\Log.hs:44:3)
2018-06-22 02:06:08.314593: [debug] Process finished in 59ms: C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db list --global
@(System\Process\Log.hs:44:3)
2018-06-22 02:06:08.314593: [debug] Resolving package entries
@(Stack\Setup.hs:252:5)
2018-06-22 02:06:08.314593: [debug] Trying to decode C:\sr\loaded-snapshot-cache\x86_64-windows\ghc-8.2.2\lts-11.14.cache
@(Data\Store\VersionTagged.hs:66:5)
2018-06-22 02:06:08.342891: [debug] Success decoding C:\sr\loaded-snapshot-cache\x86_64-windows\ghc-8.2.2\lts-11.14.cache
@(Data\Store\VersionTagged.hs:70:13)
2018-06-22 02:06:08.342891: [debug] Starting to execute command inside EnvConfig
@(Stack\Runners.hs:170:18)
2018-06-22 02:06:08.342891: [debug] Parsing the targets
@(Stack\Build\Target.hs:460:3)
2018-06-22 02:06:08.359523: [debug] Trying to decode C:\sr\indices\Hackage01-index.cache
@(Data\Store\VersionTagged.hs:66:5)
2018-06-22 02:06:08.538558: [debug] Success decoding C:\sr\indices\Hackage01-index.cache
@(Data\Store\VersionTagged.hs:70:13)
2018-06-22 02:06:08.580749: [debug] Exception ignored when attempting to load C:\Users\nao\xyzzyi.stack-work\dist\5c8418a7\stack-build-cache: C:\Users\nao\xyzzyi.stack-work\dist\5c8418a7\stack-build-cache: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-06-22 02:06:08.580749: [debug] Start: getPackageFiles C:\Users\nao\xyzzyi\xyzzyi.cabal
@(Stack\PrettyPrint.hs:134:16)
2018-06-22 02:06:08.580749: [debug] Finished in 0ms: getPackageFiles C:\Users\nao\xyzzyi\xyzzyi.cabal
@(Stack\PrettyPrint.hs:134:16)
2018-06-22 02:06:08.588784: [debug] Finding out which packages are already installed
@(Stack\Build\Installed.hs:60:5)
2018-06-22 02:06:08.591268: [debug] Run process: C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --global --no-user-package-db dump --expand-pkgroot
@(System\Process\Log.hs:37:3)
2018-06-22 02:06:08.647171: [debug] Process finished in 55ms: C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --global --no-user-package-db dump --expand-pkgroot
@(System\Process\Log.hs:44:3)
2018-06-22 02:06:08.648598: [debug] Ignoring package haskeline due to wanting version 0.7.4.2 instead of 0.7.4.0
@(Stack\Build\Installed.hs:190:5)
2018-06-22 02:06:08.648598: [debug] Ignoring package Cabal due to wanting version 2.0.1.1 instead of 2.0.1.0
@(Stack\Build\Installed.hs:190:5)
2018-06-22 02:06:08.649593: [debug] Run process: C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapshots\b467f05c\pkgdb dump --expand-pkgroot
@(System\Process\Log.hs:37:3)
2018-06-22 02:06:08.690865: [debug] Process finished in 41ms: C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\sr\snapshots\b467f05c\pkgdb dump --expand-pkgroot
@(System\Process\Log.hs:44:3)
2018-06-22 02:06:08.690865: [debug] Run process: C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\Users\nao\xyzzyi.stack-work\install\6dd6d5d8\pkgdb dump --expand-pkgroot
@(System\Process\Log.hs:37:3)
2018-06-22 02:06:08.732742: [debug] Process finished in 41ms: C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --no-user-package-db --package-db C:\Users\nao\xyzzyi.stack-work\install\6dd6d5d8\pkgdb dump --expand-pkgroot
@(System\Process\Log.hs:44:3)
2018-06-22 02:06:08.733690: [debug] Constructing the build plan
@(Stack\Build\ConstructPlan.hs:180:5)
2018-06-22 02:06:08.926597: [debug] Checking if we are going to build multiple executables with the same name
@(Stack\Build.hs:177:5)
2018-06-22 02:06:08.928299: [debug] Executing the build plan
@(Stack\Build\Execute.hs:490:5)
2018-06-22 02:06:08.930293: [debug] Getting global package database location
@(Stack\GhcPkg.hs:46:5)
2018-06-22 02:06:08.930293: [debug] Run process: C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db list --global
@(System\Process\Log.hs:37:3)
2018-06-22 02:06:08.969648: [debug] Process finished in 39ms: C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --no-user-package-db list --global
@(System\Process\Log.hs:44:3)
2018-06-22 02:06:08.971079: [debug] Exception ignored when attempting to load C:\sr\precompiled\x86_64-windows\ghc-8.2.2\2.0.1.0\Q2FiYWwtMi4wLjEuMUBzaGEyNTY6NzQwODM5Mzk3MjhjYWE2NWYxYTNiNWVmZmY4YzUyZWNmNTAzNzNlYzllMTA5ZDIxMmY5ZDk1OGVmOGJkY2Q5ZiwxMzQwOA==\PHd7Fa_Dgw_4NKNdjAWzfBGKijpGE5aRPDc2VzUCg5Q=: C:\sr\precompiled\x86_64-windows\ghc-8.2.2\2.0.1.0\Q2FiYWwtMi4wLjEuMUBzaGEyNTY6NzQwODM5Mzk3MjhjYWE2NWYxYTNiNWVmZmY4YzUyZWNmNTAzNzNlYzllMTA5ZDIxMmY5ZDk1OGVmOGJkY2Q5ZiwxMzQwOA==\PHd7Fa_Dgw_4NKNdjAWzfBGKijpGE5aRPDc2VzUCg5Q=: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-06-22 02:06:08.972174: [debug] Exception ignored when attempting to load C:\sr\precompiled\x86_64-windows\ghc-8.2.2\2.0.1.0\ZGF0YS1kZWZhdWx0LWNsYXNzLTAuMS4yLjBAc2hhMjU2OjYzZTYyMTIwYjdlZmQ3MzNhNWExN2NmNTljZWI0MzI2OGU5YTkyOWM3NDgxMjcxNzJkN2Q0MmY0YTMzNmUzMjcsNTQy\tP185MTBpGvtahH5tk7o9K6RNZ782vJL__2jMQaCYjM=: C:\sr\precompiled\x86_64-windows\ghc-8.2.2\2.0.1.0\ZGF0YS1kZWZhdWx0LWNsYXNzLTAuMS4yLjBAc2hhMjU2OjYzZTYyMTIwYjdlZmQ3MzNhNWExN2NmNTljZWI0MzI2OGU5YTkyOWM3NDgxMjcxNzJkN2Q0MmY0YTMzNmUzMjcsNTQy\tP185MTBpGvtahH5tk7o9K6RNZ782vJL__2jMQaCYjM=: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-06-22 02:06:08.973171: [debug] Exception ignored when attempting to load C:\sr\precompiled\x86_64-windows\ghc-8.2.2\2.0.1.0\YWxleC0zLjIuNEBzaGEyNTY6ZmNmMTk3MWZiNTEzZWFiODg2MDcyZDFmNzA1NDc1ZjA0ZmI2NTI2MWE0ZDgxMzYxYmVkZTlkODYwNTZiNDc0Yiw0MDU0\WbBj1szoMkJd97-e0RHC24ZP4I6BTXOi9wmUqk_se7Y=: C:\sr\precompiled\x86_64-windows\ghc-8.2.2\2.0.1.0\YWxleC0zLjIuNEBzaGEyNTY6ZmNmMTk3MWZiNTEzZWFiODg2MDcyZDFmNzA1NDc1ZjA0ZmI2NTI2MWE0ZDgxMzYxYmVkZTlkODYwNTZiNDc0Yiw0MDU0\WbBj1szoMkJd97-e0RHC24ZP4I6BTXOi9wmUqk_se7Y=: openBinaryFile: does not exist (No such file or directory)
2018-06-22 02:06:08.973171: [debug] Exception ignored when attempting to load C:\sr\precompiled\x86_64-windows\ghc-8.2.2\2.0.1.0\ZGxpc3QtMC44LjAuNEBzaGEyNTY6M2ViYmI3MDIyMjQ2ZjQ0NmZjNjI1Yjc3ZDBlMWY1MDlkNjZlZWRmMWRlYjIyYmJkNmRmNWM4NDUwYWFmOTIzYSwxOTI0\g3VrCWdUMiTioZY0C6tjAnvAYI1LjFQFQo9Jg4th4rU=: C:\sr\precompiled\x86_64-windows\ghc-8.2.2\2.0.1.0\ZGxpc3QtMC44LjAuNEBzaGEyNTY6M2ViYmI3MDIyMjQ2ZjQ0NmZjNjI1Yjc3ZDBlMWY1MDlkNjZlZWRmMWRlYjIyYmJkNmRmNWM4NDUwYWFmOTIzYSwxOTI0\g3VrCWdUMiTioZY0C6tjAnvAYI1LjFQFQo9Jg4th4rU=: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)@(Data\Store\VersionTagged.hs:84:9)

2018-06-22 02:06:09.100678: [debug] Exception ignored when attempting to load C:\Users\nao\AppData\Local\Temp\stack11796\data-default-class-0.1.2.0.stack-work\dist\5c8418a7\stack-config-cache: C:\Users\nao\AppData\Local\Temp\stack11796\data-default-class-0.1.2.0.stack-work\dist\5c8418a7\stack-config-cache: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-06-22 02:06:09.101674: [debug] Exception ignored when attempting to load C:\Users\nao\AppData\Local\Temp\stack11796\data-default-class-0.1.2.0.stack-work\dist\5c8418a7\stack-cabal-mod: C:\Users\nao\AppData\Local\Temp\stack11796\data-default-class-0.1.2.0.stack-work\dist\5c8418a7\stack-cabal-mod: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-06-22 02:06:09.103419: [info] data-default-class-0.1.2.0: configure
@(Stack\Build\Execute.hs:859:23)
2018-06-22 02:06:09.163199: [debug] Run process: C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --verbose --builddir=.stack-work\dist\5c8418a7 configure --with-ghc=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\b467f05c\pkgdb --libdir=C:\sr\snapshots\b467f05c\lib --bindir=C:\sr\snapshots\b467f05c\bin --datadir=C:\sr\snapshots\b467f05c\share --libexecdir=C:\sr\snapshots\b467f05c\libexec --sysconfdir=C:\sr\snapshots\b467f05c\etc --docdir=C:\sr\snapshots\b467f05c\doc\data-default-class-0.1.2.0 --htmldir=C:\sr\snapshots\b467f05c\doc\data-default-class-0.1.2.0 --haddockdir=C:\sr\snapshots\b467f05c\doc\data-default-class-0.1.2.0 --dependency=base=base-4.10.1.0 --extra-include-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib --exact-configuration
@(System\Process\Log.hs:37:3)
2018-06-22 02:06:09.168821: [debug] Exception ignored when attempting to load C:\Users\nao\AppData\Local\Temp\stack11796\dlist-0.8.0.4.stack-work\dist\5c8418a7\stack-config-cache: C:\Users\nao\AppData\Local\Temp\stack11796\dlist-0.8.0.4.stack-work\dist\5c8418a7\stack-config-cache: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-06-22 02:06:09.168821: [debug] Exception ignored when attempting to load C:\Users\nao\AppData\Local\Temp\stack11796\dlist-0.8.0.4.stack-work\dist\5c8418a7\stack-cabal-mod: C:\Users\nao\AppData\Local\Temp\stack11796\dlist-0.8.0.4.stack-work\dist\5c8418a7\stack-cabal-mod: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-06-22 02:06:09.205608: [info] dlist-0.8.0.4: configure
@(Stack\Build\Execute.hs:859:23)
2018-06-22 02:06:09.208628: [debug] Run process: C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --verbose --builddir=.stack-work\dist\5c8418a7 configure --with-ghc=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\b467f05c\pkgdb --libdir=C:\sr\snapshots\b467f05c\lib --bindir=C:\sr\snapshots\b467f05c\bin --datadir=C:\sr\snapshots\b467f05c\share --libexecdir=C:\sr\snapshots\b467f05c\libexec --sysconfdir=C:\sr\snapshots\b467f05c\etc --docdir=C:\sr\snapshots\b467f05c\doc\dlist-0.8.0.4 --htmldir=C:\sr\snapshots\b467f05c\doc\dlist-0.8.0.4 --haddockdir=C:\sr\snapshots\b467f05c\doc\dlist-0.8.0.4 --dependency=base=base-4.10.1.0 --dependency=deepseq=deepseq-1.4.3.0 --extra-include-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib --exact-configuration
@(System\Process\Log.hs:37:3)
2018-06-22 02:06:09.562393: [debug] Exception ignored when attempting to load C:\Users\nao\AppData\Local\Temp\stack11796\alex-3.2.4.stack-work\dist\5c8418a7\stack-config-cache: C:\Users\nao\AppData\Local\Temp\stack11796\alex-3.2.4.stack-work\dist\5c8418a7\stack-config-cache: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-06-22 02:06:09.563930: [debug] Exception ignored when attempting to load C:\Users\nao\AppData\Local\Temp\stack11796\alex-3.2.4.stack-work\dist\5c8418a7\stack-cabal-mod: C:\Users\nao\AppData\Local\Temp\stack11796\alex-3.2.4.stack-work\dist\5c8418a7\stack-cabal-mod: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-06-22 02:06:09.564985: [info] alex-3.2.4: configure
@(Stack\Build\Execute.hs:859:23)
2018-06-22 02:06:09.567589: [debug] Run process: C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --verbose --builddir=.stack-work\dist\5c8418a7 configure --with-ghc=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\b467f05c\pkgdb --libdir=C:\sr\snapshots\b467f05c\lib --bindir=C:\sr\snapshots\b467f05c\bin --datadir=C:\sr\snapshots\b467f05c\share --libexecdir=C:\sr\snapshots\b467f05c\libexec --sysconfdir=C:\sr\snapshots\b467f05c\etc --docdir=C:\sr\snapshots\b467f05c\doc\alex-3.2.4 --htmldir=C:\sr\snapshots\b467f05c\doc\alex-3.2.4 --haddockdir=C:\sr\snapshots\b467f05c\doc\alex-3.2.4 --dependency=array=array-0.5.2.0 --dependency=base=base-4.10.1.0 --dependency=containers=containers-0.5.10.2 --dependency=directory=directory-1.3.0.2 -fsmall_base --extra-include-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib --exact-configuration
@(System\Process\Log.hs:37:3)
2018-06-22 02:06:18.989533: [debug] Exception ignored when attempting to load C:\Users\nao\AppData\Local\Temp\stack11796\Cabal-2.0.1.1.stack-work\dist\5c8418a7\stack-config-cache: C:\Users\nao\AppData\Local\Temp\stack11796\Cabal-2.0.1.1.stack-work\dist\5c8418a7\stack-config-cache: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-06-22 02:06:18.989533: [debug] Exception ignored when attempting to load C:\Users\nao\AppData\Local\Temp\stack11796\Cabal-2.0.1.1.stack-work\dist\5c8418a7\stack-cabal-mod: C:\Users\nao\AppData\Local\Temp\stack11796\Cabal-2.0.1.1.stack-work\dist\5c8418a7\stack-cabal-mod: openBinaryFile: does not exist (No such file or directory)
@(Data\Store\VersionTagged.hs:84:9)
2018-06-22 02:06:18.991606: [info] Cabal-2.0.1.1: configure
@(Stack\Build\Execute.hs:859:23)
2018-06-22 02:06:18.991606: [debug] Run process: C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --verbose --builddir=.stack-work\dist\5c8418a7 configure --with-ghc=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\b467f05c\pkgdb --libdir=C:\sr\snapshots\b467f05c\lib --bindir=C:\sr\snapshots\b467f05c\bin --datadir=C:\sr\snapshots\b467f05c\share --libexecdir=C:\sr\snapshots\b467f05c\libexec --sysconfdir=C:\sr\snapshots\b467f05c\etc --docdir=C:\sr\snapshots\b467f05c\doc\Cabal-2.0.1.1 --htmldir=C:\sr\snapshots\b467f05c\doc\Cabal-2.0.1.1 --haddockdir=C:\sr\snapshots\b467f05c\doc\Cabal-2.0.1.1 --dependency=Win32=Win32-2.5.4.1 --dependency=array=array-0.5.2.0 --dependency=base=base-4.10.1.0 --dependency=binary=binary-0.8.5.1 --dependency=bytestring=bytestring-0.10.8.2 --dependency=containers=containers-0.5.10.2 --dependency=deepseq=deepseq-1.4.3.0 --dependency=directory=directory-1.3.0.2 --dependency=filepath=filepath-1.4.1.2 --dependency=pretty=pretty-1.1.3.3 --dependency=process=process-1.6.1.0 --dependency=time=time-1.8.0.2 -f-bundled-binary-generic -f-old-directory -f-parsec -f-parsec-struct-diff --extra-include-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib --exact-configuration
@(System\Process\Log.hs:37:3)

-- While building custom Setup.hs for package Cabal-2.0.1.1 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --verbose --builddir=.stack-work\dist\5c8418a7 configure --with-ghc=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\b467f05c\pkgdb --libdir=C:\sr\snapshots\b467f05c\lib --bindir=C:\sr\snapshots\b467f05c\bin --datadir=C:\sr\snapshots\b467f05c\share --libexecdir=C:\sr\snapshots\b467f05c\libexec --sysconfdir=C:\sr\snapshots\b467f05c\etc --docdir=C:\sr\snapshots\b467f05c\doc\Cabal-2.0.1.1 --htmldir=C:\sr\snapshots\b467f05c\doc\Cabal-2.0.1.1 --haddockdir=C:\sr\snapshots\b467f05c\doc\Cabal-2.0.1.1 --dependency=Win32=Win32-2.5.4.1 --dependency=array=array-0.5.2.0 --dependency=base=base-4.10.1.0 --dependency=binary=binary-0.8.5.1 --dependency=bytestring=bytestring-0.10.8.2 --dependency=containers=containers-0.5.10.2 --dependency=deepseq=deepseq-1.4.3.0 --dependency=directory=directory-1.3.0.2 --dependency=filepath=filepath-1.4.1.2 --dependency=pretty=pretty-1.1.3.3 --dependency=process=process-1.6.1.0 --dependency=time=time-1.8.0.2 -f-bundled-binary-generic -f-old-directory -f-parsec -f-parsec-struct-diff --extra-include-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib --exact-configuration
Process exited with code: ExitFailure 1
Logs have been written to: C:\Users\nao\xyzzyi.stack-work\logs\Cabal-2.0.1.1.log

Access violation in generated code when reading 000000000e58391a

-- While building custom Setup.hs for package alex-3.2.4 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --verbose --builddir=.stack-work\dist\5c8418a7 configure --with-ghc=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\b467f05c\pkgdb --libdir=C:\sr\snapshots\b467f05c\lib --bindir=C:\sr\snapshots\b467f05c\bin --datadir=C:\sr\snapshots\b467f05c\share --libexecdir=C:\sr\snapshots\b467f05c\libexec --sysconfdir=C:\sr\snapshots\b467f05c\etc --docdir=C:\sr\snapshots\b467f05c\doc\alex-3.2.4 --htmldir=C:\sr\snapshots\b467f05c\doc\alex-3.2.4 --haddockdir=C:\sr\snapshots\b467f05c\doc\alex-3.2.4 --dependency=array=array-0.5.2.0 --dependency=base=base-4.10.1.0 --dependency=containers=containers-0.5.10.2 --dependency=directory=directory-1.3.0.2 -fsmall_base --extra-include-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib --exact-configuration
Process exited with code: ExitFailure 1
Logs have been written to: C:\Users\nao\xyzzyi.stack-work\logs\alex-3.2.4.log

Access violation in generated code when reading 000000000e58391a

-- While building custom Setup.hs for package dlist-0.8.0.4 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --verbose --builddir=.stack-work\dist\5c8418a7 configure --with-ghc=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\b467f05c\pkgdb --libdir=C:\sr\snapshots\b467f05c\lib --bindir=C:\sr\snapshots\b467f05c\bin --datadir=C:\sr\snapshots\b467f05c\share --libexecdir=C:\sr\snapshots\b467f05c\libexec --sysconfdir=C:\sr\snapshots\b467f05c\etc --docdir=C:\sr\snapshots\b467f05c\doc\dlist-0.8.0.4 --htmldir=C:\sr\snapshots\b467f05c\doc\dlist-0.8.0.4 --haddockdir=C:\sr\snapshots\b467f05c\doc\dlist-0.8.0.4 --dependency=base=base-4.10.1.0 --dependency=deepseq=deepseq-1.4.3.0 --extra-include-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib --exact-configuration
Process exited with code: ExitFailure 1
Logs have been written to: C:\Users\nao\xyzzyi.stack-work\logs\dlist-0.8.0.4.log

Access violation in generated code when reading 000000000e58391a

-- While building custom Setup.hs for package data-default-class-0.1.2.0 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --verbose --builddir=.stack-work\dist\5c8418a7 configure --with-ghc=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\b467f05c\pkgdb --libdir=C:\sr\snapshots\b467f05c\lib --bindir=C:\sr\snapshots\b467f05c\bin --datadir=C:\sr\snapshots\b467f05c\share --libexecdir=C:\sr\snapshots\b467f05c\libexec --sysconfdir=C:\sr\snapshots\b467f05c\etc --docdir=C:\sr\snapshots\b467f05c\doc\data-default-class-0.1.2.0 --htmldir=C:\sr\snapshots\b467f05c\doc\data-default-class-0.1.2.0 --haddockdir=C:\sr\snapshots\b467f05c\doc\data-default-class-0.1.2.0 --dependency=base=base-4.10.1.0 --extra-include-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\nao\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib --exact-configuration
Process exited with code: ExitFailure 1
Logs have been written to: C:\Users\nao\xyzzyi.stack-work\logs\data-default-class-0.1.2.0.log

Access violation in generated code when reading 000000000e58391a

~~~

This does look like an upstream issue. I'll check whether there have been reports (and do report here if you find anything, too).

https://phabricator.haskell.org/D3913 and https://ghc.haskell.org/trac/ghc/ticket/13911 (via https://ghc.haskell.org/trac/ghc/ticket/14825) look relevant.

In particular, all the logs say ghc-8.2.2, so I'm even more certain this is an upstream issue. The workaround looks a little painful, but I'm going to close (again) as the bug a) is in GHC, b) has been fixed there, and c) has a workaround.

@dbaynard Is there a fix? https://phabricator.haskell.org/D3913 will add stacktraces to the crashes (which will help debugging the actual issues), not prevent them; https://phabricator.haskell.org/D3911 might help tho by letting exceptions be handled...

@Blaisorblade Everything I found on the access violation bug implied that the issue was an error being wrongly reported, and so with correct error reporting either the problem would be obvious and easy to solve, or not obvious and may itself be an issue. So has the underlying issues has been fixed? I don't even know what that underlying issue might be.

Ah, you’ve convinced me; and your new comment might be useful to any archeologists investigating any underlying issues.

I have the same problem. Downloaded the haskell platform for windows, fresh install, set skip-msys: true in global config.yaml and ran

λ stack --version
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2
Access violation in generated code when reading 0000000094c22cc6

@gregorybleiker What GHC version? Have you tried the workaround?

@dbaynard I have version 8.4.3. I have not tried the workaround, as I don't even quite understand what it consists of...

@dbaynard I have the same issue when running

stack init
stack build
stack ghci

I get Access violation in generated code when reading 000000003ec40fc9. This occurs with resolver: lts-12.12 (GHC 8.4.3) and resolver: nightly-2018-10-11 (GHC 8.6.1), so it seems there is yet no fix. I get an Access violation error when trying to run Elm (as have a few others) so I'm wondering if this is related.

@dbaynard the same issue is there when I use resolver: ghc-8.0.1. Is there some sort of cache I need to clear?

I have this issue too on windows 10, I've cleaned out my LOCALAPPDATA and STACK_ROOT directories entirely. Interestingly the first time I do stack setup it works and downloads ghc, then the second time (see below) it also fails.

I have also struggled to understand the workaround... as far as I can tell the advise is to downgrade the Cabal (library) to a version that is ahead of mine (i'm using 1.10) and changing the resolver... I've tried changing the resolver to no avail - and it sounds like this is happening across multiple resolvers including 12-12 which is almost the latest out there.

image

λ .\build_on_windows.bat

set STACK_ROOT=c:\sr

set LOCALAPPDATA=c:\sr

.\stack.exe --version
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 hpack-0.31.0

.\stack.exe setup
Access violation in generated code when reading 0000000004bc4912

.\stack.exe build -v --cabal-verbose
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 hpack-0.31.0
2018-10-31 11:09:21.543838: [debug] Checking for project config at: D:\BDK\conductor\stack.yaml
2018-10-31 11:09:21.546836: [debug] Loading project config file stack.yaml
2018-10-31 11:09:21.552835: [debug] Potential GHC builds: standard
2018-10-31 11:09:21.552835: [debug] Found already installed GHC builds: standard
2018-10-31 11:09:21.558835: [debug] Getting global package database location
2018-10-31 11:09:21.560835: [debug] Getting Cabal package version
2018-10-31 11:09:21.560835: [debug] Asking GHC for its version
2018-10-31 11:09:21.562835: [debug] Run process: C:\sr\Programs\stack\x86_64-windows\ghc-8.0.1\bin\ghc-pkg.EXE --no-user-package-db list --global
Access violation in generated code when reading 0000000004bc4912

I have a work around that seems to be working for our team - downgrade stack to 1.6.3 (which we happened to have lying around)

I had quite a try to find out where the violation happens (ProcMon, DebugDiag) but I can't see any actual violation happening. This leads me to the question if it just showing this error for some other reason. Does anybody know what stack is trying to do at that point of time? It seems that the message is always the last output and I am not sure that the stack command is not actually completing inspite of the output.

@jamiecook that sounds nice! (In absence of a full solution.) I'd like to try it at some point. What version of GHC are you using with Stack 1.6.3?

I tried resolver lts-8.14 ghc8.0.1 and ghc8.0.2 using newer stack but none worked.
Switched back to stack 1.6.3 and lts-8.14 worked straight away

So I can reproduce at will it seems if you have diagnostics you'd like me to run?

@jamiecook That's very helpful indeed. I'll see what may have changed between 1.6.3 and 1.7.1. It does look like there ought to be changes to stack.

Presumably 1.9.1 shows the error, too?

I did not test against 1.7.1 - I only had the most recent version 1.9.1,
the git master branch version and the 1.6.1 version that i happened to have
checked into VCS

I am having the same issue with the stack-1.9.1, lts-12.17, ghc-8.4.4 combo. My machine is Windows 10... and here is a clue. I found that I can trigger and then fix the problem by setting/unsetting the __COMPAT_LAYER environment variable:

C:\>set __COMPAT_LAYER=Installer
C:\>stack --version
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 hpack-0.31.0
Access violation in generated code when reading 0000000094c8bcba
C:\>set __COMPAT_LAYER=
C:\>stack --version
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 hpack-0.31.0
C:\>

The culprit seems to set it to the "Installer" value. I tried a couple of others, and that did not seem to have any effect.

@Blaisorblade Does __COMPAT_LAYER mean anything to you?

@boriskro Thank you for the clue! @jamiecook Does that fix the issue you can reproduce at will?

I tried getting 1.6.3 from here
https://github.com/commercialhaskell/stack/releases/download/v1.6.3/stack-1.6.3-windows-x86_64-installer.exe
(via here https://github.com/commercialhaskell/stack/releases)

Running stack I unfortunately still see this

> stack --version
Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0
Segmentation fault/access violation in generated code

I'll attempt some compatibility mode tweaks and see what happens.

[EDIT] I can't get stack to work with compatibility mode changes.

We have similar issue. Any stack command, even 'stack --version', ends with the 'access violation message'. It seems to do the job properly, but fails in the very end.

> stack --version
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 hpack-0.31.0
Access violation in generated code when reading 0000000094c8bcba

However, when running shell NOT as administrator the problems goes away.
OS: Windows 10

@dbaynard @boriskro It sure does!

λ stack-1.9.1.exe --version
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 hpack-0.31.0

D:\BDK\conductor (master)
λ stack-1.9.1.exe build
Access violation in generated code when reading 0000000004bc4912

D:\BDK\conductor (master)
λ set __COMPAT_LAYER=

D:\BDK\conductor (master)
λ stack-1.9.1.exe build
[1 of 2] Compiling Main             ( F:\sr\setup-exe-src\setup-Z6RU0evB.hs, F:\sr\setup-exe-src\setup-Z6RU0evB.o )
[2 of 2] Compiling StackSetupShim   ( F:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs, F:\sr\setup-exe-src\setup-shim-Z6RU0evB.o )
Linking F:\sr\setup-exe-cache\x86_64-windows\tmp-Cabal-simple_Z6RU0evB_1.24.2.0_ghc-8.0.2.exe ...

@stevladimir Does the __COMPAT_LAYER workaround in https://github.com/commercialhaskell/stack/issues/3765#issuecomment-436407467 work for you?

@dbaynard I don't know, but here's my first round of hypotheses to be tested. But all of these are wild guesses

Seems a variable used to run application in different "compatibility modes", changing behavior of system APIs — tho I can't find that setting around (https://stackoverflow.com/a/37881453/53974). Probably some code (in GHC? in the Haskell runtime system for Stack?) doesn't handle correctly the behavior in one case. For instance, maybe some system API call fails when __COMPAT_LAYER is Installer, and the crashing code doesn't handle failures correctly.

It's strange that the variable would be set to Installer; the only reference to this value that I found was that __COMPAT_LAYER=Installer is set when running (MSI) installers? Maybe the environment is stored by some installer for later use?

@dbaynard Yes it works.
Setting/unsetting this variable to "Installer" turns on/off the erroneous behaviour.

>stack --version
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 hpack-0.31.0
>set __COMPAT_LAYER=Installer
>stack --version
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 hpack-0.31.0
Access violation in generated code when reading 0000000094c8bcba
>set __COMPAT_LAYER=
>stack --version
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 

Though now we cannot reproduce the error in a sense that unless we explicitly set __COMPAT_LAYER=Installer after starting the shell, there is no errors. And there is no differences whether it is administrator or ordinary user shell.
So I do believe that when we encountered it the environment was modified by another process, but after reboot we got the clean environment and the error went away.

@Blaisorblade I found the same resources; they did not help me.

@stevladimir Thanks.

I'm not sure what to do with this issue. As noted above (https://github.com/commercialhaskell/stack/issues/3765#issuecomment-400499983 and the following comments) there is a known bug in GHC, which has been fixed. Everything I've seen since would be consistent with that.

The best solution, it seems, is to unset __COMPAT_LAYER. It would be helpful if any further reports would note the stack version, resolver (and GHC version if different to resolver default), whether the __COMPAT_LAYER fix helps, and whether the error is reproducible by setting __COMPAT_LAYER=Installer. Also there's a chance it could be antivirus related — do set an exception for stack, and indicate whether that fixes the issue.

@dbaynard Maybe Windows version, installation method, and whether rebooting helps would also be useful?

But otherwise, I agree it's unclear whether anything needs to be done.
If somebody wants to go above and beyond, documenting this as a GHC issue somewhere could be enough. Writing a summary somewhere sensible (FAQ? website? dunno?) would avoid people having to browse this issue, but that seems it?

Somehow we all missed Trac #13112.

As pointed out at https://github.com/haskell-tools/haskell-tools/issues/277#issuecomment-332917356

In short, this is caused when Template Haskell code is placed on a memory address above 2GB.
Walkaround [sic]: Use the -fexternal-interpreter GHC flag.

Do indicate if this fixes your issues.

Closing as upstream bug with documented workaround

Just as a note for anybody else. I noticed that if I run cmd as administrator I would get this issue. Now I'm not running as admin I don't have the error occur. This meant I could avoid any other workarounds.

@snoyberg how do you figure it's an upstream bug? Does stack --version actually call into GHC??

I just reinstalled windows and with same project same LTS i get this error too now. Only this time i installed stack with chocolatey, but i don't suspect this is the root cause. Project uses LTS-14.14

$ stack --version
Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2
Access violation in generated code when reading 0000000094cdeebe

@flip111 The diagnosis is in https://github.com/commercialhaskell/stack/issues/3765#issuecomment-460651087. Not sure about stack --version itself segfaulting.

@Blaisorblade i saw this diagnosis. I also saw all the posts before it using stack --version. I think the link to trac is useful and could be related but it's not a GHC problem when calling stack --version. Here are the posts:

https://github.com/commercialhaskell/stack/issues/3765#issuecomment-397870313
https://github.com/commercialhaskell/stack/issues/3765#issuecomment-421236378
https://github.com/commercialhaskell/stack/issues/3765#issuecomment-436407467
https://github.com/commercialhaskell/stack/issues/3765#issuecomment-436752569
https://github.com/commercialhaskell/stack/issues/3765#issuecomment-437271539
https://github.com/commercialhaskell/stack/issues/3765#issuecomment-437823698

I'm not 100% certain, but it feels like the issue reported by @flip111 and @rubin55, namely

Access violation in generated code when reading 0000000094cdeebe

is in fact not the same as GHC #13112 (Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff).

As such, I have opened GHC #17635 (Windows compatibility settings cause segfault in GetProcAddress?)

I was encountering this segfault in IntelliJ Haskell (see https://github.com/rikvdkleij/intellij-haskell/issues/450#issuecomment-570779968), because Windows (Defender?) was setting the environmental variable __COMPAT_LAYER=DetectorsAppHealth whenever IntelliJ spawned stack. As others have found, unsetting this environmental variable helps.

As such, I have opened GHC #17635 (Windows compatibility settings cause segfault in GetProcAddress?)

Currently, stack is compiled with GHC 8.2.2. This bug turns out to be an issue fixed in GHC 8.4.1. Also sounds like there was a similar subsequent fix, which only made it into GHC 8.6.5 and 8.8.1.

The workaround, that programs that call stack on Windows should set __COMPAT_LAYER="", will presumably continue to work.

But ultimately, to fix this issue, a build of stack made with a newer version of GHC would be nice. However, it looks like a significant reason that stack is deliberately compiled with GHC 8.2.2, is for Windows 😛.

Closing as upstream bug with documented workaround

The workaround, that programs that call stack on Windows should set __COMPAT_LAYER="", will presumably continue to work.

__COMPAT_LAYER= does not seem to have any effect on stack.exe execution.
I have tried setting this environment variable from a .cmd script, and a PowerShell script before running stack.exe.
I see the

Access violation in generated code when reading 0000000094cdeebe

every time I run it. This effectively breaks the IntelliJ integration with no workaround.

I am running Windows 10, build 1909.
stack installed by the Windows 64-bit Installer downloaded from https://docs.haskellstack.org/en/stable/README/.

Any suggestions?

I have tried all the Windows versions in compatibility settings on the stack.exe. And none worked.
But then after I have restored to the default "no compatibility", stack.exe stopped showing the error in the command line. Apparently, there is some state beyond just the compatibility settings visible in the UI.

Yet, when started from IntelliJ, it was still failing.
But now, creating a batch script that sets __COMPAT_LAYER= to an empty string, makes stack.exe work when started from IntelliJ.

So, in the end it works. But I do not understand how my system got into this state.
And it is 100% certain that it was not just the __COMPAT_LAYER=.

Searched the registry for stack.exe. Only found references to stack.exe in keys of the BAM service, and the Telemetry Client service. None should be relevant, I think.

I unticked this box to stop access violation 0000000094cdeebe:
image

Kinda strange that a setting designed for a 3D accelerated app causes an issue with a CLI application.

Was this page helpful?
0 / 5 - 0 ratings