Opened 2 years ago

Closed 21 months ago

#14496 closed bug (wontfix)

Invoking GHC 8.2.1 executable anywhere results in access violation on Windows 10

Reported by: RyanGlScott Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.2.1
Keywords: Cc: Phyx-
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: GHC doesn't work at all Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

This apparently started to happen somewhat recently, as I've been able to run GHC 8.2.1 on Windows before. (Perhaps it was a recent update that changed things?) In any case, any attempt to run GHC or GHCi 8.2.1 immediately results in an access violation, and always at the same memory location:

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.2.1

$ ghc
Access violation in generated code when reading 000000001170399e

$ ghci
WARNING: GHCi invoked via 'ghci.exe' in MinTTY consoles (e.g., Cygwin or MSYS)
         doesn't handle Ctrl-C well; use the 'ghcii.sh' shell wrapper instead
GHCi, version 8.2.1: http://www.haskell.org/ghc/  :? for help
Access violation in generated code when reading 000000001170399e

Strangely enough, GHC 8.0.2 and older do not suffer from this issue, just 8.2.1.

In case it's useful, here's the strace output:

$ strace ghc
Access violation in generated code when reading 000000001170399e
create_child: ghc
--- Process 10324 created
--- Process 10324 loaded C:\Windows\System32\ntdll.dll at 00007ffa31280000
--- Process 10324 loaded C:\Windows\System32\kernel32.dll at 00007ffa31170000
--- Process 10324 loaded C:\Windows\System32\KernelBase.dll at 00007ffa2dd40000
--- Process 10324 loaded C:\Windows\System32\apphelp.dll at 00007ffa2b500000
--- Process 10324 loaded C:\Windows\System32\AcLayers.dll at 00007ffa03630000
--- Process 10324 loaded C:\Windows\System32\msvcrt.dll at 00007ffa30ab0000
--- Process 10324 loaded C:\Windows\System32\user32.dll at 00007ffa2e850000
--- Process 10324 loaded C:\Windows\System32\win32u.dll at 00007ffa2dba0000
--- Process 10324 loaded C:\Windows\System32\gdi32.dll at 00007ffa2ec30000
--- Process 10324 loaded C:\Windows\System32\gdi32full.dll at 00007ffa2da00000
--- Process 10324 loaded C:\Windows\System32\msvcp_win.dll at 00007ffa2d960000
--- Process 10324 loaded C:\Windows\System32\ucrtbase.dll at 00007ffa2dbc0000
--- Process 10324 loaded C:\Windows\System32\shlwapi.dll at 00007ffa2e7f0000
--- Process 10324 loaded C:\Windows\System32\combase.dll at 00007ffa30e50000
--- Process 10324 loaded C:\Windows\System32\rpcrt4.dll at 00007ffa2e9e0000
--- Process 10324 loaded C:\Windows\System32\bcryptprimitives.dll at 00007ffa2dcc0000
--- Process 10324 loaded C:\Windows\System32\sfc.dll at 0000000180000000
--- Process 10324 loaded C:\Windows\System32\winspool.drv at 00007ffa1db00000
--- Process 10324 loaded C:\Windows\System32\IPHLPAPI.DLL at 00007ffa2cb90000
--- Process 10324 loaded C:\Windows\System32\bcrypt.dll at 00007ffa2d0d0000
--- Process 10324 loaded C:\Windows\System32\sfc_os.dll at 00007ffa1c2e0000
--- Process 10324 loaded C:\Windows\System32\imm32.dll at 00007ffa31220000
--- Process 10324 loaded C:\Windows\System32\shell32.dll at 00007ffa2ef80000
--- Process 10324 loaded C:\Windows\System32\cfgmgr32.dll at 00007ffa2e700000
--- Process 10324 thread 3948 created
--- Process 10324 loaded C:\Windows\System32\SHCore.dll at 00007ffa30cf0000
--- Process 10324 loaded C:\Windows\System32\windows.storage.dll at 00007ffa2dfb0000
--- Process 10324 loaded C:\Windows\System32\advapi32.dll at 00007ffa30da0000
--- Process 10324 loaded C:\Windows\System32\sechost.dll at 00007ffa2eb00000
--- Process 10324 thread 4764 created
--- Process 10324 loaded C:\Windows\System32\kernel.appcore.dll at 00007ffa2d660000
--- Process 10324 loaded C:\Windows\System32\powrprof.dll at 00007ffa2d5f0000
--- Process 10324 loaded C:\Windows\System32\profapi.dll at 00007ffa2d5d0000
--- Process 10324 thread 3852 created
--- Process 10324 loaded C:\Windows\System32\wsock32.dll at 00007ffa1c2b0000
--- Process 10324 loaded C:\Windows\System32\ws2_32.dll at 00007ffa2ef10000
--- Process 10324 loaded C:\Windows\System32\ws2_32.dll at 0000000000150000
--- Process 10324 unloaded DLL at 0000000000150000
--- Process 10324 thread 4872 created
--- Process 10324 thread 5780 created
--- Process 10324 thread 8360 created
--- Process 10324, exception c0000005 at 00007ffa3129c12e
--- Process 10324 thread 8360 exited with status 0x1
--- Process 10324 thread 5780 exited with status 0x1
--- Process 10324 thread 4872 exited with status 0x1
--- Process 10324 thread 3852 exited with status 0x1
--- Process 10324 thread 4764 exited with status 0x1
--- Process 10324 thread 3948 exited with status 0x1
--- Process 10324 exited with status 0x1

