#1716: panic when running program from GHCi
-------------------------------------------+--------------------------------
Reporter: [EMAIL PROTECTED] | Owner: chak
Type: bug | Status: new
Priority: normal | Milestone: 6.10 branch
Component: Compiler | Version: 6.8
Severity: critical | Resolution:
Keywords: | Difficulty: Unknown
Os: Linux | Testcase:
Architecture: x86 |
-------------------------------------------+--------------------------------
Changes (by simonpj):
* owner: => chak
* milestone: 6.8.1 => 6.10 branch
Old description:
> To reproduce this bug please install GHC 6.8.20070916 and Gtk2Hs 0.9.12
> as currently described on
> http://haskell.org/haskellwiki/Grapefruit#Building. There is a modified
> version of the development version of Grapefruit attached. Sorry for
> this large code example but currently I really don’t have the time to
> reduce this any further.
>
> Please unpack the attached file {{{bug.tar.bz2}}}, enter the directory
> {{{bug/Haskell}}} and run {{{ghci -cpp -farrows -fth -fglasgow-exts
> Examples/Simple.hs}}}. Compilation to bytecode should be successful.
> Then enter {{{main}}} on the GHCi command line. You should get the
> following messages:
> {{{
> ghc-6.8.0.20070916: panic! (the 'impossible' happened)
> (GHC version 6.8.0.20070916 for i386-unknown-linux):
> nameModule arr{v a85X}
>
> Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
> }}}
New description:
'''See the reply from Simon''' which gives a simple stand-alone repro case
for this bug.
Original report: To reproduce this bug please install GHC 6.8.20070916 and
Gtk2Hs 0.9.12 as currently described on
http://haskell.org/haskellwiki/Grapefruit#Building. There is a modified
version of the development version of Grapefruit attached. Sorry for this
large code example but currently I really don’t have the time to reduce
this any further.
Please unpack the attached file {{{bug.tar.bz2}}}, enter the directory
{{{bug/Haskell}}} and run {{{ghci -cpp -farrows -fth -fglasgow-exts
Examples/Simple.hs}}}. Compilation to bytecode should be successful.
Then enter {{{main}}} on the GHCi command line. You should get the
following messages:
{{{
ghc-6.8.0.20070916: panic! (the 'impossible' happened)
(GHC version 6.8.0.20070916 for i386-unknown-linux):
nameModule arr{v a85X}
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
}}}
Comment:
Thanks for the report. I'm not certain what the original problem is, but
there's a definite bug that show s up when compiling `Port.hs` on the way
to reproducing the bug.
Below is a stand-alone cut-down version that gives a Core Lint error as a
result of bogus evidence generation arising from type equalites. I'm
changing the milestone to 6.10 (since we are not advertising type
equalities for 6.8), and changing the owner to Manuel.
Simon
{{{
{-# OPTIONS -fglasgow-exts #-}
{-# LANGUAGE UndecidableInstances #-}
module Graphics.UI.Grapefruit.Port ( ) where
---------------------------------------
-- * Type equality
type family TypeEq type1 type2 :: *
typeEq :: type1 -> type2 -> TypeEq type1 type2
typeEq _ _ = undefined
class Singleton singleton where
soleValue :: singleton
class Boolean boolean
data False
instance Boolean False
false :: False
false = undefined
data True
instance Boolean True
true :: True
true = undefined
data headName :& tail = !(Field headName) :& !tail
infixr 1 :&
data Field name = !name := Value name
infix 2 :=
-- * Names
class (Singleton name) => Name name where
type Value name :: *
---------------------------------------
-- ** Isolation
class Isolatable record lookupName where
type Remainder record lookupName :: *
isolate :: record -> lookupName -> (Field lookupName,Remainder
record lookupName)
instance (IsolatableHelper (TypeEq headName lookupName) headName tail
lookupName) =>
Isolatable (headName :& tail) lookupName where
type Remainder (headName :& tail) lookupName
= RemainderHelper (TypeEq headName lookupName) headName tail
lookupName
isolate (headField@(headName := _) :& tail) lookupName
= isolateHelper (typeEq headName lookupName) headField tail
lookupName
class IsolatableHelper namesAreEqual headName tail lookupName where
type RemainderHelper namesAreEqual headName tail lookupName :: *
foo :: tail
isolateHelper :: namesAreEqual
-> Field headName
-> tail
-> lookupName
-> (Field lookupName,RemainderHelper namesAreEqual
headName tail lookupName)
-- On error use lookupName and add (headName ~ lookupName) to the
context.
instance (headName ~ lookupName) =>
IsolatableHelper True headName tail lookupName where
type RemainderHelper True headName tail lookupName = tail
isolateHelper _ headField tail _ = (headField,tail)
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1716#comment:2>
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