Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,932
    • Issues 4,932
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 464
    • Merge requests 464
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #21080
Closed
Open
Created Feb 15, 2022 by Gergő Érdi@cactusContributor

Panic in `lookupIdSubst` when making ModDetails/ModIface by hand

I'm synthesizing a ModDetails/ModIface directly without any original Haskell source code, and running into a problem where GHC fails during Core generation with an internal panic. Also, note the warning (when GHC is compiled with -DDEBUG) that also only shows up when the instance is used:

Loading module Class
Registering module Class
Registering module Enums
Loading module A
Registering module A
WARNING:
  Glomming in A: [EeR :-> Once1]
  Call stack:
      CallStack (from HasCallStack):
        warnPprTrace, called at compiler/GHC/Core/Opt/OccurAnal.hs:85:5 in ghc-lib-0.20211130-7QA7vLTw0OYJmMsraoHe3v:GHC.Core.Opt.OccurAnal
hello: panic! (the 'impossible' happened)
  GHC version 9.3.20211130:
        lookupIdSubst

$fMyClassFoo
InScope {}
Call stack:
    CallStack (from HasCallStack):
      callStackDoc, called at compiler/GHC/Utils/Panic.hs:181:37 in ghc-lib-0.20211130-7QA7vLTw0OYJmMsraoHe3v:GHC.Utils.Panic
      pprPanic, called at compiler/GHC/Core/Subst.hs:260:17 in ghc-lib-0.20211130-7QA7vLTw0OYJmMsraoHe3v:GHC.Core.Subst
      lookupIdSubst, called at compiler/GHC/Core/SimpleOpt.hs:240:10 in ghc-lib-0.20211130-7QA7vLTw0OYJmMsraoHe3v:GHC.Core.SimpleOpt
      simple_opt_expr, called at compiler/GHC/Core/SimpleOpt.hs:225:5 in ghc-lib-0.20211130-7QA7vLTw0OYJmMsraoHe3v:GHC.Core.SimpleOpt

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

To reproduce:

  1. Put attached Class.hs and A.hs files into input/ directory
  2. Edit line 48 of Main.hs to point to your Hadrian stage1 directory
  3. Run Main.hs and observe the error message
Edited Feb 15, 2022 by Gergő Érdi
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking