Opened 9 years ago

Closed 9 years ago

#3067 closed merge (fixed)

GHCi panics with 'initTc:LIE' while :stepping on code with funny types

Reported by: mnislaih Owned by: igloo
Priority: normal Milestone:
Component: GHCi Version: 6.10.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: break028
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


This is due to runtime type reconstruction not dealing correctly with type functions.

I managed to come up a minimal example.

{-# LANGUAGE TypeFamilies #-}

type family Id x
type instance Id Int = Int
type instance Id Bool = Bool

class Convert x y where convert :: x -> y
instance Convert x x where convert = id

f :: Convert a (Id a) => a -> Id a
f x = convert x

g :: Convert a (Id a) => a -> Id a
g x = let x' = f x in x'
[1 of 1] Compiling Main             ( ../code/debuggerExamples/lie.hs, interpreted )
Ok, modules loaded: Main.
*Main GOA> :step g False
:step g False
Stopped at ../code/debuggerExamples/lie.hs:15:0-23
_result :: Id a = _
14  g :: Convert a (Id a) => a -> Id a
15  g x = let x' = f x in x'
[../code/debuggerExamples/lie.hs:15:0-23] *Main GOA> :step
ghc: panic! (the 'impossible' happened)
  (GHC version 6.10.1 for i386-apple-darwin):

Please report this as a GHC bug:

Change History (2)

comment:1 Changed 9 years ago by mnislaih

Owner: set to igloo
Test Case: break028
Type: bugmerge

Fixed, please merge

Tue Mar  3 11:37:06 PST 2009  pepe iborra <>
 * Fix #3067: GHCi panics with 'initTc:LIE' while :stepping on code with funny types

 The problem is that calls to boxyUnify would panic if the types involved
 contained type functions. 
 It looks like one should wrap these calls with getLIE, although I don't
 really know what I am doing here

   M ./compiler/ghci/RtClosureInspect.hs -2 +2

comment:2 Changed 9 years ago by igloo

difficulty: Unknown
Resolution: fixed
Status: newclosed


Note: See TracTickets for help on using tickets.