[GHC] #10158: Panic compiling singletons: StgCmmEnv: variable not found

#10158: Panic compiling singletons: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 (CodeGen) | Operating System: Unknown/Multiple Keywords: | Type of failure: None/Unknown Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- `cabal install singletons` panics like this with HEAD: {{{ ghc: panic! (the 'impossible' happened) (GHC version 7.11.20150313 for x86_64-unknown-linux): StgCmmEnv: variable not found cobox_a1Job local binds for: sConst sAsTypeOf sId %:++ sMap sFoldr %$ %$! $WLet_1627796109GoSym3KindInference $WLet_1627796109GoSym2KindInference $WLet_1627796109GoSym1KindInference $WLet_1627796109GoSym0KindInference $WSeqSym1KindInference $WSeqSym0KindInference $WFlipSym2KindInference $WFlipSym1KindInference $WFlipSym0KindInference $WConstSym1KindInference $WConstSym0KindInference $WAsTypeOfSym1KindInference $WAsTypeOfSym0KindInference $WIdSym0KindInference $W:++$### $W:++$$### $WMapSym0KindInference $WMapSym1KindInference $WFoldrSym2KindInference $WFoldrSym1KindInference $WFoldrSym0KindInference $WLambda_1627796009Sym3KindInference $WLambda_1627796009Sym2KindInference $WLambda_1627796009Sym1KindInference $WLambda_1627796009Sym0KindInference $W:.$$$### $W:.$$### $W:.$### %$1 sAsTypeOf1 sConst1 sFlip1 sId1 sSeq1 a_r1JEg sF_s1JFN sG_s1JFO sA_1627796004_s1JFP Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10158 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10158: Panic compiling singletons: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: new Priority: highest | Milestone: Component: Compiler | Version: 7.11 (CodeGen) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * priority: normal => highest Comment: Yikes! I hope I'm not overstating the importance of my library to GHC, but this sounds serious. Is this reproducible on the 7.10 branch? If so, please set the milestone to 7.10.1. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10158#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10158: Panic compiling singletons: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.12.1 Component: Compiler | Version: 7.11 (CodeGen) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: Compile-time | Test Case: crash | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Changes (by trommler): * failure: None/Unknown => Compile-time crash * milestone: => 7.12.1 Comment: The 7.10 branch is fine! I tried the 7.10 branch at changeset:d6f5b4cf7cf1e3a8946fe6a77ce68ec96baad8fd and singletons compiles. Setting milestone to 7.12.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10158#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10158: Panic compiling singletons: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.12.1 Component: Compiler | Version: 7.11 (CodeGen) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: Compile-time | Test Case: crash | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Comment (by simonpj): I nailed this one. This diff fixes it. It was a missing 'runFlatten'. However I propose not to commit a fix, because Richard's D653 refactors all that code and, I'm 99% certain, fixes the bug in a better way. I would like D653 to land though. Richard is planning to do that on Monday Simon {{{ Modified compiler/typecheck/TcInteract.hs diff --git a/compiler/typecheck/TcInteract.hs b/compiler/typecheck/TcInteract.hs index e83709c..4d4b31c 100644 --- a/compiler/typecheck/TcInteract.hs +++ b/compiler/typecheck/TcInteract.hs @@ -1420,6 +1420,7 @@ shortCutReduction old_ev fsk ax_co fam_tc tc_args | otherwise = ASSERT( not (isDerived old_ev) ) -- Caller ensures this ASSERT( ctEvEqRel old_ev == NomEq ) + runFlatten $ do { (xis, cos) <- flattenManyNom old_ev tc_args -- ax_co :: F args ~ G tc_args -- cos :: xis ~ tc_args }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10158#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10158: Panic compiling singletons: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.12.1 Component: Compiler | Version: 7.11 (CodeGen) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: Compile-time | Test Case: crash | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Comment (by goldfire): Simon, do you have a test case I could add to the testsuite as I land D653? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10158#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10158: Panic compiling singletons: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.12.1 Component: Compiler | Version: 7.11 (CodeGen) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: Compile-time | Test Case: crash | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Comment (by simonpj): I do not. I just looked at the -ddump-ds trace from compiling singletons, noted the missing binding of a coercion, and traced it back to the flattener. With enough thought I might be able to construct a test case (as might you), but there are so many other things to do too Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10158#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10158: Panic compiling singletons: StgCmmEnv: variable not found
-------------------------------------+-------------------------------------
Reporter: trommler | Owner:
Type: bug | Status: new
Priority: highest | Milestone: 7.12.1
Component: Compiler | Version: 7.11
(CodeGen) | Keywords:
Resolution: | Architecture:
Operating System: Unknown/Multiple | Unknown/Multiple
Type of failure: Compile-time | Test Case:
crash | Blocking:
Blocked By: | Differential Revisions:
Related Tickets: |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#10158: Panic compiling singletons: StgCmmEnv: variable not found -------------------------------------+------------------------------------- Reporter: trommler | Owner: Type: bug | Status: closed Priority: highest | Milestone: 7.12.1 Component: Compiler | Version: 7.11 (CodeGen) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: Compile-time | Test Case: crash | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => closed * resolution: => fixed Comment: This should take care of it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10158#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC