#7354: Panic with recursion-schemes package and unit
-------------------------------+--------------------------------------------
    Reporter:  amplitwist      |       Owner:            
        Type:  bug             |      Status:  new       
    Priority:  normal          |   Milestone:            
   Component:  GHCi            |     Version:  7.6.1     
    Keywords:                  |          Os:  Linux     
Architecture:  x86_64 (amd64)  |     Failure:  GHCi crash
  Difficulty:  Unknown         |    Testcase:            
   Blockedby:                  |    Blocking:            
     Related:                  |  
-------------------------------+--------------------------------------------
Changes (by simonpj):

  * difficulty:  => Unknown


Old description:

> Steps to reproduce:
>
> 1. Install GHC 7.6.1 and recursion-schemes
> ([http://hackage.haskell.org/package/recursion-schemes])
> 2. Create a new .hs file with the following
> --------------
> import Data.Functor.Foldable
>
> foo = embed ()
> --------------
> 3. Load the file into GHCI
> 4. Evaluate foo
>
> *Main> foo
>
> <interactive>:162:1:
>     Can't find interface-file declaration for variable foo
>       Probable cause: bug in .hi-boot file, or inconsistent .hi file
>       Use -ddump-if-trace to get an idea of which file caused the error
>     In the expression: foo
>     In an equation for `it': it = foo
> *Main> :t foo
>
> <interactive>:1:1:
>     Can't find interface-file declaration for variable foo
>       Probable cause: bug in .hi-boot file, or inconsistent .hi file
>       Use -ddump-if-trace to get an idea of which file caused the error
>     In the expression: foo
>
> 5. Evaluate ``embed ()'' directly at the REPL
> *Main> embed ()
> ghc: panic! (the 'impossible' happened)
>   (GHC version 7.6.1 for x86_64-unknown-linux):
>         nameModule
> <<details unavailable>>
>
> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
> --------------
>
> System Information:
>
> [andy@vanir ~]$ uname -a
> Linux vanir 3.5.6-1-ARCH #1 SMP PREEMPT Sun Oct 7 19:30:49 CEST 2012
> x86_64 GNU/Linux
> [andy@vanir ~]$ ls asdf.hi # the would-be .hi file
> ls: cannot access asdf.hi: No such file or directory

New description:

 Steps to reproduce:

 1. Install GHC 7.6.1 and recursion-schemes
 ([http://hackage.haskell.org/package/recursion-schemes])
 2. Create a new .hs file with the following
 {{{
 import Data.Functor.Foldable

 foo = embed ()
 }}}
 3. Load the file into GHCI
 4. Evaluate foo
 {{{
 *Main> foo

 <interactive>:162:1:
     Can't find interface-file declaration for variable foo
       Probable cause: bug in .hi-boot file, or inconsistent .hi file
       Use -ddump-if-trace to get an idea of which file caused the error
     In the expression: foo
     In an equation for `it': it = foo
 *Main> :t foo

 <interactive>:1:1:
     Can't find interface-file declaration for variable foo
       Probable cause: bug in .hi-boot file, or inconsistent .hi file
       Use -ddump-if-trace to get an idea of which file caused the error
     In the expression: foo
 }}}
 5. Evaluate `embed ()' directly at the REPL
 {{{
 *Main> embed ()
 ghc: panic! (the 'impossible' happened)
   (GHC version 7.6.1 for x86_64-unknown-linux):
         nameModule
 <<details unavailable>>
 }}}


 System Information:
 {{{
 [andy@vanir ~]$ uname -a
 Linux vanir 3.5.6-1-ARCH #1 SMP PREEMPT Sun Oct 7 19:30:49 CEST 2012
 x86_64 GNU/Linux
 [andy@vanir ~]$ ls asdf.hi # the would-be .hi file
 ls: cannot access asdf.hi: No such file or directory
 }}}

--

Comment:

 Right.  I can reproduce this failure with 7.6.1.  Happily HEAD says:
 {{{
 $ ~/5builds/HEAD/inplace/bin/ghc-stage2 --interactive T7354.hs
 GHCi, version 7.7: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 [1 of 1] Compiling T7354            ( T7354.hs, interpreted )
 Ok, modules loaded: T7354.
 *T7354> ana alg

 <interactive>:2:5:
     Occurs check: cannot construct the infinite type:
       a ~ Base t (Prim [a] a)
     Expected type: Prim [a] a -> Base t (Prim [a] a)
       Actual type: Prim [a] a -> a
     Relevant bindings include
       it :: Prim [a] a -> t (bound at <interactive>:2:1)
     In the first argument of `ana', namely `alg'
     In the expression: ana alg
     In an equation for `it': it = ana alg
 }}}
 which looks right.

 Next is to try `recursion-schemes` with HEAD.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to