Opened 5 years ago

Closed 4 years ago

#3496 closed bug (duplicate)

GHC panic while building the base library with Cabal

Reported by: elliottt Owned by: simonmar
Priority: low Milestone: 7.0.1
Component: Compiler Version: 6.10.4
Keywords: Cc:
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

On a project here, we are building a custom version of ghc. Part of our build process involves building the base library with Cabal, which produces the following error message:

[ 57 of 128] Compiling Data.Either      ( Data/Either.hs, dist/build/Data/Either.o )
[ 58 of 128] Compiling System.IO.Error  ( System/IO/Error.hs, dist/build/System/IO/Error.o )
[ 59 of 128] Compiling Text.Read        ( Text/Read.hs, dist/build/Text/Read.o )
[ 60 of 128] Compiling Foreign.Ptr      ( Foreign/Ptr.hs, dist/build/Foreign/Ptr.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 6.10.4 for x86_64-unknown-linux):
	tcIfaceGlobal (local): not found:
    base:GHC.Word.W#{d 6w}
    [(32R, Type constructor `base:GHC.Word.Word{tc 32R}'),
     (32U, Type constructor `base:GHC.Word.Word8{tc 32U}'),
     (32X, Type constructor `base:GHC.Word.Word16{tc 32X}'),
     (333, Type constructor `base:GHC.Word.Word32{tc 333}'),
     (339, Type constructor `base:GHC.Word.Word64{tc 339}'),
     (r1ujj, Data constructor `base:GHC.Word.W64#{d r1ujj}'),
     (r1ujl, Data constructor `base:GHC.Word.W32#{d r1ujl}'),
     (r1ujn, Data constructor `base:GHC.Word.W16#{d r1ujn}'),
     (r1ujp, Data constructor `base:GHC.Word.W8#{d r1ujp}'),
     (r1ujr, Data constructor `base:GHC.Word.W#{d r1ujr}'),

The command that Cabal generated was this:

/usr/bin/ghc -package-name base-4.1.0.0 --make -hide-all-packages -i -idist/build -i. \
 -idist/build/autogen -Idist/build/autogen -Idist/build -Iinclude -optP-include \
-optPdist/build/autogen/cabal_macros.h -#include "HsBase.h" -odir dist/build \
-hidir dist/build -stubdir dist/build -package ghc-prim-0.1.0.0 -package integer-0.1.0.1 \
-package rts-1.0 -O -package-name base -XMagicHash -XExistentialQuantification -XRank2Types \
-XScopedTypeVariables -XUnboxedTuples -XForeignFunctionInterface -XUnliftedFFITypes \
-XDeriveDataTypeable -XGeneralizedNewtypeDeriving -XFlexibleInstances -XStandaloneDeriving \
-XPatternGuards -XEmptyDataDecls -XCPP Foreign.Concurrent GHC.Arr GHC.Base GHC.Classes GHC.Conc \
GHC.ConsoleHandler GHC.Desugar GHC.Enum GHC.Environment GHC.Err GHC.Exception GHC.Exts GHC.Float \
GHC.ForeignPtr GHC.Handle GHC.IO GHC.IOBase GHC.Int GHC.List GHC.Num GHC.PArr GHC.Pack GHC.Ptr \
GHC.Read GHC.Real GHC.ST GHC.STRef GHC.Show GHC.Stable GHC.Storable GHC.TopHandler GHC.Unicode \
GHC.Weak GHC.Word System.Timeout Control.Applicative Control.Arrow Control.Category \
Control.Concurrent Control.Concurrent.Chan Control.Concurrent.MVar Control.Concurrent.QSem \
Control.Concurrent.QSemN Control.Concurrent.SampleVar Control.Exception Control.Exception.Base \
Control.OldException Control.Monad Control.Monad.Fix Control.Monad.Instances Control.Monad.ST \
Control.Monad.ST.Lazy Control.Monad.ST.Strict Data.Bits Data.Bool Data.Char Data.Complex \
Data.Dynamic Data.Either Data.Eq Data.Data Data.Fixed Data.Foldable Data.Function Data.HashTable \
Data.IORef Data.Int Data.Ix Data.List Data.Maybe Data.Monoid Data.Ord Data.Ratio Data.STRef \
Data.STRef.Lazy Data.STRef.Strict Data.String Data.Traversable Data.Tuple Data.Typeable \
Data.Unique Data.Version Data.Word Debug.Trace Foreign Foreign.C Foreign.C.Error \
Foreign.C.String Foreign.C.Types Foreign.ForeignPtr Foreign.Marshal Foreign.Marshal.Alloc \
Foreign.Marshal.Array Foreign.Marshal.Error Foreign.Marshal.Pool Foreign.Marshal.Utils \
Foreign.Ptr Foreign.StablePtr Foreign.Storable Numeric Prelude System.Console.GetOpt \
System.CPUTime System.Environment System.Exit System.IO System.IO.Error System.IO.Unsafe \
System.Info System.Mem System.Mem.StableName System.Mem.Weak System.Posix.Internals \
System.Posix.Types Text.ParserCombinators.ReadP Text.ParserCombinators.ReadPrec Text.Printf \
Text.Read Text.Read.Lex Text.Show Text.Show.Functions Unsafe.Coerce

I noticed that if I remove the -O from the command that cabal generated, and rebuild after cleaning and re-configuring, the problem goes away. However, if I clean, reconfigure and use the command that Cabal generated, I get the same build error.

This bug has been seen on x86 and x86_64 Linux installs.

Change History (6)

comment:1 Changed 5 years ago by igloo

  • Difficulty set to Unknown
  • Milestone set to 6.12 branch

comment:2 Changed 5 years ago by elliottt

When building with ghc 6.12.0 rc1, I encountered the same panic when the Foreign.Ptr module was reached.

comment:3 Changed 4 years ago by simonmar

  • Owner set to simonmar
  • Type of failure set to None/Unknown

I'll look into this sometime. Could indicate a real problem somewhere.

comment:4 Changed 4 years ago by igloo

  • Milestone changed from 6.12 branch to 6.12.3

comment:5 Changed 4 years ago by igloo

  • Milestone changed from 6.12.3 to 6.14.1
  • Priority changed from normal to low

comment:6 Changed 4 years ago by simonmar

  • Resolution set to duplicate
  • Status changed from new to closed

duplicate of #3103

Note: See TracTickets for help on using tickets.