[GHC] #15716: GHC hangs on default implementation of type family

#15716: GHC hangs on default implementation of type family -------------------------------------+------------------------------------- Reporter: Heimdell | Owner: (none) Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 8.4.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 have this code: {{{ {-# language TypeFamilies #-} {-# language MultiParamTypeClasses #-} {-# language FlexibleInstances #-} import Control.Monad.Except class Component comp where data Error comp :: * type ComponentT comp :: * -> * type ComponentT comp = ExceptT (Error comp) }}} I expect it to either compile or fail with error. Instead, GHC[i] hangs every time. It prints {{{ <interactive>:10:28: error: }}} and then hangs. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15716 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15716: GHC hangs on default implementation of type family -------------------------------------+------------------------------------- Reporter: Heimdell | Owner: (none) Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 8.4.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 Heimdell): It seems to consume neither any memory during the hang, nor processor time. `strace` says: {{{ futex(0x24c8440, FUTEX_WAIT_PRIVATE, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) --- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TIMER, si_timerid=0, si_overrun=0, si_value={int=0, ptr=NULL}} --- rt_sigreturn({mask=[]}) = 202 futex(0x24c8440, FUTEX_WAIT_PRIVATE, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) --- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TIMER, si_timerid=0, si_overrun=0, si_value={int=0, ptr=NULL}} --- write(9, "\377\0\0\0\0\0\0\0", 8) = 8 rt_sigreturn({mask=[]}) = 202 futex(0x24c8440, FUTEX_WAIT_PRIVATE, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) --- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TIMER, si_timerid=0, si_overrun=0, si_value={int=0, ptr=NULL}} --- rt_sigreturn({mask=[]}) = 202 futex(0x24c8440, FUTEX_WAIT_PRIVATE, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) --- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TIMER, si_timerid=0, si_overrun=0, si_value={int=0, ptr=NULL}} --- rt_sigreturn({mask=[]}) = 202 futex(0x24c8440, FUTEX_WAIT_PRIVATE, 0, NULL^C) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) ^Cstrace: Process 13755 detached }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15716#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15716: GHC hangs on default implementation of type family -------------------------------------+------------------------------------- Reporter: Heimdell | Owner: (none) Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 8.4.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 int-index): I cannot reproduce the hang on 8.4.3, I get an error instead: {{{ A.hs:10:28: error: • Expecting one more argument to ‘ExceptT (Error comp)’ Expected kind ‘* -> *’, but ‘ExceptT (Error comp)’ has kind ‘(* -> *) -> * -> *’ • In the type ‘ExceptT (Error comp)’ In the default type instance declaration for ‘ComponentT’ In the class declaration for ‘Component’ | 10 | type ComponentT comp = ExceptT (Error comp) | }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15716#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15716: GHC hangs on default implementation of type family -------------------------------------+------------------------------------- Reporter: Heimdell | Owner: (none) Type: bug | Status: closed Priority: high | Milestone: 8.4.1 Component: Compiler | Version: 8.4.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: #13601 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => duplicate * related: => #13601 * milestone: => 8.4.1 Comment: Indeed, this was fixed in commit c2417b87ff59c92fbfa8eceeff2a0d6152b11a47 (Fix #13819 by refactoring TypeEqOrigin.uo_thing), which debuted in GHC 8.4. The `T13601` test case from #13601 demonstrates a very similar program which used to loop at compile-time before this commit, so I'll close this bug as a duplicate of #13601. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15716#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC