[GHC] #13188: COMPLETE pragma causes compilation to hang forever under certain scenarios

#13188: COMPLETE pragma causes compilation to hang forever under certain scenarios -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Keywords: | Operating System: Unknown/Multiple PatternSynonyms | Architecture: | Type of failure: Compile-time Unknown/Multiple | performance bug Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This is a really bizarre one. If you have the following program: {{{#!hs {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ViewPatterns #-} module Main where class LL f where go :: f a -> () instance LL [] where go _ = () pattern GoLL :: LL f => f a pattern GoLL <- (go -> ()) {-# COMPLETE GoLL :: [] #-} goLLEx :: [a] -> Int goLLEx GoLL = 5 main :: IO () main = return () }}} And you compile it with GHC HEAD in just the right way, GHC hangs forever! {{{ $ ~/Software/ghc3/inplace/bin/ghc-stage2 -no-link Bug.hs [1 of 1] Compiling Main ( Bug.hs, Bug.o ) $ ~/Software/ghc3/inplace/bin/ghc-stage2 Bug.hs # Hangs forever here }}} That `-no-link` part is crucial, since if you compile it straight from a source file, it works. Also worth noting: * I can reproduce this in GHC HEAD, but not in GHC 8.0.2. * The `COMPLETE` pragma is critical for triggering this bug. If you comment it out, then the issue disappears. Note that `cabal-install` installs executables using this `-no-link` strategy, so this bug effectively prevents me from using `cabal-install` with code that involves `COMPLETE` pragmas. Marking as high priority. I have //no// idea where to start looking for this one. Matthew, do you have any idea what might be happening here? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13188 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13188: COMPLETE pragma causes compilation to hang forever under certain scenarios -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: mpickering Type: bug | Status: new Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * owner: => mpickering -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13188#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13188: COMPLETE pragma causes compilation to hang forever under certain scenarios -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: mpickering Type: bug | Status: patch Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3058 Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * status: new => patch * differential: => Phab:D3058 Comment: See Phab:D3058 If you ever run into problems with interface files the best way to debug them is to use one-shot mode (`-c`) rather than make mode. This ensures that you are actually loading the interface files each time rather than caching the information between modules. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13188#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13188: COMPLETE pragma causes compilation to hang forever under certain scenarios
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: mpickering
Type: bug | Status: patch
Priority: high | Milestone: 8.2.1
Component: Compiler | Version: 8.1
Resolution: | Keywords:
| PatternSynonyms
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
performance bug | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3058
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#13188: COMPLETE pragma causes compilation to hang forever under certain scenarios -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: mpickering Type: bug | Status: closed Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: fixed | Keywords: | PatternSynonyms Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3058 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13188#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC