Opened 4 years ago

Closed 4 years ago

#6013 closed bug (duplicate)

the 'impossible' happened

Reported by: tlvb Owned by:
Priority: normal Milestone: 7.6.1
Component: Compiler (Type checker) Version: 7.4.1
Keywords: panic, impossible, type checker, renamer Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: #5961 Differential Rev(s):
Wiki Page:


Please forgive me if this is a duplicate or irrelevant, bug reporting and Haskell are two things I work with seldom enough that I cannot be considered good at either, but as what happened should be 'impossible' I thought I'd at least give you a heads up. I tried looking for similar bugs, but I do not really know what I would be looking for...

GHCi (newly opened, -v flag):

[leo@derse brutelift]$ ghci -v
GHCi, version 7.4.1:  :? for help
Glasgow Haskell Compiler, Version 7.4.1, stage 2 booted by GHC version 7.4.1
Using binary package database: /usr/lib/ghc-7.4.1/package.conf.d/package.cache
wired-in package ghc-prim mapped to ghc-prim-
wired-in package integer-gmp mapped to integer-gmp-
wired-in package base mapped to base-
wired-in package rts mapped to builtin_rts
wired-in package template-haskell mapped to template-haskell-
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags: -static
Loading package ghc-prim ... linking ... done.
*** gcc:
'/usr/bin/gcc' '-fno-stack-protector' '-Wl,--hash-size=31' '-Wl,--reduce-memory-overheads' '-L/usr/lib/ghc-7.4.1/integer-gmp-' '--print-file-name' ''
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :load brutelift
*** Chasing dependencies:
Chasing modules from: 
Stable obj: []
Stable BCO: []
unload: retaining objs []
unload: retaining bcos []
Ready for upsweep []
Upsweep completely successful.
*** Deleting temp files:
*** Chasing dependencies:
Chasing modules from: *brutelift.hs
Stable obj: []
Stable BCO: []
unload: retaining objs []
unload: retaining bcos []
Ready for upsweep
      ModSummary {
         ms_hs_date = Tue Apr 17 18:10:32 CEST 2012
         ms_mod = main:Main,
         ms_textual_imps = [import (implicit) Prelude, import Data.List]
         ms_srcimps = []
*** Deleting temp files:
compile: input file brutelift.hs
Created temporary directory: /tmp/ghc5399_0
*** Checking old interface for main:Main:
[1 of 1] Compiling Main             ( brutelift.hs, interpreted )
*** Parser:
*** Renamer/typechecker:
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for x86_64-unknown-linux):
	nameModule show{tv abQ}

Please report this as a GHC bug:



import Data.List

data Transfer = Load | Unload
data Action = Left Transfer Int | Right Transfer Int

data BlockDispersion = Blocks {top :: [Int]
				, bottom  :: [Int]
				, left :: [Int]
				, right :: [Int]}
				deriving (Show)

data Machine = MOK BlockDispersion [Action] | MError BlockDispersion [Action] deriving (show)

rSplitAt i xs = let (a, b) = splitAt i $ reverse xs in
	(reverse b, reverse a)
moveR :: Int -> ([a], [a]) -> ([a], [a])
moveR i (a, b) = let (c, d) = rSplitAt i a
			in (c, d++b)
moveL :: Int -> ([a], [a]) -> ([a], [a])
moveL i (a, b) = let (c, d) = splitAt i b
			in (a++c, d)

I am not sure what additional info to provide... Running an Arch linux system, 8GB ram, installed ghc packgage should be as vanilla as can be...

[leo@derse brutelift]$ uname -a
Linux derse 3.3.1-1-ARCH #1 SMP PREEMPT Tue Apr 3 06:46:17 UTC 2012 x86_64 Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz GenuineIntel GNU/Linux

Change History (1)

comment:1 Changed 4 years ago by pcapriotti

  • difficulty set to Unknown
  • Milestone set to 7.6.1
  • Resolution set to duplicate
  • Status changed from new to closed
  • Type of failure changed from GHCi crash to Compile-time crash

Thanks for the report.

The problem in the code is that Show should be capitalized (in the deriving clause of the definition of Machine).

However, you're right that GHC should report the error instead of crashing. This is actually a duplicate of #5961, and fixed in HEAD.

Note: See TracTickets for help on using tickets.