[GHC] #14402: Compiler hangs - UdecidableInstances
GHC
ghc-devs at haskell.org
Mon Oct 30 02:03:39 UTC 2017
#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
More information about the ghc-tickets
mailing list