[GHC] #14402: Compiler hangs - UdecidableInstances

#14402: Compiler hangs - UdecidableInstances -------------------------------------+------------------------------------- Reporter: lehins | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Compile-time Unknown/Multiple | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Normally I wouldn't consider GHC going into infinite loop when `UndecidableInstances` is enabled as a bug, because compiler still terminates unless maybe something like `-freduction-depth=0` is supplied. That is not the case with this few lines of Haskell, as they cause GHC to hang for good and even made it use up all of my 32Gb of RAM, while I was looking the other way. Seems a bit unusual for GHC, so here is a record of it as a bug report. Compiling with `-v3` stops here: {{{ [1 of 1] Compiling Nested ( src/Nested.hs, .stack- work/dist/x86_64-linux/Cabal-2.0.0.2/build/Nested.o ) *** Parser [Nested]: !!! Parser [Nested]: finished in 1.03 milliseconds, allocated 0.566 megabytes *** Renamer/typechecker [Nested]: }}} Compilation with GHC 8.0.2 goes through just fine. Although, I did encounter it hanging as part of a much bigger picture because of the same few lines of code. Coming up with a small reproducible example is much harder for that case as it hangs while compiling the test suite, instead of the offending module. In order to replicate the problem, the included code has to be compiled as a library rather than as an executable. Using `stack build --install-ghc` should do it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14402 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14402: Compiler hangs - UdecidableInstances -------------------------------------+------------------------------------- Reporter: lehins | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by lehins): * Attachment "Nested.hs" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14402 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14402: Compiler hangs - UdecidableInstances -------------------------------------+------------------------------------- Reporter: lehins | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by lehins): * Attachment "bug.cabal" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14402 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14402: Compiler hangs - UdecidableInstances -------------------------------------+------------------------------------- Reporter: lehins | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by lehins): * Attachment "stack.yaml" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14402 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14402: Compiler hangs - UdecidableInstances -------------------------------------+------------------------------------- Reporter: lehins | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): Does compiling with `-fno-solve-constant-dicts` solve the problem? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14402#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14402: Compiler hangs - UdecidableInstances -------------------------------------+------------------------------------- Reporter: lehins | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): Perhaps a duplicate of #13943 Which is fixed by https://phabricator.haskell.org/rGHCa8fde1831f4b99885b8ed444f9cd7dffd9252150 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14402#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14402: Compiler hangs - UdecidableInstances -------------------------------------+------------------------------------- Reporter: lehins | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * resolution: => duplicate Comment:
Perhaps a duplicate of #13943
Looks like it. Indeed `Nested.hs -O` fails makes GHC 8.2 loop, but HEAD is fine. I'll just close as dup Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14402#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC