[GHC] #14075: GHC panic with parallel make

#14075: GHC panic with parallel make -------------------------------------+------------------------------------- Reporter: inaki | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Compile-time Unknown/Multiple | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: #13803, #13981 Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Consider the following modules: {{{#!hs -- F.hs module F () where }}} {{{#!hs -- F.hs-boot module F where import O (O) newtype F = F () instance O F where }}} {{{#!hs -- O.hs module O (O) where class O a where }}} {{{#!hs -- V.hs module V () where import {-# SOURCE #-} F () }}} {{{#!hs -- V.hs-boot module V where }}} If I try to compile this with {{{ ghc -j2 F O V }}} I get {{{ [1 of 4] Compiling O ( O.hs, O.o ) [2 of 4] Compiling F[boot] ( F.hs-boot, F.o-boot ) [3 of 4] Compiling F ( F.hs, F.o ) <no location info>: error: ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.2.0.20170720 for x86_64-unknown-linux): tcIfaceGlobal (local): not found You are in a maze of twisty little passages, all alike. While forcing the thunk for TyThing F which was lazily initialized by initIfaceCheck typecheckLoop, I tried to tie the knot, but I couldn't find F in the current type environment. If you are developing GHC, please read Note [Tying the knot] and Note [Type-checking inside the knot]. Consider rebuilding GHC with profiling for a better stack trace. Contents of current type environment: [r1hL :-> Identifier ‘$trModule’] Call stack: CallStack (from HasCallStack): prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable pprPanic, called at compiler/iface/TcIface.hs:1696:23 in ghc:TcIface Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} On the other hand {{{ ghc -j1 F O V }}} works just fine, and gives the expected {{{ [2 of 5] Compiling O ( O.hs, O.o ) [3 of 5] Compiling F[boot] ( F.hs-boot, F.o-boot ) [4 of 5] Compiling F ( F.hs, F.o ) F.hs-boot:7:1: error: ‘F.F’ is exported by the hs-boot file, but not exported by the module | 7 | newtype F = F () | ^^^^^^^^^^^^^^^^ F.hs:1:1: error: instance O.O F.F -- Defined at F.hs-boot:8:10 is defined in the hs-boot file, but not in the module itself | 1 | -- F.hs | ^ }}} The example is a little bit sick, in that the original code is not expected to compile. I run into this by accident when trying to construct a minimal example of the issue reported in #13803 (note that that bug is marked as closed, but the original issue reported there remains unfixed, I am trying to construct a minimal testcase for the original issue there). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14075 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14075: GHC panic with parallel make -------------------------------------+------------------------------------- Reporter: inaki | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13803, #13981 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: ezyang (added) * priority: normal => high * milestone: => 8.4.1 Comment: This is a regression from GHC 8.0.2: {{{ $ /opt/ghc/8.0.2/bin/ghc -j2 -fforce-recomp F O V [1 of 4] Compiling O ( O.hs, O.o ) [2 of 4] Compiling F[boot] ( F.hs-boot, F.o-boot ) [3 of 4] Compiling F ( F.hs, F.o ) F.hs-boot:7:1: error: ‘F.F’ is exported by the hs-boot file, but not exported by the module F.hs:1:1: error: instance O.O F.F -- Defined at F.hs-boot:8:10 is defined in the hs-boot file, but not in the module itself }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14075#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14075: GHC panic with parallel make -------------------------------------+------------------------------------- Reporter: inaki | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.2 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13803, #13981 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.4.1 => 8.2.2 Comment: In that case let's perhaps try fixing this for 8.2.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14075#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14075: GHC panic with parallel make -------------------------------------+------------------------------------- Reporter: inaki | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.2 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: hs-boot Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13803, #13981 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by ezyang): * keywords: => hs-boot -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14075#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14075: GHC panic with parallel make -------------------------------------+------------------------------------- Reporter: inaki | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.2 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: hs-boot Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13803, #13981 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by ezyang): In parallel mode I see: {{{ Re-typechecking loop: [F, F] compile: input file F.hs *** Checking old interface for F (use -ddump-hi-diffs for more details): [3 of 4] Compiling F ( F.hs, F.o ) }}} which is wrong wrong wrong; the retypecheck loop MUST NOT contain F (compare with non-parallel output; nothing needs to get retypechecked before we do F). So this is definitely a parallel specific bug. Workaround should be to not use parallel compilation. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14075#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14075: GHC panic with parallel make -------------------------------------+------------------------------------- Reporter: inaki | Owner: (none) Type: bug | Status: patch Priority: high | Milestone: 8.2.2 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: hs-boot Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13803, #13981 | Differential Rev(s): Phab:D3815 Wiki Page: | -------------------------------------+------------------------------------- Changes (by ezyang): * status: new => patch * differential: => Phab:D3815 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14075#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14075: GHC panic with parallel make
-------------------------------------+-------------------------------------
Reporter: inaki | Owner: (none)
Type: bug | Status: patch
Priority: high | Milestone: 8.2.2
Component: Compiler | Version: 8.2.1
Resolution: | Keywords: hs-boot
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash or panic | Test Case:
Blocked By: | Blocking:
Related Tickets: #13803, #13981 | Differential Rev(s): Phab:D3815
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14075: GHC panic with parallel make -------------------------------------+------------------------------------- Reporter: inaki | Owner: (none) Type: bug | Status: merge Priority: high | Milestone: 8.2.2 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: hs-boot Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13803, #13981 | Differential Rev(s): Phab:D3815 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14075#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14075: GHC panic with parallel make -------------------------------------+------------------------------------- Reporter: inaki | Owner: (none) Type: bug | Status: merge Priority: high | Milestone: 8.2.2 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: hs-boot Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13803, #13981 | Differential Rev(s): Phab:D3815 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Merged with acde16b879b08dff6f1f01d3dede04771f533256. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14075#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14075: GHC panic with parallel make -------------------------------------+------------------------------------- Reporter: inaki | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.2.2 Component: Compiler | Version: 8.2.1 Resolution: fixed | Keywords: hs-boot Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13803, #13981 | Differential Rev(s): Phab:D3815 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14075#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC