Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#7221 closed bug (worksforme)

DataKinds with recursive data and type synonym causing GHC to crash

Reported by: gereeter Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.4.2
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


When working on an answer to a stackoverflow question, I got the following ghc panic:

urk! lookup local fingerprint main:Main.VZero{d r9Y}

The relevant code is:

{-# LANGUAGE DataKinds #-}

data VNat = VZero | VSucc VNat

type T1 = VZero

main = return ()

The problem did not arise in GHCi or with any optimization turned on. Additionally, it presumably has some machine-dependent aspects, as the author of the stackoverflow problem did not mention ghc crashing. Then again, this error occured after type checking, and that author had a type error. I have no idea as to whether this is related to bug #5036, which had a similar error message but vastly different circumstances. The error did not occur when I made VNat not recursive. Oddly, it seemed to occur during the "Deleting temp dirs" phase of compilation:

*** Deleting temp dirs:
Deleting: /tmp/ghc27666_0
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.2 for x86_64-unknown-linux):
        urk! lookup local fingerprint main:Main.VZero{d r9Y}

Please report this as a GHC bug:

I am running Arch Linux.

Change History (2)

comment:1 Changed 4 years ago by simonpj

difficulty: Unknown
Resolution: worksforme
Status: newclosed

I can't reproduce this, with 7.4.1. However DataKinds are not an advertised feature of 7.4 anyway.

Could you try with the just-released 7.6, and re-open the ticket if you can make it fail? Many thanks.


comment:2 Changed 4 years ago by gereeter

It seems to be working under 7.6, but given the fickle nature of the problem, I have no idea whether it is actually fixed.

Note: See TracTickets for help on using tickets.