Opened 2 years ago

Closed 2 years ago

#6025 closed bug (fixed)

GHC Panic On Recompile

Reported by: scooty-puff Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.4.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Difficulty: Unknown
Test Case: polykinds/T6025 Blocked By:
Blocking: Related Tickets:

Description (last modified by simonpj)

Perhaps related to DataKinds or ConstraintKinds, but on rebuild without a clean, the following error is emitted:

Building glyph-0.1...
Preprocessing executable 'glyph' for glyph-0.1...
[34 of 60] Compiling Language.Glyph.HM.InferType ( src/Language/Glyph/HM/InferType.hs, dist/build/glyph/glyph-tmp/Language/Glyph/HM/InferType.p_o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for x86_64-unknown-linux):
	tyThingTyCon
    Data constructor `main:Language.Glyph.Type.Normal{d r3iU}'

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

This can be recreated by building this cabal project:

https://github.com/sonyandy/glyph/tree/ghc-panic

To recreate:

git clone https://github.com/sonyandy/glyph/tree/ghc-panic

cabal configure

cabal build

touch src/Language/Glyph/HM/InferType.hs

cabal build

Attachments (1)

sonyandy-glyph-ghc-panic-0-ge9d223d.zip (71.1 KB) - added by scooty-puff 2 years ago.
ghc-panic tag of sonyandy/glyph from github

Download all attachments as: .zip

Change History (7)

comment:1 Changed 2 years ago by simonpj

  • Description modified (diff)
  • Difficulty set to Unknown

Alas the first repro step fails:

bash-3.1$ git clone https://github.com/sonyandy/glyph/tree/ghc-panic
error: error setting certificate verify locations:
  CAfile: /bin/curl-ca-bundle.crt
  CApath: none
 while accessing https://github.com/sonyandy/glyph/tree/ghc-panic/info/refs

fatal: HTTP request failed
Initialized empty Git repository in c:/tmp/ghc-panic/.git/

I have no clue what is going on. Does it need to be https? Maybe upload a tar file? Ideally cut-down a bit (especially if there are zillions of dependencies.)

Changed 2 years ago by scooty-puff

ghc-panic tag of sonyandy/glyph from github

comment:2 Changed 2 years ago by scooty-puff

Try:

git clone git://github.com/sonyandy/glyph.git

git checkout ghc-panic

cabal configure

cabal build

touch src/Language/Glyph/HM/InferType.hs

cabal build

Or, try the attached .zip file. I will also try to narrow it down to a small set of modules, but will probably not have anything for a few days.

comment:3 Changed 2 years ago by scooty-puff

Other.hs:

{-# LANGUAGE DataKinds, GADTs #-}
module Other (Other (..)) where

data Other a where
  OTrue :: Other True
  OFalse :: Other False

It can probably also be recreated using KindSignatures?, but I have not attempted this.

Main.hs:

module Main (main) where

import Other

other = OTrue

main :: IO ()
main = return ()

To recreate:

ghc --make Main.hs
touch Main.hs
ghc --make Main.hs

Output:

$ ghc --make Main.hs
[2 of 2] Compiling Main             ( Main.hs, Main.o )
ghc.exe: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for i386-unknown-mingw32):
        tyThingTyCon Data constructor `ghc-prim:GHC.Types.True{(w) d 6u}'

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

comment:4 Changed 2 years ago by simonpj

Thanks. Yes, that kills 7.4.1 as you say, but it's fine in HEAD. So I think it's fixed already. Cany you try your main application with HEAD?

(We don't support kind polymorphism or data kinds in 7.4.1 although much of the machinery is there.)

Simon

comment:5 Changed 2 years ago by scooty-puff

It is fixed in the latest HEAD snapshot. (Unfortunately, some new issues when compiling an associated library, but caused by the library, and unrelated to this ticket) I am leaving the status as is - not sure if it should be "fixed" or "invalid" (or the what the process might be). Thanks!

comment:6 Changed 2 years ago by simonpj

  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to polykinds/T6025

Thanks. I've added a regression test.

Note: See TracTickets for help on using tickets.