Change History (5)

comment:1 Changed 2 years ago by Phyx-

Could you use https://docs.microsoft.com/en-us/sysinternals/downloads/procdump to generate a crash dump for me? using -t -ma.

Also what's your OS version? (use powershell and Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, ServicePackMajorVersion, OSArchitecture | Format-List *

comment:2 in reply to:  1 Changed 2 years ago by RyanGlScott

Replying to Phyx-:

Could you use https://docs.microsoft.com/en-us/sysinternals/downloads/procdump to generate a crash dump for me? using -t -ma.

Here's the PowerShell output:

$ .\Procdump\procdump64.exe -t -ma -e 1 -x . C:\Users\RyanGlScott\Software\ghc-8.2.1\bin\ghc.exe

ProcDump v9.0 - Sysinternals process dump utility
Copyright (C) 2009-2017 Mark Russinovich and Andrew Richards
Sysinternals - www.sysinternals.com

Process:               ghc.exe (9372)
CPU threshold:         n/a
Performance counter:   n/a
Commit threshold:      n/a
Threshold seconds:     n/a
Hung window check:     Disabled
Log debug strings:     Disabled
Exception monitor:     First Chance+Unhandled
Exception filter:      [Includes]
                       *
                       [Excludes]
Terminate monitor:     Enabled
Cloning type:          Disabled
Concurrent limit:      n/a
Avoid outage:          n/a
Number of dumps:       1
Dump folder:           .\
Dump filename/mask:    PROCESSNAME_YYMMDD_HHMMSS
Queue to WER:          Disabled
Kill after dump:       Disabled


Press Ctrl-C to end monitoring without terminating the process.

[07:35:22] Exception: C0000005.ACCESS_VIOLATION
[07:35:22] Dump 1 initiated: .\ghc.exe_171121_073522.dmp
[07:35:24] Dump 1 writing: Estimated dump file size is 124 MB.
[07:35:26] Dump 1 complete: 124 MB written in 4.0 seconds
Access violation in generated code when reading 000000001170399e
[07:35:27] Dump count reached.

I'll attach the full log separately.

Also what's your OS version? (use powershell and Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, ServicePackMajorVersion, OSArchitecture | Format-List *

$ Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, ServicePackMajorVersion,
 OSArchitecture | Format-List *


Caption                 : Microsoft Windows 10 Home
Version                 : 10.0.16299
ServicePackMajorVersion : 0
OSArchitecture          : 64-bit

comment:3 Changed 2 years ago by RyanGlScott

The dump file is too large to attach, so here's a link:

https://www.dropbox.com/s/efm2pmm6t3875g9/ghc.exe_171121_073522.dmp?dl=0

comment:4 Changed 2 years ago by RyanGlScott

It's also worth noting that this does not happen on GHC 8.2.2 or HEAD builds. So only 8.2.1 seems to suffer from this issue!

comment:5 Changed 21 months ago by RyanGlScott

Resolution: wontfix
Status: newclosed

It seems we never did figure out what was causing this. But 8.2.2 works, so I'm opting to close this.

Note: See TracTickets for help on using tickets.