Ticket #3862 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

ghc panic (applyTypeToArgs) building hledger with -O

Reported by: simonmic Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.10.4
Keywords: Cc:
Operating System: MacOS X Architecture: Unknown/Multiple
Type of failure: Compile-time crash Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

$ cabal install -fweb -fvty -fchart --constraint 'template-haskell < 2.4'
Resolving dependencies...
Configuring hledger-0.8...
Preprocessing library hledger-0.8...
Preprocessing executables for hledger-0.8...
Building hledger-0.8...
ar: creating archive dist/build/libHShledger-0.8.a
[29 of 32] Compiling Commands.Convert ( Commands/Convert.hs, dist/build/hledger/hledger-tmp/Commands/Convert.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 6.10.4 for i386-apple-darwin):
	applyTypeToArgs
    parsec-2.1.0.1:Text.ParserCombinators.Parsec.Prim.a32{v rwo} [gid]
      @ csv-0.1.1:Text.CSV.CSV{tc r2Ve}
      (csv-0.1.1:Text.CSV.a22{v r2Va} [gid]
       `cast` (ghc-prim:GHC.Prim.sym{(w) tc 34v}
                 ((parsec-2.1.0.1:Text.ParserCombinators.Parsec.Prim.:CoGenParser{tc rhR})
                    ghc-prim:GHC.Types.Char{(w) tc 3o}
                    ghc-prim:GHC.Unit.(){(w) tc 40}
                    csv-0.1.1:Text.CSV.CSV{tc r2Ve})
               :: <pred>parsec-2.1.0.1:Text.ParserCombinators.Parsec.Prim.State{tc rhV}
                          ghc-prim:GHC.Types.Char{(w) tc 3o} ghc-prim:GHC.Unit.(){(w) tc 40}
                        -> parsec-2.1.0.1:Text.ParserCombinators.Parsec.Prim.Consumed{tc rit}
                             (parsec-2.1.0.1:Text.ParserCombinators.Parsec.Prim.Reply{tc ris}
                                ghc-prim:GHC.Types.Char{(w) tc 3o}
                                ghc-prim:GHC.Unit.(){(w) tc 40}
                                csv-0.1.1:Text.CSV.CSV{tc r2Ve})
                          ~
                        parsec-2.1.0.1:Text.ParserCombinators.Parsec.Prim.GenParser{tc rhk}
                          ghc-prim:GHC.Types.Char{(w) tc 3o}
                          ghc-prim:GHC.Unit.(){(w) tc 40}
                          csv-0.1.1:Text.CSV.CSV{tc r2Ve}))
      csvfile{v s3Vz} [lid]
    forall st{tv i3Im} [tv] a{tv i3In} [tv].
    parsec-2.1.0.1:Text.ParserCombinators.Parsec.Prim.GenParser{tc rhk}
      csv-0.1.1:Text.CSV.CSV{tc r2Ve} st{tv i3Im} [tv] a{tv i3In} [tv]
    -> [base:GHC.Base.String{tc 36u}]
    -> parsec-2.1.0.1:Text.ParserCombinators.Parsec.Prim.State{tc rhV}
         csv-0.1.1:Text.CSV.CSV{tc r2Ve} st{tv i3Im} [tv]
    -> parsec-2.1.0.1:Text.ParserCombinators.Parsec.Prim.Consumed{tc rit}
         (parsec-2.1.0.1:Text.ParserCombinators.Parsec.Prim.Reply{tc ris}
            csv-0.1.1:Text.CSV.CSV{tc r2Ve} st{tv i3Im} [tv] a{tv i3In} [tv])

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

Seen for the first time today. Does not happen when using ghc --make.

Change History

Changed 2 years ago by simonmic

Happens with -O. Another way to reproduce:

$ darcs get --lazy  http://joyful.com/repos/hledger && cd hledger $ ghc --make Commands/Convert.hs -O

Changed 2 years ago by simonpj

I suspect this is fixed in 6.12 (see eg #3528), but I couldn't try it because I get this when installing dependencies. Maybe HUnit isn't 6.12 compatible.

cabal install --with-ghc=$head1 --user HUnit
Resolving dependencies...
Downloading HUnit-1.2.0.0...
Configuring HUnit-1.2.0.0...
Preprocessing library HUnit-1.2.0.0...
Building HUnit-1.2.0.0...
[1 of 5] Compiling Test.HUnit.Terminal ( Test/HUnit/Terminal.lhs, dist/build/Test/HUnit/Terminal.o )
[2 of 5] Compiling Test.HUnit.Lang  ( Test/HUnit/Lang.lhs, dist/build/Test/HUnit/Lang.o )

Test/HUnit/Lang.lhs:23:43:
    Module `Control.Exception' does not export `throwDyn'
cabal: Error: some packages failed to install:
HUnit-1.2.0.0 failed during the building phase. The exception was:
ExitFailure 1
bash-3.2$ 

Would you like to try with 6.12?

Simon

Changed 2 years ago by simonmic

Thank you, unfortunately things my app depends on don't yet work in the 6.12 world and I want to do one more 6.10-based release. This started recently so I'll look a bit harder for a workaround.

Changed 2 years ago by simonmic

  • summary changed from ghc crash while building hledger with cabal to ghc panic (applyTypeToArgs) building hledger with -O

Changed 2 years ago by simonmic

Workaround found. I had:

$ ghc-pkg list parsec /opt/local/lib/ghc-6.10.4/./package.conf:

parsec-2.1.0.1

/Users/simon/.ghc/i386-darwin-6.10.4/package.conf:

parsec-2.1.0.1

The issue happens when I have cabal installed parsec in the --user space. Unregistering that one and relying on the parsec that came with the ghc binary installer made the problem go away.

Changed 2 years ago by simonmar

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

Ah, so you probably had an inconsistency in your package dependencies. GHC 6.12 would have detected and reported it, probably.

Optimistically closing, in anticipation that 6.12 would give a better error message.

Note: See TracTickets for help on using tickets.