[GHC] #14846: Renamer hangs (because of -XInstanceSigs?)

GHC ghc-devs at haskell.org
Fri Feb 23 22:54:49 UTC 2018


#14846: Renamer hangs (because of -XInstanceSigs?)
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.5
      Resolution:                    |             Keywords:  InstanceSigs
                                     |  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Actually, this program //doesn't// hang—it actually produces a stack
 overflow after a certain amount of time!

 {{{
 $ time ~/Software/ghc2/inplace/bin/ghc-stage2 Bug.hs[1 of 1] Compiling Bug
 ( Bug.hs, Bug.o )
 stack overflow: use +RTS -K<size> to increase it

 real    0m18.986s
 user    0m18.472s
 sys     0m0.540s
 $ ~/Software/ghc2/inplace/bin/ghc-stage2 --version
 The Glorious Glasgow Haskell Compilation System, version 8.5.20180221
 }}}

 Here's what this looks like in `-ddump-tc-trace`:

 {{{
 runStage interact with inerts {
   workitem   =  [WD] $dStructI_a1MK {0}:: StructI
                                             (Structured
                                                a_a1LU[sk:4]
                                                (cls_a1Li[ssk:2] |>
 {co_a1M2}
                                                                    ->_N
 <Constraint>_N)) (CDictCan)
 addFunDepWork
   [WD] $dStructI_a1MK {0}:: StructI
                               (Structured
                                  a_a1LU[sk:4] (cls_a1Li[ssk:2] |>
 {co_a1M2} ->_N <Constraint>_N))
   arising from a use of ‘struct’ at Bug.hs:32:12-17
   False
   arising from the type signature for:
                  i :: forall (a :: Struct cls).
                       StructI a =>
                       Hom ríki_a1Lj[ssk:2] a a
   at Bug.hs:31:8-42
   True
   arising from a functional dependency between constraints:
     ‘StructI
        (Structured
           a_a1LU[sk:4] (cls_a1Li[ssk:2] |> {co_a1M2} ->_N
 <Constraint>_N))’
       arising from a use of ‘struct’ at Bug.hs:32:12-17
     ‘StructI a_a1LU[sk:4]’
       arising from the type signature for:
                      i :: forall (a :: Struct cls).
                           StructI a =>
                           Hom ríki_a1Lj[ssk:2] a a
       at Bug.hs:31:8-42
   at Bug.hs:32:12-17
   False
 end stage interact with inerts }
 runStage top-level reactions {
   workitem   =  [WD] $dStructI_a1MK {0}:: StructI
                                             (Structured
                                                a_a1LU[sk:4]
                                                (cls_a1Li[ssk:2] |>
 {co_a1M2}
                                                                    ->_N
 <Constraint>_N)) (CDictCan)
 doTopReact
   [WD] $dStructI_a1MK {0}:: StructI
                               (Structured
                                  a_a1LU[sk:4]
                                  (cls_a1Li[ssk:2] |> {co_a1M2} ->_N
 <Constraint>_N)) (CDictCan)
 *** Exception: stack overflow
 }}}

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


More information about the ghc-tickets mailing list