[GHC] #8698: .ctors handling does not work on Windows 64-bit ghci

#8698: .ctors handling does not work on Windows 64-bit ghci ----------------------------------+------------------------------- Reporter: awson | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Keywords: | Operating System: Windows Architecture: x86_64 (amd64) | Type of failure: GHCi crash Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ----------------------------------+------------------------------- When fixing #7134 I've found .ctors section handling does not work on 64-bit Windows ghci. Patch https://ghc.haskell.org/trac/ghc/attachment/ticket/7134/ghc- w64fix.patch now disables .ctor handling for 64-bit Windows ghci. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+---------------------------------- Reporter: awson | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+---------------------------------- Comment (by awson): https://ghc.haskell.org/trac/ghc/attachment/ticket/7134/ghc-w64fix.patch is updated to mark relevant places with the number of this ticket (#8698). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+---------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+---------------------------------- Changes (by ezyang): * cc: ezyang (added) * owner: => ezyang Comment: Can you upload the object file in question? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+---------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+---------------------------------- Comment (by awson): Done. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+---------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+---------------------------------- Comment (by awson): Also, it might be necessary to add {{{RTS_WIN64_ONLY(SymI_HasProto(FreeEnvironmentStringsW))}}} to {{{RTS_MINGW_ONLY_SYMBOLS}}} definition. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+---------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+---------------------------------- Comment (by ezyang): OK, I can't figure out what the problem is just by eyeballing the code, so I'll need to reproduce this on my machine. Can you give detailed instructions for reproduction? What patches do I need to apply? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+---------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+---------------------------------- Comment (by thoughtpolice): You can set yourself up a 64bit Windows MSYS environment following this if you don't have one already: https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows/MSYS2 FWIW, me and Herbert also saw this failure. It can be triggered by a vanilla perf build, i.e. just clone and: {{{ $ ./boot; ./configure $ make }}} should trigger it while building stage2 libraries. Note that for some exceptionally strange reason, me and Herbert could not produce these results with `./validate` - you must do a regular perf build. I have not merged Kyra's patch for #7134 yet - so right now the build should still fail, no patches necessary. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+---------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+---------------------------------- Comment (by thoughtpolice): I'll also mention that I do have a internet-facing Win64 build machine where you could reproduce this error from too, if you want (but a local VM would probably be easier.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+---------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+---------------------------------- Comment (by ezyang): NB: #7134 has since been merged, so that patch needs tob e taken out. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+---------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+---------------------------------- Comment (by ezyang): This patch seems to be enough to do that: {{{ diff --git a/rts/Linker.c b/rts/Linker.c index b9c8fd0..649df7f 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -211,9 +211,7 @@ static int ocAllocateSymbolExtras_ELF ( ObjectCode* oc ); static int ocVerifyImage_PEi386 ( ObjectCode* oc ); static int ocGetNames_PEi386 ( ObjectCode* oc ); static int ocResolve_PEi386 ( ObjectCode* oc ); -#if !defined(x86_64_HOST_ARCH) static int ocRunInit_PEi386 ( ObjectCode* oc ); -#endif static void *lookupSymbolInDLLs ( unsigned char *lbl ); static void zapTrailingAtSign ( unsigned char *sym ); static char *allocateImageAndTrampolines ( @@ -2875,10 +2873,8 @@ resolveObjs( void ) #if defined(OBJFORMAT_ELF) r = ocRunInit_ELF ( oc ); #elif defined(OBJFORMAT_PEi386) -#if !defined(x86_64_HOST_ARCH) /* It does not work on x86_64 yet. #8698. */ r = ocRunInit_PEi386 ( oc ); -#endif #elif defined(OBJFORMAT_MACHO) r = ocRunInit_MachO ( oc ); #else @@ -4415,7 +4411,6 @@ ocResolve_PEi386 ( ObjectCode* oc ) } /* It does not work on x86_64 yet. #8698. */ -#if !defined(x86_64_HOST_ARCH) static int ocRunInit_PEi386 ( ObjectCode *oc ) { @@ -4458,7 +4453,6 @@ ocRunInit_PEi386 ( ObjectCode *oc ) freeProgEnvv(envc, envv); return 1; } -#endif #endif /* defined(OBJFORMAT_PEi386) */ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+---------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+---------------------------------- Comment (by ezyang): I've identified the bug: our section name comparison function only handles short names, but the relocation here is a long name. Cooking up a fix. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+------------------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Easy (less than 1 hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+------------------------------------------- Changes (by ezyang): * difficulty: Unknown => Easy (less than 1 hour) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci
-------------------------------+-------------------------------------------
Reporter: awson | Owner: ezyang
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.1-rc1
Resolution: | Keywords:
Operating System: Windows | Architecture: x86_64 (amd64)
Type of failure: GHCi crash | Difficulty: Easy (less than 1 hour)
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------+-------------------------------------------
Comment (by Edward Z. Yang

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+------------------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Easy (less than 1 hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+------------------------------------------- Changes (by ezyang): * status: new => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+------------------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Easy (less than 1 hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+------------------------------------------- Comment (by awson): At 4323: {{{errorBelch("%" PATH_FMT ": can't find section named: ", oc->fileName);}}} named as what? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+------------------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Easy (less than 1 hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+------------------------------------------- Comment (by ezyang): It's printed using `printName` the next line. There might be a better way of doing this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+------------------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Easy (less than 1 hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+------------------------------------------- Comment (by awson): Ah, sorry, I've overlooked this. `printName` uses `debugBelch` though. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+------------------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Easy (less than 1 hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+------------------------------------------- Comment (by ezyang): Oh, that is not going to work properly then. Hm, I guess we could parametrize printName with which belch function to use? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+------------------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: merge Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Easy (less than 1 hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+------------------------------------------- Changes (by thoughtpolice): * milestone: => 7.8.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8698: .ctors handling does not work on Windows 64-bit ghci -------------------------------+------------------------------------------- Reporter: awson | Owner: ezyang Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: fixed | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Difficulty: Easy (less than 1 hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------+------------------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8698#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC