[GHC] #12482: Infinite compilation time when using wrongly ordered constraints

#12482: Infinite compilation time when using wrongly ordered constraints -------------------------------------+------------------------------------- Reporter: danilo2 | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | 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: -------------------------------------+------------------------------------- Hello guys! I've seen today a very strange bug in GHC 8. Namely I've got an instance: {{{ instance {-# OVERLAPPABLE #-} (PrimMonad m, g ~ HMGraph s rels, (g ^. t) ~ Hetero2 (MAutoVector s), s ~ PrimState m, HasProperty2' t g) => DynamicM t (HMGraph s rels) m a where addM el = nested (prop2' @t . wrapped') $ (swap ∘ fmap Ptr) <∘> ixed Cont.addM (unsafeCoerce el) }}} and I'm using it indirectly in Main.hs. It compiles fast and works fine. The problem is that when I change the above constraint to: {{{ (PrimMonad m, HasProperty2' t g, g ~ HMGraph s rels, (g ^. t) ~ Hetero2 (MAutoVector s), s ~ PrimState m) }}} Which is basically the same but with different order, the file with this constraint compiles fast and fine, but Main.hs compiles infinite amount of time (I've killed it after 10 minutes). The problem is reproducible, but it is hard right now to make minimal example out of it (we are going to a conference with a product release and we cannot track it right now). I post it here because maybe the bug is known, if not, after the release I'll try to provide more info. If you've got any questions I'd love to assist. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12482 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12482: Infinite compilation time when using wrongly ordered constraints -------------------------------------+------------------------------------- Reporter: danilo2 | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: 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: | -------------------------------------+------------------------------------- Comment (by simonpj): That is deeply strange. Can you explain how to reproduce. Preferably cut down the example, especially dependencies, as much as possible. Thanks! Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12482#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12482: Infinite compilation time when using wrongly ordered constraints -------------------------------------+------------------------------------- Reporter: danilo2 | Owner: Type: bug | Status: infoneeded Priority: high | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: 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 bgamari): * status: new => infoneeded Comment: Indeed a small program reproducing the issue would be quite helpful. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12482#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12482: Infinite compilation time when using wrongly ordered constraints -------------------------------------+------------------------------------- Reporter: danilo2 | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: 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 simonpj): * priority: high => normal Comment: danilo2, I'm going to decrease priority because we can't make progress on this until we have something to go on. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12482#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12482: Infinite compilation time when using wrongly ordered constraints -------------------------------------+------------------------------------- Reporter: danilo2 | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: 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 bgamari): * milestone: => 8.8.1 Comment: Danilo2, can you still reproduce this with 8.6? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12482#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12482: Infinite compilation time when using wrongly ordered constraints -------------------------------------+------------------------------------- Reporter: danilo2 | Owner: (none) Type: bug | Status: infoneeded Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: 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: | -------------------------------------+------------------------------------- Comment (by simonpj): Danilo2: is this still happening for you with 8.4 or 8.6? Otherwise we'll just close it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12482#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC