[GHC] #13874: GHC panic related to hybrid-vectors

GHC ghc-devs at haskell.org
Sun Jun 25 12:23:21 UTC 2017


#13874: GHC panic related to hybrid-vectors
-------------------------------------+-------------------------------------
           Reporter:  ocramz         |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  MacOS X
       Architecture:                 |   Type of failure:  Compile-time
  Unknown/Multiple                   |  crash or panic
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 The following module makes GHC 8.0.1 panic when the `fromList` declaration
 is uncommented:
 {{{#!hs
 import qualified Data.Vector.Hybrid as VH
 import qualified Data.Vector.Unboxed as VU
 import qualified Data.Vector as V

 data SHVector a = SHV {-# UNPACK #-} !Int !(VH.Vector VU.Vector V.Vector
 (Int, a)) deriving (Eq)

 fromList :: Int -> [(Int, a)] -> SHVector a
 fromList n ll = SHV n (VH.fromList ll)

 }}}

 Crash message follows:

 {{{#!hs
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.0.1 for x86_64-apple-darwin):
         Template variable unbound in rewrite rule
   Variable: sc_shyr
   Rule "SC:$j0"
   Rule bndrs: [sc_shyr, sc_shys, sc_shyt, sg_shyu, sc_shyq]
   LHS args: [sc_shyq,
              (MV
                 @ (Mutable Vector)
                 @ (Mutable Vector)
                 @ (PrimState (ST RealWorld))
                 @ (Int, a_aeG1)
                 @ Int
                 @ a_aeG1
                 @~ (<(Int, a_aeG1)>_N
                     :: ((Int, a_aeG1) :: *) ~# ((Int, a_aeG1) :: *))
                 sc_shys
                 sc_shyt)
              `cast` (sg_shyu
                      :: (MVector
                            (Mutable Vector)
                            (Mutable Vector)
                            (PrimState (ST RealWorld))
                            (Int, a_aeG1) :: *)
                         ~R#
                         (Mutable
                            (Vector Vector Vector)
                            (PrimState (ST RealWorld))
                            (Int, a_aeG1) :: *))]
   Actual args: [sc_shyk,
                 wild_ahdD
                 `cast` (Sub
                           (Sym (D:R:MutableVector[0] <Vector>_N
 <Vector>_N)) <PrimState
 (ST
 RealWorld)>_N <(Int,
 a_aeG1)>_N
                         :: (MVector
                               (Mutable Vector)
                               (Mutable Vector)
                               (PrimState (ST RealWorld))
                               (Int, a_aeG1) :: *)
                            ~R#
                            (Mutable
                               (Vector Vector Vector)
                               (PrimState (ST RealWorld))
                               (Int, a_aeG1) :: *))]
 }}}

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


More information about the ghc-tickets mailing list