[GHC] #8743: The impossible happened : Prelude.(!!): index too large

#8743: The impossible happened : Prelude.(!!): index too large ----------------------------------+--------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Keywords: | Operating System: Unknown/Multiple Architecture: x86_64 (amd64) | Type of failure: Compile-time crash Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ----------------------------------+--------------------------------------- Running ghc git HEAD (reports it's version as 7.9.20140206) and when cabal installing postgresql-simple I get: {{{ ghc: panic! (the 'impossible' happened) (GHC version 7.9.20140206 for x86_64-unknown-linux): Prelude.(!!): index too large Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug cabal: Error: some packages failed to install: postgresql-simple-0.4.0.2 failed during the building phase. The exception was: }}} postgresql-simple-0.4.0.2 installs fine with 7.6.3. I'm going to compile 7.8-rc1 and see if the same problem exists there. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8743 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8743: The impossible happened : Prelude.(!!): index too large ---------------------------------------+---------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Changes (by erikd): * priority: normal => highest * milestone: => 7.8.1 Comment: Same problem for 7.8-rc1 on amd64 Linux (Debian Testing). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8743#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8743: The impossible happened : Prelude.(!!): index too large ---------------------------------------+---------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Comment (by goldfire): I have a terrible feeling this one is my fault. (I wrote code using `!!` in !TcIface.) But I can't build HEAD (see #8744) to find out. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8743#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8743: The impossible happened : Prelude.(!!): index too large ---------------------------------------+---------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Comment (by rwbarton): I'm trying to massage GHC into giving me a proper stack trace (with `-xc`) but for now I can tell you the exception occurs somewhere inside `WorkWrap.splitFun`. (Which doesn't use `!!` directly, naturally...) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8743#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8743: The impossible happened : Prelude.(!!): index too large ---------------------------------------+---------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Comment (by rwbarton): Okay, success. {{{ *** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace: GHC.List.CAF --> evaluated by: WwLib.deepSplitCprType_maybe.con, called from WwLib.mkWWcpr, called from WwLib.mkWwBodies, called from WorkWrap.splitFun, called from WorkWrap.splitFun, called from WorkWrap.tryWW.doSplit, called from WorkWrap.wwBind, called from WorkWrap.wwTopBinds, called from WorkWrap.wwTopBinds, called from UniqSupply.initUs_, called from WorkWrap.wwTopBinds, called from WorkWrap.wwTopBinds, called from SimplCore.doPassDFU, called from ... }}} The offending code is {{{#!haskell deepSplitCprType_maybe fam_envs con_tag ty | let (co, ty1) = topNormaliseType_maybe fam_envs ty `orElse` (mkReflCo Representational ty, ty) , Just (tc, tc_args) <- splitTyConApp_maybe ty1 , isDataTyCon tc , let cons = tyConDataCons tc con = ASSERT( cons `lengthAtLeast` con_tag ) cons !! (con_tag - fIRST_TAG) = Just (con, tc_args, dataConInstArgTys con tc_args, co) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8743#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8743: The impossible happened : Prelude.(!!): index too large ---------------------------------------+---------------------------------- Reporter: erikd | Owner: nomeata Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Changes (by nomeata): * owner: => nomeata Comment: Thanks for the debugging, that is very helpful. It is likely a problem caused by the demand analyser ignoring coercions, so sometimes the type do not match up; in that the solution will be to just make the code more forgiving. Will look into it later today. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8743#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8743: The impossible happened : Prelude.(!!): index too large
---------------------------------------+----------------------------------
Reporter: erikd | Owner: nomeata
Type: bug | Status: new
Priority: highest | Milestone: 7.8.1
Component: Compiler | Version: 7.8.1-rc1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: x86_64 (amd64)
Type of failure: Compile-time crash | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
---------------------------------------+----------------------------------
Comment (by Joachim Breitner

#8743: The impossible happened : Prelude.(!!): index too large
---------------------------------------+----------------------------------
Reporter: erikd | Owner: nomeata
Type: bug | Status: new
Priority: highest | Milestone: 7.8.1
Component: Compiler | Version: 7.8.1-rc1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: x86_64 (amd64)
Type of failure: Compile-time crash | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
---------------------------------------+----------------------------------
Comment (by Joachim Breitner

#8743: The impossible happened : Prelude.(!!): index too large ---------------------------------------+---------------------------------- Reporter: erikd | Owner: nomeata Type: bug | Status: merge Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Changes (by nomeata): * status: new => merge Comment: Test case added and the obvious fix applied; please merge to 7.8. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8743#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8743: The impossible happened : Prelude.(!!): index too large ---------------------------------------+---------------------------------- Reporter: erikd | Owner: nomeata Type: bug | Status: closed Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8743#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8743: The impossible happened : Prelude.(!!): index too large -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by ezyang): * owner: nomeata => * status: closed => new * resolution: fixed => Comment: After adjusting the test-case to not do a direct import of the hs-boot file, I now get this Core Lint error: {{{ Compile failed (status 256) errors were: *** Core Lint errors : in result of Simplifier *** T8743.hs-boot:3:10: warning: [RHS of $fxToRowMaybe :: forall a_anp. ToRow (Maybe a_anp)] idArity 1 exceeds typeArity 0: $fxToRowMaybe *** Offending Program *** $ctoRow_awT :: forall a_awR. Maybe a_awR -> [()] [LclId, Arity=1, Str=DmdType, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True)}] $ctoRow_awT = \ (@ a_awR) (ds_dx0 :: Maybe a_awR) -> case ds_dx0 of _ [Occ=Dead] { __DEFAULT -> : @ () () ([] @ ()) } $fToRowMaybe [InlPrag=INLINE (sat-args=0)] :: forall a_awP. ToRow (Maybe a_awP) [LclIdX[DFunId(nt)], Arity=1, Str=DmdType, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=0,unsat_ok=False,boring_ok=True) Tmpl= $ctoRow_awT `cast` (forall a_awR. Sym (NTCo:ToRow[0] <Maybe a_awR>_N) :: (forall a_awR. Maybe a_awR -> [()]) ~R# (forall a_awR. ToRow (Maybe a_awR)))}] $fToRowMaybe = $ctoRow_awT `cast` (forall a_awR. Sym (NTCo:ToRow[0] <Maybe a_awR>_N) :: (forall a_awR. Maybe a_awR -> [()]) ~R# (forall a_awR. ToRow (Maybe a_awR))) $fxToRowMaybe :: forall a_anp. ToRow (Maybe a_anp) [LclIdX, Arity=1, Str=DmdType, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)}] $fxToRowMaybe = $fToRowMaybe *** End of Offense *** }}} Do not know enough to investigate further. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8743#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8743: The impossible happened : Prelude.(!!): index too large -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by ezyang): You can get the new test-case by applying https://phabricator.haskell.org/D860 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8743#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8743: The impossible happened : Prelude.(!!): index too large -------------------------------------+------------------------------------- Reporter: erikd | Owner: nomeata Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by ezyang): * owner: => nomeata -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8743#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8743: The impossible happened : Prelude.(!!): index too large -------------------------------------+------------------------------------- Reporter: erikd | Owner: nomeata Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by nomeata): I’m confused. The harbormaster build for Phab:D860 at https://phabricator.haskell.org/harbormaster/build/3863/ does not list 8743 as failing. Also, this looks like a different bug, unrelated to the demand analyzer, and related to the lint check introduced in #10181. I suggest to discuss this in a separate ticket. Also feel free to go ahead with your patches, marking the test case as `expect_broken`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8743#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8743: The impossible happened : Prelude.(!!): index too large -------------------------------------+------------------------------------- Reporter: erikd | Owner: nomeata Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by nomeata): I indeed was confused. The test is already marked as `expect_broken`, and you are trying to fix the breakage... But it still is unrelated to the demand analyzer. I’ll continue the discussion in #10182, where it belongs. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8743#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8743: The impossible happened : Prelude.(!!): index too large -------------------------------------+------------------------------------- Reporter: erikd | Owner: nomeata Type: bug | Status: closed Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by nomeata): * status: new => closed * resolution: => fixed Comment: Fixed by SPJ in changeset:9b9fc4c732baab126b057b4031bebcbd67d6e348 as talked. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8743#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC