Skip to content

GHC panic when printing Unique

The following program causes panic:

    import UniqSupply
    main = mkSplitUniqSupply 'x' >>= print . uniqFromSupply

The error message is:

    ghcbug: ghcbug: panic! (the 'impossible' happened)
      (GHC version 6.10.1 for i386-apple-darwin):
	    Static flags have not been initialised!
            Please call GHC.newSession or GHC.parseStaticFlags early enough.

I have encountered this on an Apple !MacBook with GHC 6.10.1 and could reproduce it on a Linux PC with the same GHC version.

The module !UniqSupply comes from the ghc package which is hidden by default. So before compiling it (or running it in GHCi) type

    ghc-pkg expose ghc

in a shell.

Trac metadata
Trac field Value
Version 6.10.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information