Opened 5 years ago

Closed 5 years ago

#2864 closed bug (fixed)

ghc: panic! (the 'impossible' happened) -- Please report this as a GHC bug

Reported by: megacz Owned by:
Priority: normal Milestone: 6.12 branch
Component: Compiler Version: 6.11
Keywords: Cc:
Operating System: MacOS X Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo)

The compiler asked me to report this.

/Users/megacz/proj/icfp09/ghc/ghc/stage1-inplace/ghc -DGHCI_TABLES_NEXT_TO_CODE -DSTAGE=2 -package-name ghc-6.11.20081208 -hide-all-packages -no-user-package-conf -i -idist-stage2/build -inativeGen -ibasicTypes -icmm -icodeGen -icoreSyn -icprAnalysis -ideSugar -ighci -ihsSyn -iiface -imain -iparser -iprelude -iprofiling -irename -isimplCore -isimplStg -ispecialise -istgSyn -istranal -itypecheck -itypes -iutils -ivectorise -idist-stage2/build/autogen -Idist-stage2/build/autogen -Idist-stage2/build -I../libffi/build/include -Istage2plus -I../libraries/base/cbits -I../libraries/base/include -I. -Iparser -Iutils -optP-DGHCI -optP-include -optPdist-stage2/build/autogen/cabal_macros.h -odir dist-stage2/build -hidir dist-stage2/build -stubdir dist-stage2/build -package Cabal-1.5.5 -package array-0.2.0.0 -package base-4.0.0.0 -package bytestring-0.9.1.4 -package containers-0.2.0.0 -package directory-1.0.0.2 -package filepath-1.1.0.1 -package haskell98-1.0.1.0 -package hpc-0.5.0.2 -package old-time-1.0.0.1 -package process-1.0.1.1 -package template-haskell-2.3.0.0 -package unix-2.3.1.0 -O -Wall -fno-warn-name-shadowing -fno-warn-orphans -XCPP -XMagicHash -XUnboxedTuples -XPatternGuards -XForeignFunctionInterface -XEmptyDataDecls -XTypeSynonymInstances -XMultiParamTypeClasses -XFlexibleInstances -XRank2Types -XScopedTypeVariables -XDeriveDataTypeable -prof -hisuf p_hi -hcsuf p_hc -osuf p_o -idist-stage2/build  -H32m -O -Rghc-timing -O2  -c nativeGen/MachRegs.lhs -o dist-stage2/build/MachRegs.p_o  -ohi dist-stage2/build/MachRegs.p_hi
ghc: panic! (the 'impossible' happened)
  (GHC version 6.11.20081208 for i386-apple-darwin):
	CoreToStg.myCollectArgs
    (__scc {trivColorable ghc-6.11.20081208:MachRegs !}
     ghc-6.11.20081208:MachRegs.isSqueesed{v r2zH} [gid] 0 0)
      eta_s2Gv{v} [lid]

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

<<ghc: 127672968 bytes, 16 GCs, 5231957/10604544 avg/max bytes residency (3 samples), 38M in use, 0.00 INIT (0.00 elapsed), 0.36 MUT (0.46 elapsed), 0.16 GC (0.19 elapsed) :ghc>>
make[4]: *** [dist-stage2/build/MachRegs.p_o] Error 1
make[3]: *** [all] Error 1
make[2]: *** [build.stage.2] Error 2
make[1]: *** [stage2] Error 2
make: *** [bootstrap2] Error 2

This is using git HEAD, commit 2aba6f168b7bcb4f8c7c8e8f7cdc340a0ccb56e7

Change History (7)

comment:1 Changed 5 years ago by megacz

FWIW, this happens on x86-linux as well:

