[GHC] #16127: Panic: piResultTys1 in compiler/types/Type.hs:1022:5

GHC ghc-devs at haskell.org
Sat Jan 5 04:53:12 UTC 2019


#16127: Panic: piResultTys1 in compiler/types/Type.hs:1022:5
-------------------------------------+-------------------------------------
        Reporter:  _deepfire         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.6.1
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Old description:

> I apologize in advance for a non-minimised repro.
>
> The panic (with a small `-ddump-tc-trace` excerpt, but full log also
> attached):
>
> {{{
> tcPolyExprNC
>   Check{Vocab
>           *
>           (k_a4TNy[tau:2] -> Constraint)
>           i_a4TNv[tau:2]
>           (Present * k_a4TNy[tau:2] i_a4TNv[tau:2])}
> tcSkolemise
> tcInferId
>   voc_a4TB2 :: Vocab i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
> tcCheckId
>   voc_a4TB2
>   Vocab i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
>   Check{Vocab
>           *
>           (k_a4TNy[tau:2] -> Constraint)
>           i_a4TNv[tau:2]
>           (Present * k_a4TNy[tau:2] i_a4TNv[tau:2])}
> tcWrapResult
>   Actual:   Vocab i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
>   Expected: Check{Vocab
>                     *
>                     (k_a4TNy[tau:2] -> Constraint)
>                     i_a4TNv[tau:2]
>                     (Present * k_a4TNy[tau:2] i_a4TNv[tau:2])}
> tc_sub_type_ds
>   ty_actual   = Vocab i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
>   ty_expected = Vocab
>                   *
>                   (k_a4TNy[tau:2] -> Constraint)
>                   i_a4TNv[tau:2]
>                   (Present * k_a4TNy[tau:2] i_a4TNv[tau:2])
> deeply_instantiate final subst
>   origin: arising from a use of ‘voc_a4TB2’
>   type: Vocab i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
>   new type: Vocab i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
>   subst: [TCvSubst
>             In scope: InScope {i_a4TMf}
>             Type env: []
>             Co env: []]
> u_tys
>   tclvl 2
>   Vocab i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
>   ~
>   Vocab
>     *
>     (k_a4TNy[tau:2] -> Constraint)
>     i_a4TNv[tau:2]
>     (Present * k_a4TNy[tau:2] i_a4TNv[tau:2])
>   arising from a type equality Vocab
>                                  i_a4TMf[sk:1] (Present * *
> i_a4TMf[sk:1])
>                                ~
>                                Vocab
>                                  *
>                                  (k_a4TNy[tau:2] -> Constraint)
>                                  i_a4TNv[tau:2]
>                                  (Present * k_a4TNy[tau:2]
> i_a4TNv[tau:2])
>
> <no location info>: error:
>     ghc: panic! (the 'impossible' happened)
>   (GHC version 8.6.1 for x86_64-unknown-linux):
>         piResultTys1
>   *
>   [i_a4TNv[tau:2], Present * k_a4TNy[tau:2] i_a4TNv[tau:2]]
>   Call stack:
>       CallStack (from HasCallStack):
>         callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in
> ghc:Outputable
>         pprPanic, called at compiler/types/Type.hs:1022:5 in ghc:Type
>
> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
> }}}
>
> Repro (requires Nix & some download time, provides hard repro guarantees
> in return):
>
> {{{
> $ git clone https://github.com/deepfire/holotype
> $ cd holotype
> $ git reset --hard 7e9f5099eea2080f57205267291eeec50ae4b68a
> $ nix-shell
> [nix-shell:~/holotype]$ cabal build lib:holotype
> }}}

New description:

 I apologize in advance for a non-minimised repro.

 The panic (with a small `-ddump-tc-trace` excerpt, but full log also
 attached):

 {{{
 tcPolyExprNC
   Check{Vocab
           *
           (k_a4TNy[tau:2] -> Constraint)
           i_a4TNv[tau:2]
           (Present * k_a4TNy[tau:2] i_a4TNv[tau:2])}
 tcSkolemise
 tcInferId
   voc_a4TB2 :: Vocab i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
 tcCheckId
   voc_a4TB2
   Vocab i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
   Check{Vocab
           *
           (k_a4TNy[tau:2] -> Constraint)
           i_a4TNv[tau:2]
           (Present * k_a4TNy[tau:2] i_a4TNv[tau:2])}
 tcWrapResult
   Actual:   Vocab i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
   Expected: Check{Vocab
                     *
                     (k_a4TNy[tau:2] -> Constraint)
                     i_a4TNv[tau:2]
                     (Present * k_a4TNy[tau:2] i_a4TNv[tau:2])}
 tc_sub_type_ds
   ty_actual   = Vocab i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
   ty_expected = Vocab
                   *
                   (k_a4TNy[tau:2] -> Constraint)
                   i_a4TNv[tau:2]
                   (Present * k_a4TNy[tau:2] i_a4TNv[tau:2])
 deeply_instantiate final subst
   origin: arising from a use of ‘voc_a4TB2’
   type: Vocab i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
   new type: Vocab i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
   subst: [TCvSubst
             In scope: InScope {i_a4TMf}
             Type env: []
             Co env: []]
 u_tys
   tclvl 2
   Vocab i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
   ~
   Vocab
     *
     (k_a4TNy[tau:2] -> Constraint)
     i_a4TNv[tau:2]
     (Present * k_a4TNy[tau:2] i_a4TNv[tau:2])
   arising from a type equality Vocab
                                  i_a4TMf[sk:1] (Present * * i_a4TMf[sk:1])
                                ~
                                Vocab
                                  *
                                  (k_a4TNy[tau:2] -> Constraint)
                                  i_a4TNv[tau:2]
                                  (Present * k_a4TNy[tau:2] i_a4TNv[tau:2])

 <no location info>: error:
     ghc: panic! (the 'impossible' happened)
   (GHC version 8.6.1 for x86_64-unknown-linux):
         piResultTys1
   *
   [i_a4TNv[tau:2], Present * k_a4TNy[tau:2] i_a4TNv[tau:2]]
   Call stack:
       CallStack (from HasCallStack):
         callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in
 ghc:Outputable
         pprPanic, called at compiler/types/Type.hs:1022:5 in ghc:Type

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}

 Repro (requires Nix & some download time, provides hard repro guarantees
 in return):

 {{{
 $ git clone https://github.com/deepfire/holotype
 $ cd holotype
 $ git reset --hard 5c80e9239a3c18d67106920db8f832abc7bd9a93
 $ nix-shell
 [nix-shell:~/holotype]$ cabal build lib:holotype
 }}}

--

Comment (by _deepfire):

 Ryan, I apologize for the repro fiasco -- I've reproduced your problem in
 a different environment and fixed it in commit
 `5c80e9239a3c18d67106920db8f832abc7bd9a93`. .

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


More information about the ghc-tickets mailing list