Skip to content

Panic `lookupIdSubst` on GHC 9.10.2, 9.8.4, but not 9.6.7:

Summary

This might be a duplicate, as there are several issues that mention similar panics. Apologies in advance if so.

The bug manifests locally on my system and in CI. My system is an AArch64 mac. CI runner is a GitHub Actions Ubuntu image, x86_64 IIUC.

<no location info>: error:
    panic! (the 'impossible' happened)
  GHC version 9.10.2:
	lookupIdSubst
  $dIP_aF21
  InScope {wild_00 wild_X1 wild_X2 wild_X3 la_aBgv simOpts_aBgw
           bak_aBgx fm_aBgy halloc_aBgz llvmCtx_aBgA llvmMod_aBgB initMem_aBgC
           setupHook_aBgD mbStartupOvCfg_aBgE scfg_aBgF cfg_aBgG memVar_aBgH
           execFeats_aBgQ profLogTask_aBgR argTys_aBgT argNames_aBgU
           initArgShapes_aBh2 bounds_aBh3 valueNames_aBh4 typeCtx_aBh6 dl_aBh9
           $dKnownNat_aEM1 $dKnownNat_aEQx $dIP_aEX6 sym_aEXn bak_aEXo
           arch_aEXp solver_aEXq t_aEXr st_aEXs fm_aEXt argTys_aEXu ret_aEXv
           $dCTuple3_aEXw $dCTuple4_aEXx $dIP_aEXy blocks_aEXB $dIP_aEZ6
           co_aEZf $dIP_aF0n $dIP_aF0V $d~_aF5J $d~_aF5O $d~_aF6n $d~_aF77
           $d~_aF7c $dIP_aFiF $dIP_aFDi irred_aGFu $dIP_aGFw
           $dOnlineSolver_aGFx $dIsSymBackend_aGFC co_aGGm co_aGGn
           $dCTuple3_aGM3 $d~_aGMe $d~_aGMf $d~_aGMg $krep_aHbG $krep_aHbH
           $krep_aHbI $krep_aHbJ $krep_aHbK ds_dI4L ds_dI4P a_dI56 c_dI57
           n_dI58 logResults simulateARM simulateARMSyntax simulatePPC32
           simulatePPC32Syntax simulatePPC64 simulateX86 simulateX86Syntax
           getResults $tc'Results $trModule $tcMacawCfgConfig $tcResults
           mcDataLayout mcMprotectAddr mcLoadOptions mcSymMap mcPltStubs
           mcDynFunMap mcRelocs mcMemory mcTxtBounds mcElf doLog
           readElfHeaderInfo nonSymbolEntrypointException textBounds
           withMemOptions loadInitialPreconditions useSimpleShapes toBatchBug
           toFailedPredicate checkMustFail macawDataLayout interestingRegs
           interestingConcretizedShapes macawInitArgShapes overrideRegs
           macawExecFeats llvmExecFeats macawMemConfig macawInitState
           simulateMacawCfg simulateRewrittenCfg simulateMacawCfgs toSsaAnyCfg
           entrypointCfgMap analyzeEntrypoint loadAddrOvs loadLLVMSExpOvs
           simulateMacawSyntax simulateMacaw llvmInitArgShapes logAction
           simulateMacawRaw simulateRawArch simulateARMRaw simulatePPC32Raw
           simulateX86Raw}
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/GHC/Utils/Panic.hs:190:37 in ghc-9.10.2-aac9:GHC.Utils.Panic
        pprPanic, called at compiler/GHC/Core/Subst.hs:196:17 in ghc-9.10.2-aac9:GHC.Core.Subst
  CallStack (from HasCallStack):
    panic, called at compiler/GHC/Utils/Error.hs:507:29 in ghc-9.10.2-aac9:GHC.Utils.Error

Steps to reproduce

Build commit c2b360e39c1058f16b5a94735d14f6e0c6b1d31a on this branch of my project (GREASE).

Expected behavior

The compiler does not panic.

Environment

  • GHC version used: 9.10.2 or 9.8.4 from ghcup. Unfortunately I can't test with GHC 9.12 because we aren't yet compatible with it.
uname -a

Darwin 000800-langston.local 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:53:27 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6041 arm64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information