[GHC] #14898: Panic with repSplitAppTys

#14898: Panic with repSplitAppTys -------------------------------------+------------------------------------- Reporter: ryanreich | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Keywords: | Operating System: Linux Architecture: x86_64 | Type of failure: Compile-time (amd64) | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I get a GHC panic while compiling a rather large module that contains a fairly simple function: {{{#!hs import Control.Monad.Reader usingReader :: (Monad m) => r -> (a -> ReaderT r m b) (a -> m b) usingReader r f = flip runReaderT r . f }}} Unfortunately, that function alone in a module does not trigger the panic. The error message is: {{{ ghc: panic! (the 'impossible' happened) (GHC version 8.2.1 for x86_64-unknown-linux): repSplitAppTys a_ahFs[sk:1] ReaderT r_ahFr[sk:1] m_ahFq[sk:1] b_ahFt[sk:1] [] Call stack: CallStack (from HasCallStack): prettyCurrentCallStack, called at compiler/utils Outputable.hs:1133:58 in ghc:Outputable callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable pprPanic, called at compiler/types/Type.hs:808:9 in ghc:Type }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14898 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

{{{#!hs import Control.Monad.Reader usingReader :: (Monad m) => r -> (a -> ReaderT r m b) (a -> m b) usingReader r f = flip runReaderT r . f }}}
Unfortunately, that function alone in a module does not trigger the
#14898: Panic with repSplitAppTys -------------------------------------+------------------------------------- Reporter: ryanreich | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by ryanreich): Replying to [ticket:14898 ryanreich]: panic. Note the error in the above type signature: there is a missing arrow on the line with ReaderT. If I fix that error, the panic goes away. However, a standalone module still does not trigger the panic; the type error is correctly reported. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14898#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14898: Panic with repSplitAppTys -------------------------------------+------------------------------------- Reporter: ryanreich | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Could this be a dup of #13819, #14568, #14371, etc? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14898#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14898: Panic with repSplitAppTys -------------------------------------+------------------------------------- Reporter: ryanreich | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): In other words, can you test your program on GHC 8.2.2? The panic should be fixed on that version. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14898#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14898: Panic with repSplitAppTys -------------------------------------+------------------------------------- Reporter: ryanreich | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => infoneeded -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14898#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14898: Panic with repSplitAppTys -------------------------------------+------------------------------------- Reporter: ryanreich | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by sighingnow): I have confirmed that the program in description doesn't trigger panic with ghc-8.2.2. The error message is as follows: {{{#!hs [1 of 1] Compiling T ( T.hs, T.o ) T.hs:313:3: error: ? Expecting one fewer arguments to ‘a -> ReaderT r m b’ Expected kind ‘* -> *’, but ‘a -> ReaderT r m b’ has kind ‘*’ ? In the type signature: usingReader :: (Monad m) => r -> (a -> ReaderT r m b) (a -> m b) | 313 | (a -> ReaderT r m b) | ^^^^^^^^^^^^^^^^^^^^... }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14898#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14898: Panic with repSplitAppTys -------------------------------------+------------------------------------- Reporter: ryanreich | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: duplicate | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13819 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: infoneeded => closed * resolution: => duplicate * related: => #13819 Comment: Now that you mention it, despite ryanreich's message to the contrary, that code alone //does// panic on GHC 8.2.1 when put into its own module: {{{ $ /opt/ghc/8.2.1/bin/ghci Bug.hsGHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Main ( Bug.hs, interpreted ) ghc: panic! (the 'impossible' happened) (GHC version 8.2.1 for x86_64-unknown-linux): repSplitAppTys a_a1Ah[sk:1] ReaderT r_a1Ag[sk:1] m_a1Af[sk:1] b_a1Ai[sk:1] [] Call stack: CallStack (from HasCallStack): prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable pprPanic, called at compiler/types/Type.hs:808:9 in ghc:Type }}} But does not with 8.2.2, as sighingnow noted in comment:5. So this really is a duplicate of #13819. Hooray! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14898#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC