[GHC] #9032: Panic with self-import

GHC ghc-devs at haskell.org
Sat Nov 8 00:29:33 UTC 2014


#9032: Panic with self-import
-------------------------------------+-------------------------------------
              Reporter:  jstolarek   |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:  7.10.1
             Component:  Template    |          Version:  7.8.2
  Haskell                            |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:  Compile-    |  Related Tickets:  #1012
  time crash                         |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by thomie):

 * component:  Compiler => Template Haskell
 * milestone:   => 7.10.1


Old description:

> I've run into GHC panic with this code:
>
> {{{
> {-# OPTIONS_GHC -fno-warn-unused-imports #-}
>
> module Singletons.Star where
>
> import Data.Singletons.Prelude
> import Data.Singletons.Decide
> import Data.Singletons.CustomStar
> import Singletons.Nat
> import Singletons.Star  -- <------- HERE
>
> data Vec :: * -> Nat -> * where
>   VNil :: Vec a Zero
>   VCons :: a -> Vec a n -> Vec a (Succ n)
>
> $(singletonStar [''Nat, ''Int, ''String, ''Maybe, ''Vec])
> }}}
>
> This is a test in `singletons` package that leads to a panic when run:
>
> {{{
> ghc: panic! (the 'impossible' happened)
>   (GHC version 7.8.2 for x86_64-unknown-linux):
>         tcIfaceGlobal (local): not found:
>     singletons-1.0:Singletons.Star.TFCo:R:DemoteRep*KProxy{tc r0}
>     []
>
> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
> }}}
>
> I was unable to minimize the test case. Reproducing requires following
> steps:
>
> 1. Installing latest th-desugar library from github:
>
> {{{
> git clone https://github.com/goldfirere/th-desugar.git
> cd th-desugar
> cabal install
> }}}
>
> 2. Getting latest development version of singletons:
>
> {{{
> git clone https://github.com/goldfirere/singletons
> cd singletons
> git checkout 56734c2bda721cb9a6a3021b901e3b29d6564f0c
> make tests
> }}}
>
> All should go well. Now you need to edit file `tests/compile-and-
> dump/Singletons/Star.hs` and uncomment `import Singletons.Star` line. It
> should be possible to reproduce the bug with:
>
> {{{
> cd tests/compile-and-dump/ghc -package-name singletons-1.0
> Singletons/Star.hs -i../../dist/build -c -XTemplateHaskell
> }}}
>
> It's important to run `make tests` first so that all interface files
> required by `Star.hs` are in place.

New description:

 A test in the `singletons` package leads to a panic when run:

 {{{
 ghc: panic! (the 'impossible' happened)
   (GHC version 7.8.2 for x86_64-unknown-linux):
         tcIfaceGlobal (local): not found:
     singletons-1.0:Singletons.Star.TFCo:R:DemoteRep*KProxy{tc r0}
     []

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

 Edit: see comment:1 for a testcase.

--

Comment:

 Still present in 7.9. I have cleaned up the description a bit.

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


More information about the ghc-tickets mailing list