Ticket #2987 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

panic when compiling again

Reported by: dsrogers Owned by: igloo
Priority: normal Milestone:
Component: Compiler Version: 6.10.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

haskelldb 0.10 doesn't build under ghc 6.10.1. I download it with:

cabal fetch

Then unpack it and use the attached modified .cabal file to enable a build with:

cabal build

It should build. Do a

cabal install

It will then attempt to rebuild, but will fail with the error:

[18 of 25] Compiling Database.HaskellDB.Database ( src/Database/HaskellDB/Database.hs, dist/build/Database/HaskellDB/Database.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 6.10.1 for i386-apple-darwin):
	idInfo r{tv adJo} [tv]

However, if you clean and then install it will succeed

cabal clean
cabal install

ghc 6.10.1 doesn't like something about the intermediate files left over from the cabal build step.

Attachments

haskelldb.cabal Download (1.7 KB) - added by dsrogers 4 years ago.

Change History

Changed 4 years ago by dsrogers

Changed 4 years ago by simonpj

  • difficulty set to Unknown

That's bad. I can't make it happen, though, on Linux. Can anyone else?

Simon

Changed 4 years ago by Deewiant

  • os changed from MacOS X to Unknown/Multiple
  • architecture changed from x86 to Unknown/Multiple

Reproduced on x86-64 Linux, GHC 6.10.1:

[18 of 25] Compiling Database.HaskellDB.Database ( src/Database/HaskellDB/Database.hs, dist/build/Database/HaskellDB/Database.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 6.10.1 for x86_64-unknown-linux):
	idInfo r{tv adgM} [tv]

Exact steps followed:

$ cabal fetch haskelldb
$ cd ~/.cabal/packages/hackage.haskell.org/haskelldb/0.10
$ tar xf haskelldb-0.10.tar.gz
$ cd haskelldb-0.10
$ wget 'http://hackage.haskell.org/trac/ghc/attachment/ticket/2987/haskelldb.cabal?format=raw'
$ mv 'haskelldb.cabal?format=raw' haskelldb.cabal
$ cabal configure; cabal build; cabal install

And yes, doing a cabal clean makes it work again.

Changed 4 years ago by simonpj

  • owner set to igloo

Simon and I investigated. There are two different things going on.

  • First, Cabal triggers a complete rebuild for cabal install because Cabal gives different package flags to GHC in cabal build and cabal install. This is because its package-planning algorithm is different in the two cases. Apparently this infelicity has now been fixed.

For reasons I don't fully understand, Cabal doesn't always do this; it broke for Simon M, but did not break for me, although we were using the exact same GHC.

  • However, GHC should not crash, regardless. Turns out that it was tricky consequence of this patch:
    Tue Feb  5 16:55:07 GMT 2008  simonpj@microsoft.com
      * Inject implicit bindings before the simplifier (Trac #2070)
    

This patch was an unequivocally bad idea. I reversed it in the HEAD a few weeks back, and commented why in Note [Injecting implicit bindings] in TidyPgm. I fixed #2070 in a different way:

Fri Jan  2 14:28:51 GMT 2009  simonpj@microsoft.com
  * Make record selectors into ordinary functions

So I think the bug should not happen in the HEAD. For the 6.10 branch I suggest that we simply reverse the above patch on the branch only; it was only an optimisation thing anyway.

Ian, would you like to do that? It's a bit hard to test whether it fixes the bug, because of the delicacy about Cabal above. I'd settle for just reversing the patch and checking that the branch still validates.

Simon

Changed 4 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Done:

Mon Feb  2 11:47:49 PST 2009  Ian Lynagh <igloo@earth.li>                       
  * Revert: Inject implicit bindings before the simplifier (Trac #2070)         
  simonpj@microsoft.com**20080205165507                                         
                                                                                
  6.10-branch only. The patch caused problems; see trac #2987 for details.      
Note: See TracTickets for help on using tickets.