Skip to content

[Windows]. ghc 8.8.3 compile error: 'Access violation in generated code when writing 0x0' #5353

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
JackismyShephard opened this issue Jul 28, 2020 · 4 comments

Comments

@JackismyShephard
Copy link

JackismyShephard commented Jul 28, 2020

General summary/comments

I am having trouble compiling with ghc 8.8.3 on windows 10. I get the error 'Access violation in generated code when writing 0x0'. It should be noted that i a year ago had an installation of haskell platform which i uninstalled (along with stack) some time ago. I just today (28/07/2020) installed stack 2.3.1.

I realize this issue has been brought up before in different contexts, however i am not sure if a solution has actually been found. I apologize in advance, if the error is all my own.

Steps to reproduce

run

stack ghc helloWorld.hs

on command prompt,

where helloWorld.hs contains:

main :: IO ()
main = putStrLn "Hello World!"

Expected

The following files generated:

  • helloWorld.hi
  • helloWorld.o
  • helloWorld.exe

Actual

The following printed on command line:

[1 of 1] Compiling Main             ( helloWorld.hs, helloWorld.o )
Linking helloWorld.exe ...

Access violation in generated code when writing 0x0

Attempting to reconstruct a stack trace...

Frame        Code address
* 0x461da80    0x37f7b66 C:\Users\Jacki\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\bin\ghc.exe+0x33f7b66
* 0x461da88    0x3277bb9 C:\Users\Jacki\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\bin\ghc.exe+0x2e77bb9
* 0x461da90    0x5
* 0x461da98    0x5
* 0x461daa0    0x3d7dc22 C:\Users\Jacki\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.3\bin\ghc.exe+0x397dc22
* 0x461daa8    0x785cca0

And no helloWorld.exe is generated.

Stack version

Version 2.3.1, Git revision de2a7b6 (8103 commits) x86_64 hpack-0.33.0

Method of installation

Further Notes

I just tried installing stack on a laptop with no prior installation of anything related to haskell and there is no problem compiling there.

@tuomohopia
Copy link

I keep hitting the same problem. Can't run any Haskell at all right now due to it.

@mpilgrem
Copy link
Member

mpilgrem commented Aug 6, 2020

I think this is an upstream issue with GHC 8.8.3 and Windows 10 version 2004, fixed in GHC 8.8.4. See: https://www.haskell.org/ghc/blog/20200715-ghc-8.8.4-released.html and https://downloads.haskell.org/~ghc/8.8.4/docs/html/users_guide/8.8.4-notes.html#highlights

Microsoft has been rolling out the upgrade of Windows 10 to version 2004 since late May.

@hanjoosten
Copy link

I ran into this problem too. It has been reported on the haskell-ide-engine site as well. I thought it could be useful to add that link here.

@NikolaiPohodenko
Copy link

this issue duplicates #5313 and #5347
a solution is proposed here

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

No branches or pull requests

6 participants