Skip to content

GHC HEAD's ghc-stage1 panics on Data.Typeable.Internal

When doing a default build of GHC HEAD (i.e. without mk/build.mk), GHC panics:

$ make V=0 
===--- building phase 0
make --no-print-directory -f ghc.mk phase=0 phase_0_builds
make[1]: Nothing to be done for 'phase_0_builds'.
===--- building phase 1
make --no-print-directory -f ghc.mk phase=1 phase_1_builds
make[1]: Nothing to be done for 'phase_1_builds'.
===--- building final phase
make --no-print-directory -f ghc.mk phase=final all
  HC [stage 1] libraries/base/dist-install/build/Data/Typeable/Internal.o
ghc-stage1: panic! (the 'impossible' happened)
  (GHC version 8.3.20170922 for x86_64-unknown-linux):
	Template variable unbound in rewrite rule
  Variable: cobox_a3S9
  Rule "SC:mkTrApp0"
  Rule bndrs: [k1_X4g7, b_X4gb, k1_a3RW, a_a3RX, k1_X426, b_X42a,
               b_a3RY, sc_s7Yv, sc_s7Yr, sc_s7Ys, sc_s7Yt, cobox_a3S9, cobox_a3RZ,
               cobox_X42x, cobox_a3S8]
  LHS args: [TYPE: TYPE (b_a3RY |> Nth:2 (Sym cobox_a3S8)),
             TYPE: TYPE (b_X42a |> Nth:2 (Sym cobox_X42x)) -> *, TYPE: (->),
             TYPE: (b_X4gb |> Sym (cobox_a3S9 (Coh (Sym (Coh <b_a3RY>_N
                                                             (Nth:2 (Sym cobox_a3S8))))
                                                   (Nth:2 (Sym cobox_a3S8)) ; Coh <b_a3RY>_N
                                                                                  (Nth:2
                                                                                       (Sym cobox_a3S8))) ; Sym cobox_a3RZ)),
             TrTyCon
               @ (TYPE (b_a3RY |> Nth:2 (Sym cobox_a3S8))
                  -> TYPE (b_X42a |> Nth:2 (Sym cobox_X42x)) -> *)
               @ (->)
               sc_s7Yr
               sc_s7Ys
               $tc(->)
               sc_s7Yt,
             sc_s7Yv]
  Actual args: [TYPE: TYPE (b_a3RY |> Nth:2 (Sym cobox_a3S8)),
                TYPE: TYPE (b_X42a |> Nth:2 (Sym cobox_X42x)) -> *, TYPE: (->),
                TYPE: (b_X4gb |> Sym (cobox_a3S9 (Coh (Sym (Coh <b_a3RY>_N
                                                                (Nth:2 (Sym cobox_a3S8))))
                                                      (Nth:2 (Sym cobox_a3S8)) ; Coh <b_a3RY>_N
                                                                                     (Nth:2
                                                                                          (Sym cobox_a3S8))) ; Sym cobox_a3RZ)),
                TrTyCon
                  @ (TYPE (b_a3RY |> Nth:2 (Sym cobox_a3S8))
                     -> TYPE (b_X42a |> Nth:2 (Sym cobox_X42x)) -> *)
                  @ (->)
                  dt_a2Vb
                  dt_a2Vc
                  $tc(->)
                  kind_vars_X37r,
...

You can see a more complete error in the build log at

https://launchpadlibrarian.net/337888338/buildlog_ubuntu-trusty-amd64.ghc-head_8.3.20170922+git.0.5a8b843-7~14.04_BUILDING.txt.gz

This panic seems to be causally connected to cc6be3a2 (which addressed #14236 (closed)) because reverting that commit allows me to avoid the panic.

Trac metadata
Trac field Value
Version 8.3
Type Bug
TypeOfFailure OtherFailure
Priority high
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information