[GHC] #12630: Assertion failed with BuildFlavour = devel2

GHC ghc-devs at haskell.org
Tue Sep 27 04:49:33 UTC 2016


#12630: Assertion failed with  BuildFlavour = devel2
-------------------------------------+-------------------------------------
           Reporter:  pacak          |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Linux
       Architecture:  x86_64         |   Type of failure:  Compile-time
  (amd64)                            |  crash
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 I tried to reproduce random ghc panic we have in our codebase with ghc8 so
 I decided to compile ghc with debug enabled.


 Source file: ghc-8.0.1-src.tar.xz

 build.mk changes:

 {{{
 BuildFlavour = devel2
 GhcStage1HcOpts = -DDEBUG
 GhcStage2HcOpts = -DDEBUG
 }}}

 source:

 {{{#!hs
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE PolyKinds #-}

 module A where

 import GHC.Generics

 class B f where
   b :: [f a]

 toEnumDefault :: (B (Rep a)) => Int -> a
 toEnumDefault i = let l = b in to
 }}}

 result:
 {{{
 [1 of 1] Compiling A                ( a.hs, a.o )
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.0.1 for x86_64-unknown-linux):
         ASSERT failed!
   CallStack (from HasCallStack):
   assertPprPanic, called at compiler/types/TyCoRep.hs:1974:56 in
 ghc:TyCoRep
   checkValidSubst, called at compiler/types/TyCoRep.hs:2010:17 in
 ghc:TyCoRep
   substTy, called at compiler/types/TyCoRep.hs:1952:3 in ghc:TyCoRep
   in_scope InScope [a1BD :-> a_a1BD[sk], a1BI :-> k_a1BI[tau:3],
                     a1BJ :-> f_a1BJ[tau:3], a1BL :-> a_a1BL[sk]]
   tenv [a1BD :-> a_a1BL[sk]]
   tenvFVs [a1Bz :-> k_a1Bz[tau:5], a1BL :-> a_a1BL[sk]]
   cenv []
   cenvFVs []
   tys [[f_a1BJ[tau:3] a_a1BD[sk]]]
   cos []

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

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


More information about the ghc-tickets mailing list