Skip to content

GHC panics when compiling code generated from Agda with profiling enabled

Summary

I'm running into a problem with GHC where I'm trying to compile some code generated from Agda using MAlonzo. GHC panics with the following error message:

[200 of 539] Compiling MAlonzo.Code.Relation.Binary.PropositionalEquality.Properties ( MAlonzo/Code/Relation/Binary/PropositionalEquality/Properties.hs, dist/build/MAlonzo/Code/Relation/Binary/PropositionalEquality/Properties.p_o )

<no location info>: error:
    panic! (the 'impossible' happened)
  GHC version 9.8.2:
        coreToStgArgs
  ((scc<du_isDecEquivalence_398> v0_s41vj)
   `cast` (Sub (Sym Univ(nominal CorePrep
                         :: Any, Any -> Any -> T_Dec_20))
           :: (Any -> Any -> T_Dec_20) ~R# Any))
  `cast` (SelCo:Fun(arg)
              (Sub Univ(nominal CorePrep
                        :: Any -> Any, (Any -> Any -> T_Dec_20) -> T_IsDecEquivalence_44))
          :: Any ~R# (Any -> Any -> T_Dec_20))
  v0_s41vj
  v0_s41vj
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/GHC/Utils/Panic.hs:191:37 in ghc-9.8.2-inplace:GHC.Utils.Panic
        pprPanic, called at compiler/GHC/CoreToStg.hs:605:17 in ghc-9.8.2-inplace:GHC.CoreToStg
  CallStack (from HasCallStack):
    panic, called at compiler/GHC/Utils/Error.hs:503:29 in ghc-9.8.2-inplace:GHC.Utils.Error


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

It also seems to fail in multiple other files with a similar error. The project builds fine if the --enable-profiling flag is not set.

Steps to reproduce

Expected behavior

I expect the project to compile successfully

Environment

  • GHC versions used: 9.2.8, 9.4.7, 9.6.4, 9.8.2

Optional:

  • Operating System: NixOS
Edited by Joosep Jääger
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information