Ticket #5912 (closed bug: fixed)

Opened 15 months ago

Last modified 15 months ago

exporting while having defined a non-nullary promoted type synonym causes panic

Reported by: guest Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.4.1
Keywords: promoted synonym Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Compile-time crash Difficulty: Unknown
Test Case: polykinds/T5912 Blocked By:
Blocking: Related Tickets:

Description

{-# LANGUAGE DataKinds #-}

module Bug(loop) where

data UnaryTypeC a = UnaryDataC a

type Bug = 'UnaryDataC

loop = loop

produces

ghc Bug.hs
[1 of 1] Compiling Bug              ( Bug.hs, Bug.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for x86_64-unknown-linux):
	urk! lookup local fingerprint main:Bug.UnaryDataC{d r0}

it won't panic if either:

1. the export is removed
2. the data constructor (UnaryDataC) is nullary
3. there is no type synonym defined

a verbose run:

ghc -v -dcore-lint Bug.hs
Glasgow Haskell Compiler, Version 7.4.1, stage 2 booted by GHC version 7.0.3
Using binary package database: /usr/lib/ghc-7.4.1/package.conf.d/package.cache
Using binary package database: /home/exfalso/.ghc/x86_64-linux-7.4.1/package.conf.d/package.cache
wired-in package ghc-prim mapped to ghc-prim-0.2.0.0-c2ff696e5b8ec4d4b2bc2e42085fe471
wired-in package integer-gmp mapped to integer-gmp-0.4.0.0-3cccac07aef8e27023f605c1f45bdf74
wired-in package base mapped to base-4.5.0.0-6db966b4cf8c1a91188e66d354ba065e
wired-in package rts mapped to builtin_rts
wired-in package template-haskell mapped to template-haskell-2.7.0.0-133c0fdb189e05de22bd926d39f99fe3
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags: -static
*** Chasing dependencies:
Chasing modules from: *Bug.hs
Stable obj: []
Stable BCO: []
Ready for upsweep
  [NONREC
      ModSummary {
         ms_hs_date = Sat Mar  3 16:40:21 GMT 2012
         ms_mod = main:Bug,
         ms_textual_imps = [import (implicit) Prelude]
         ms_srcimps = []
      }]
*** Deleting temp files:
Deleting: 
compile: input file Bug.hs
Created temporary directory: /tmp/ghc21075_0
*** Checking old interface for main:Bug:
[1 of 1] Compiling Bug              ( Bug.hs, Bug.o )
*** Parser:
*** Renamer/typechecker:
*** Desugar:
Result size of Desugar (after optimization) = 5
*** Core Linted result of Desugar (after optimization):
*** Simplifier:
Result size of Simplifier iteration=1 = 8
*** Core Linted result of Simplifier:
Result size of Simplifier = 8
*** Core Linted result of Simplifier:
*** Tidy Core:
Result size of Tidy Core = 8
*** Core Linted result of Tidy Core:
*** Deleting temp files:
Deleting: /tmp/ghc21075_0/ghc21075_0.s
Warning: deleting non-existent /tmp/ghc21075_0/ghc21075_0.s
*** Deleting temp dirs:
Deleting: /tmp/ghc21075_0
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for x86_64-unknown-linux):
	urk! lookup local fingerprint main:Bug.UnaryDataC{d r9J}

system:

$ uname -a
Linux QuodLibet 3.2.8-1-ARCH #1 SMP PREEMPT Mon Feb 27 21:51:46 CET 2012 x86_64 Intel(R) Core(TM)2 Duo CPU T6500 @ 2.10GHz GenuineIntel GNU/Linux
$ gcc --version
gcc (GCC) 4.6.2 20120120 (prerelease)

Change History

Changed 15 months ago by simonpj@…

commit 48cab6d497b3e1dafb3ddbfadc64417ca655051f

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Sun Mar 4 09:05:34 2012 +0000

    Make type trimming more conservative with -XDataKinds (fixes Trac #5912)
    
    See Note [When we can't trim types] in TidyPgm.  The real solution
    is to do a full dependency analysis, but that seems rather overkill.

 compiler/main/TidyPgm.lhs |   66 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 50 insertions(+), 16 deletions(-)

Changed 15 months ago by simonpj

  • status changed from new to closed
  • difficulty set to Unknown
  • resolution set to fixed
  • testcase changed from http://hpaste.org/64692 to polykinds/T5912

Thanks for the report; now fixed.

Simon

Note: See TracTickets for help on using tickets.