[GHC] #15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer)

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Keywords: | Operating System: Windows Architecture: x86_64 | Type of failure: Compile-time (amd64) | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- After the series of SRT overhaul patches GHC doesn't work on Windows 64-bit. GHC executable crashes (AV) on any attempt to compile anything or even to start in interactive mode. When crashed it report crash address which may look not as a real address at all (e.g. 0x800 or 0xffffffffffffffff) and may report either reading from or executing such an address. OTOH, when started with, e.g. `+RTS -A256m -RTS` it is able to compile some programs (`haddock` at least). Reverting all related commits down to eb8e692cab7970c495681e14721d05ecadd21581 make things work again. I have no proof that things went bad exactly at eb8e692cab7970c495681e14721d05ecadd21581. Perhaps, this happened later on, but I have a proof that things were good immediately before. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * priority: high => highest * cc: simonmar (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonmar): * cc: Phyx- (added) Comment: Sorry about this. Of course if we're not able to resolve this quickly we should back out the patches. I don't have any theories yet about what the cause might be, and I don't have easy access to a machine to test on; @bgamari would you be able to take a look by any chance? or @Phyx-? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by awson): Don't know if this would make things any clearer, but changing `-A` parameter I've also managed to trigger `ARR_WORDS object entered!` and `Evaluated a CAF that was GC'd!` internal errors. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): I can add it to my list but it may not be until later in the week until I get to it. Perhaps we should revert for now. Unfortunately this is all very messy since ec22f7ddc81b40a9dbcf140e5cf44730cb776d00 conflicted. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): I am unable to reproduce the complete failure scenario @awson is seeing. {{{ Tamar@Pinky MINGW64 ~/ghc $ inplace/bin/ghc-stage2.exe --version The Glorious Glasgow Haskell Compilation System, version 8.5.20180521 Tamar@Pinky MINGW64 ~/ghc $ inplace/bin/ghc-stage2.exe -fforce-recomp hello.hs [1 of 1] Compiling Main ( hello.hs, hello.o ) Linking hello.exe ... Tamar@Pinky MINGW64 ~/ghc $ ./hello.exe Hello World }}} That said, the bindisttest does fail with: {{{ ghc-cabal.exe: 'E:/ghc- dev/msys64/home/Tamar/ghc/bindistprep/ghc-8.5.20180521/bin/ghc.exe' exited with an error: ghc.exe: internal error: evacuate: strange closure type 912 (GHC version 8.5.20180521 for x86_64_unknown_mingw32) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonmar): Could someone who is able to repro this, please recompile stage 2 with `-debug`: {{{ cd ghc make re2 GhcDebugged=YES }}} and then see if the error message is different. This will tell us whether it's a case of some CAF being garbage collected when it shouldn't be, or something else. (incidentally the above workflow would be good to support in Hadrian, it's something I do a lot) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonmar): There's nothing Windows-specific in the GC'ing of CAFs that I'm aware of. There are no Windows-specific conditionals in the SRT code generation, nor in the garbage collector, so I'm mystified about how this is failing. The only wrinkle I know about is the old `COMPILING_WINDOWS_DLL` hacks that we had to support SRT references in another DLL: https://phabricator.haskell.org/diffusion/GHC/browse/master/rts/sm/Scav.c;bf... I removed that code, but it wasn't active in any case because we aren't doing shared libraries on Windows, and as far as I could tell it couldn't have worked anyway because the code generator had no support for generating these references (that part probably got lost earlier). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by awson): Have done this for `main = putStrLn "Hello, world"`. With `-A` less than `8m` it segfaults, with `8m` and `9m` compiles successfully, from `10m` to `15m` spits `Evaluated a CAF that was GC'd!` internal error, on `16m` and above compiles successfully. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by awson): @simonmar Btw, did you see #15173? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by awson): Forgot to add: mine GHC build is `perf` (fully optimized GHC executable). Perhaps @Phyx- uses different build options (hence, no segfaults)? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): Ah yes that would explain the difference. I was using the default validate build. I will try a perf build when I get home. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4721 Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonmar): * differential: => Phab:D4721 Comment: Found a bug, see Phab:D4721. Hopefully this will fix Windows too. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4721 Wiki Page: | -------------------------------------+------------------------------------- Comment (by awson): Have rebuilt with the patch. No problems so far. Great! Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and
newer)
-------------------------------------+-------------------------------------
Reporter: awson | Owner: (none)
Type: bug | Status: new
Priority: highest | Milestone: 8.6.1
Component: Compiler | Version: 8.5
Resolution: | Keywords:
Operating System: Windows | Architecture: x86_64
Type of failure: Compile-time | (amd64)
crash or panic | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4721
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Simon Marlow

#15168: GHC HEAD crashes on Windows 64 after the SRT overhaul (May 16, 2018 and newer) -------------------------------------+------------------------------------- Reporter: awson | Owner: (none) Type: bug | Status: closed Priority: highest | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: fixed | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4721 Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonmar): * status: new => closed * resolution: => fixed Comment: Thanks for all the help with diagnosing and testing folks. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15168#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC