Opened 3 years ago

Closed 3 years ago

#5651 closed bug (fixed)

panic while building darcs with profiling

Reported by: dmwit Owned by: simonmar
Priority: high Milestone: 7.4.1
Component: Compiler Version: 7.3
Keywords: Cc: duncan@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Building the most recent darcs with profiling causes a panic. I've attached a tarball with the code as it is at the moment (in case the repository moves on and hides the panic). The panic message follows:

[175 of 180] Compiling Darcs.Commands.WhatsNew ( src/Darcs/Commands/WhatsNew.hs, dist/build/Darcs/Commands/WhatsNew.p_o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.3.20111114 for x86_64-unknown-linux):
	idInfoToAmode: void
    ( cobox4{v X41yM} [lid] :: ghc-prim:GHC.Prim.~#{(w) tc 32z}
                                 ((ghc-prim:GHC.Prim.*{(w) tc 34d}
                                   -> ghc-prim:GHC.Prim.*{(w) tc 34d})
                                  -> ghc-prim:GHC.Prim.*{(w) tc 34d})
                                 (darcs-2.7.3:Darcs.Patch.Apply.ApplyState{tc r41ux}
                                    (darcs-2.7.3:Darcs.Witnesses.Ordered.FL{tc r2eb8}
                                       (darcs-2.7.3:Darcs.Patch.Prim.Class.PrimOf{tc r4415}
                                          ( p{tv a9l2V} [sk] :: ghc-prim:GHC.Prim.*{(w) tc 34d}
                                                                -> ghc-prim:GHC.Prim.*{(w) tc 34d}
                                                                -> ghc-prim:GHC.Prim.*{(w) tc 34d} ))))
                                 hashed-storage-0.5.9:Storage.Hashed.Tree.Tree{tc r2WTx} )

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Change History (6)

comment:1 Changed 3 years ago by dmwit

Apparently the tarball was a tad too large, so I'll host it at http://dmwit.com/darcs-ghc-panic.tar.gz (450K) at least until this issue is closed.

comment:2 Changed 3 years ago by simonmar

  • Cc duncan@… added
  • Milestone set to 7.4.1
  • Priority changed from normal to high

How did you get the dependencies built? I'm having various problems.

> cabal install --with-ghc=$ghcwrk --only-dependencies
Resolving dependencies...
cabal: cannot configure haskeline-0.6.4.0. It requires base ==2.*
There is no available version of base that satisfies ==2.*

I don't understand this error message at all, since I already have haskeline-0.6.4.0 installed. Furthermore, when I just cabal configure, it doesn't mention haskeline as a missing dependency:

> cabal configure --with-ghc=$ghcwrk                  
Resolving dependencies...
Configuring darcs-2.7.3...
setup: At least the following dependencies are missing:
hashed-storage >=0.5.6 && <0.6,
html ==1.0.*,
parsec >=2.0 && <3.2,
regex-compat >=0.95.1,
tar ==0.3.*,
text ==0.11.*,
vector >=0.7,
zlib >=0.5.1.0 && <0.6.0.0

I tried installing hashed-storage manually, but zlib is not building with GHC HEAD right now:

Building zlib-0.5.3.1...
[1 of 5] Compiling Codec.Compression.Zlib.Stream ( dist/build/Codec/Compression/Zlib/Stream.hs, dist/build/Codec/Compression/Zlib/Stream.o )

Codec/Compression/Zlib/Stream.hsc:857:1:
    Unacceptable argument type in foreign declaration: CInt
    When checking declaration:
      foreign import ccall unsafe "static zlib.h inflateInit2_" c_inflateInit2_
        :: StreamState -> CInt -> Ptr CChar -> CInt -> IO CInt

comment:3 Changed 3 years ago by simonmar

  • Owner set to simonmar

comment:4 Changed 3 years ago by dmwit

I didn't see the haskeline error, but the other error ("Unacceptable argument type ...") is quite familiar to me. The fix for most packages is pretty mechanical: open up the offending file, grep for "import Foreign.C.Types" and add "(..)" to any type it imports, e.g. the diff would look like:

-import Foreign.C.Types ( CInt, CSize )
+import Foreign.C.Types ( CInt(..), CSize(..) )

If you like, I will happily host corrected tarballs of versions of any package that doesn't build. I don't recall exactly which packages I had to fix, but I do remember fixing at least zlib and tar; see <http://dmwit.com/zlib-0.5.3.1.tar.gz> and <http://dmwit.com/tar-0.3.1.0.tar.gz> for corrected versions.

comment:5 Changed 3 years ago by simonmar

Ok, I'm building. What flags did you use to configure with? I'm having to use -f-library right now because of a type error in Darcs.Witnesses.Sealed. But I must be doing something different to you because GHC says there are 174 modules to build, whereas your error message above shows 180.

comment:6 Changed 3 years ago by simonmar

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

Never mind, my build reproduced the problem. In fact it is already fixed, in 841496c8934a488ea8a791ee42b2d1388c920744.

Thanks for the report!

Note: See TracTickets for help on using tickets.