/afs/megacz.com/work/ghc/ghc/stage1-inplace/ghc -DGHCI_TABLES_NEXT_TO_CODE -DSTAGE=2 -package-name ghc-6.11.20081208 -hide-all-packages -no-user-package-conf -i -idist-stage2/build -inativeGen -ibasicTypes -icmm -icodeGen -icoreSyn -icprAnalysis -ideSugar -ighci -ihsSyn -iiface -imain -iparser -iprelude -iprofiling -irename -isimplCore -isimplStg -ispecialise -istgSyn -istranal -itypecheck -itypes -iutils -ivectorise -idist-stage2/build/autogen -Idist-stage2/build/autogen -Idist-stage2/build -I../libffi/build/include -Istage2plus -I../libraries/base/cbits -I../libraries/base/include -I. -Iparser -Iutils -optP-DGHCI -optP-include -optPdist-stage2/build/autogen/cabal_macros.h -odir dist-stage2/build -hidir dist-stage2/build -stubdir dist-stage2/build -package Cabal-1.5.5 -package array-0.2.0.0 -package base-4.0.0.0 -package bytestring-0.9.1.4 -package containers-0.2.0.0 -package directory-1.0.0.2 -package filepath-1.1.0.1 -package haskell98-1.0.1.0 -package hpc-0.5.0.2 -package old-time-1.0.0.1 -package process-1.0.1.1 -package template-haskell-2.3.0.0 -package unix-2.3.1.0 -O -Wall -fno-warn-name-shadowing -fno-warn-orphans -XCPP -XMagicHash -XUnboxedTuples -XPatternGuards -XForeignFunctionInterface -XEmptyDataDecls -XTypeSynonymInstances -XMultiParamTypeClasses -XFlexibleInstances -XRank2Types -XScopedTypeVariables -XDeriveDataTypeable -prof -hisuf p_hi -hcsuf p_hc -osuf p_o -idist-stage2/build -H32m -O -Rghc-timing -O2 -c nativeGen/MachRegs.lhs -o dist-stage2/build/MachRegs.p_o -ohi dist-stage2/build/MachRegs.p_hi
ghc: panic! (the 'impossible' happened)

(GHC version 6.11.20081208 for i386-unknown-linux):

CoreToStg?.myCollectArgs

(scc {trivColorable ghc-6.11.20081208:MachRegs !}

ghc-6.11.20081208:MachRegs.isSqueesed{v r2zH} [gid] 0 0)

eta_s2Gv{v} [lid]

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

<<ghc: 128110484 bytes, 17 GCs, 4303530/9179136 avg/max bytes residency (3 samples), 38M in use, 0.00 INIT (0.00 elapsed), 0.37 MUT (0.48 elapsed), 0.16 GC (0.17 elapsed) :ghc>>
make[4]: * [dist-stage2/build/MachRegs.p_o] Error 1
make[3]:
* [all] Error 1
make[3]: Leaving directory `/afs/megacz.com/work/ghc/compiler'
make[2]: * [build.stage.2] Error 2
make[2]: Leaving directory `/afs/megacz.com/work/ghc/compiler'
make[1]:
* [stage2] Error 2
make[1]: Leaving directory `/afs/megacz.com/work/ghc'
make: * [bootstrap2] Error 2

comment:2 Changed 5 years ago by igloo

  • Description modified (diff)
  • Difficulty set to Unknown

comment:3 Changed 5 years ago by igloo

  • Milestone set to 6.12 branch

Can you say how are you building GHC please? i.e. what commands you are using, what you have in mk/build.mk, etc.

comment:4 Changed 5 years ago by megacz

I issued these commands to acquire a fresh ghc tree (from scratch) and build it:

git clone http://darcs.haskell.org/ghc.git ghc
cd ghc
curl 'http://hackage.haskell.org/trac/ghc/attachment/ticket/2857/fix-sync-all-patch?format=raw' | patch -p1
./sync-all --complete get
sh boot
./configure && make

comment:5 Changed 5 years ago by megacz

Er, formatted more nicely, that should be:

git clone http://darcs.haskell.org/ghc.git ghc
cd ghc curl 'http://hackage.haskell.org/trac/ghc/attachment/ticket/2857/fix-sync-all-patch?format=raw' | patch -p1
./sync-all --complete get
sh boot
./configure && make

comment:6 Changed 5 years ago by megacz

Sorry, one more try with the formatting:

git clone http://darcs.haskell.org/ghc.git ghc
cd ghc
curl 'http://hackage.haskell.org/trac/ghc/attachment/ticket/2857/fix-sync-all-patch?format=raw' | patch -p1
./sync-all --complete get
sh boot
./configure && make

comment:7 Changed 5 years ago by simonmar

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

Worked around this bug for now:

Mon Dec 15 02:02:21 PST 2008  Simon Marlow <marlowsd@gmail.com>
  * Revert CorePrep part of "Completely new treatment of INLINE pragmas..."
  
  The original patch said:
  
  * I made some changes to the way in which eta expansion happens in
    CorePrep, mainly to ensure that *arguments* that become let-bound
    are also eta-expanded.  I'm still not too happy with the clarity
    and robustness fo the result.
    
  Unfortunately this change apparently broke some invariants that were
  relied on elsewhere, and in particular lead to panics when compiling
  with profiling on.
  
  Will re-investigate in the new year.
Note: See TracTickets for help on using tickets.