[GHC] #10504: GHC panics with dsImpSpecs on SPECIALISE pragma with -fhpc enabled

GHC ghc-devs at haskell.org
Tue Jun 9 14:14:23 UTC 2015


#10504: GHC panics with dsImpSpecs on SPECIALISE pragma with -fhpc enabled
-------------------------------------+-------------------------------------
              Reporter:  nh2         |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:
             Component:  Compiler    |           Version:  7.10.1
              Keywords:              |  Operating System:  Unknown/Multiple
          Architecture:              |   Type of failure:  Compile-time
  Unknown/Multiple                   |  crash
             Test Case:              |        Blocked By:
              Blocking:              |   Related Tickets:
Differential Revisions:              |
-------------------------------------+-------------------------------------
 Minimal example code: https://github.com/nh2/ghc-omit-interface-pragmas-
 dsImpSpecs-bug/

 I'm encountering a problem that prevents me from using Haskell program
 coverage on a code base, getting a GHC panic referring to `dsImpSpecs`.

 This looks pretty much like this old bug:
 https://ghc.haskell.org/trac/ghc/ticket/4870

 I checked that it happens on GHC 7.8.4 and GHC 7.10.1.


 ----

 The problem happens when I run `cabal build --ghc-options "-fhpc"`, giving
 me

 {{{
 Package has never been configured. Configuring with default flags. If this
 fails, please run configure manually.
 Resolving dependencies...
 Configuring ghc-omit-interface-pragmas-dsImpSpecs-bug-0.1.0.0...
 Building ghc-omit-interface-pragmas-dsImpSpecs-bug-0.1.0.0...
 Preprocessing library ghc-omit-interface-pragmas-dsImpSpecs-bug-0.1.0.0...
 [1 of 2] Compiling A                ( src/A.hs, dist/build/A.o )
 [2 of 2] Compiling B                ( src/B.hs, dist/build/B.o )

 src/B.hs:5:1: Warning:
     SPECIALISE pragma for non-overloaded function ‘myfun’
 ghc: panic! (the 'impossible' happened)
   (GHC version 7.8.4 for x86_64-unknown-linux):
     dsImpSpecs
     ghc-omit-interface-pragmas-dsImpSpecs-bug-0.1.0.0:A.myfun{v rpu} [gid]

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 $ ghc --version
 The Glorious Glasgow Haskell Compilation System, version 7.8.4
 $ cabal --version
 cabal-install version 1.18.0.8
 using version 1.18.1.5 of the Cabal library
 }}}

 This doesn't happen when I compile directly with `ghc --make`:

 {{{
 $ cd src && ghc --make -fhpc -fomit-interface-pragmas B.hs -Wall
 [1 of 2] Compiling A                ( A.hs, A.o )
 [2 of 2] Compiling B                ( B.hs, B.o )
 }}}

 So running cabal with `-v`, I see that the problem happens in:

 {{{
 /home/niklas/opt/ghc-7.8/bin/ghc --make -fbuilding-cabal-package -O
 -static -dynamic-too -dynosuf dyn_o -dynhisuf dyn_hi -outputdir dist/build
 -odir dist/build -hidir dist/build -stubdir dist/build -i -idist/build
 -isrc -idist/build/autogen -Idist/build/autogen -Idist/build -optP-include
 -optPdist/build/autogen/cabal_macros.h -package-name ghc-omit-interface-
 pragmas-dsImpSpecs-bug-0.1.0.0 -hide-all-packages -package-db
 dist/package.conf.inplace -package-id
 base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 -XHaskell98 B A -Wall -fhpc
 [1 of 2] Compiling A                ( src/A.hs, dist/build/A.o )
 [2 of 2] Compiling B                ( src/B.hs, dist/build/B.o )

 src/B.hs:5:1: Warning:
     SPECIALISE pragma for non-overloaded function ‘myfun’
 ghc: panic! (the 'impossible' happened)
   (GHC version 7.8.4 for x86_64-unknown-linux):
         dsImpSpecs
     ghc-omit-interface-pragmas-dsImpSpecs-bug-0.1.0.0:A.myfun{v rpu} [gid]

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

 So there it be some flag that cabal passes to GHC that makes this GHC
 crash appear.

 Nevertheless, it's a panic, so I guess it's a bug in GHC.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10504>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list