[GHC] #14450: GHCi spins forever

GHC ghc-devs at haskell.org
Sat Nov 11 21:57:52 UTC 2017


#14450: GHCi spins forever
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.4.1
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:  TypeInType,
                                     |  PolyKinds
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 Alright, with `master` `-ddump-tc-trace` is a bit more useful. While
 looping it appears to dump
 {{{
 Start solver pipeline {
   work item = [D] _ {1}:: (k_aWv :: *)
                           GHC.Prim.~# (* :: *) (CTyEqCan)
   inerts = {Equalities: [D] _ {1}:: (k_aWv :: *)
                                     GHC.Prim.~# (TYPE q_a20F[tau:1] :: *)
 (CTyEqCan)
                         [W] hole{a20K} {1}:: (k_aWv :: *) GHC.Prim.~# (*
 :: *) (CTyEqCan)
                         [W] hole{a20M} {1}:: (k_aWv :: *)
                                              GHC.Prim.~# (TYPE
 q_a20F[tau:1] :: *) (CTyEqCan)
             Unsolved goals = 2}
   rest of worklist = WL {Eqs = [WD] hole{a20I} {0}:: (TYPE
                                                         r_a20G[tau:1] ::
 *)
                                                      GHC.Prim.~# (k_aWv ::
 *) (CNonCanonical)}
 runStage canonicalization {
   workitem   =  [D] _ {1}:: (k_aWv :: *)
                             GHC.Prim.~# (* :: *) (CTyEqCan)
 can_eq_nc
   False
   [D] _ {1}:: (k_aWv :: *) GHC.Prim.~# (* :: *)
   nominal equality
   k_aWv
   k_aWv
   *
   *
 can_eq_nc
   False
   [D] _ {1}:: (k_aWv :: *) GHC.Prim.~# (* :: *)
   nominal equality
   k_aWv
   k_aWv
   *
   *
 flatten { FM_FlattenAll k_aWv
 flatten } k_aWv
 flatten { FM_FlattenAll *
 flatten } *
 can_eq_nc
   True
   [D] _ {1}:: (k_aWv :: *) GHC.Prim.~# (* :: *)
   nominal equality
   k_aWv
   k_aWv
   *
   *
 end stage canonicalization }
 runStage interact with inerts {
   workitem   =  [D] _ {1}:: (k_aWv :: *)
                             GHC.Prim.~# (* :: *) (CTyEqCan)
 Can't solve tyvar equality
   LHS: k_aWv :: *
   RHS: * :: *
 addInertEq {
   Adding new inert equality: [D] _ {1}:: (k_aWv :: *)
                                          GHC.Prim.~# (* :: *) (CTyEqCan)
 Kick out, tv = k_aWv
   n-kicked = 1
   kicked_out = WL {Eqs = [D] _ {1}:: (k_aWv :: *)
                                      GHC.Prim.~# (TYPE q_a20F[tau:1] :: *)
 (CTyEqCan)}
   Residual inerts = {Equalities: [W] hole{a20K} {1}:: (k_aWv :: *)
                                                       GHC.Prim.~# (* :: *)
 (CTyEqCan)
                                  [W] hole{a20M} {1}:: (k_aWv :: *)
                                                       GHC.Prim.~# (TYPE
 q_a20F[tau:1] :: *) (CTyEqCan)
                      Unsolved goals = 2}
 addInertEq }
 end stage interact with inerts }
 Step 3424[l:1,d:1] Kept as inert:
     [D] _ {1}:: (k_aWv :: *) GHC.Prim.~# (* :: *)
 End solver pipeline (discharged) }
 -----------------------------
 }}}

 In particular, unless I've misunderstood something, this strikes me as
 quite odd,
 {{{
 Can't solve tyvar equality
   LHS: k_aWv :: *
   RHS: * :: *
 }}}
 There's no sign that `k_aWv` is a skolem so why is the solver not simply
 instantiating it at `*`?

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14450#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list