GHC 4.06 Mini-FAQ

This page lists known problems for the 4.06 release with workarounds.
  • I can't build GHC 4.06 with GHC 4.04!

    You need 4.04pl1. This is the version currently available from the 4.04 download pages.

  • Linking a program causes the following error on Linux:
       /usr/bin/ld: cannot open -lgmp: No such file or directory
    The problem is that your system doesn't have the GMP library installed. If this is a RedHat distribution, install the RedHat-supplied gmp-devel package, and the gmp package if you don't already have it. There have been reports that installing the RedHat packages also works for SuSE (SuSE don't supply a shared gmp library).
  • My program fails with

        fatal error: No threads to run!  Deadlock?
    The primary cause of this message is trying to use trace at the same time as writing to stdout or stderr (eg. putStr (trace "foo" "bar") will illustrate the error). The problem is caused by overzealous locking in our I/O library, but we don't have a complete fix at this time. A workaround is to start your program like this:
        main = seq stderr $ do ...
    This allows you to trace while writing to stdout, but tracing while writing to stderr will still cause a deadlock.
  • My program loops while trying to evaluate a large expression.

    GHC can only allocate 4096 bytes at a time. If your expression (e.g. a large literal list) would take more, the run-time system loops trying to allocate space for it. The workaround is to compile with -O, which pulls the expression out to the top level and makes it static (hopefully).

  • GHC complains about bogus overlapping string patterns in my program!

    I'm afraid so.

      module X where
      x a = case a of
                  "aa"            -> a
                  "{"             -> a
    gives the warning
      X.hs:2: Pattern match(es) are overlapped in a group of case 
      alternatives beginning
                "{" -> ...
  • There's no fix at the moment.

  • GHC has problems parsing interface files it's generated, giving messages like

        Type.hi:172 Interface file parse error; on input  #) '
    TysPrim.lhs:52: Could not find valid interface file Type'

    Apparently 4.06 has a heart attack if it is faced with an empty unboxed tuple (# #). Unfortunately, it also generates such things. The workaround is not to use optimisation.