[GHC] #10627: cabal install of numeric-prelude hangs

#10627: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Keywords: | Operating System: MacOS X Architecture: | Type of failure: Compile-time Unknown/Multiple | crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- While trying to do cabal install species with 7.10.2rc2 I discovered that it hangs compiling numeric-prelude in src/Algebra/RealRing.h. It doesn't seem to be busy computing as cpu usage is 0% {{{ ghc -V The Glorious Glasgow Haskell Compilation System, version 7.10.1.20150630 cabal install --verbose=3 numeric-prelude ... [39 of 97] Compiling Algebra.RealRing ( src/Algebra/RealRing.hs, dist/build/Algebra/RealRing.o ) ... Result size of Float out(FOS {Lam = Just 0, Consts = True, OverSatApps = True}) = {terms: 3,506, types: 3,224, coercions: 4} *** Common sub-expression: Result size of Common sub-expression }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie): Did you try installing the same version of numeric-prelude with ghc-7.10.1. As in: is this a regression? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by George: Old description:
While trying to do cabal install species with 7.10.2rc2 I discovered that it hangs compiling numeric-prelude in src/Algebra/RealRing.h. It doesn't seem to be busy computing as cpu usage is 0% {{{ ghc -V The Glorious Glasgow Haskell Compilation System, version 7.10.1.20150630 cabal install --verbose=3 numeric-prelude ... [39 of 97] Compiling Algebra.RealRing ( src/Algebra/RealRing.hs, dist/build/Algebra/RealRing.o ) ...
Result size of Float out(FOS {Lam = Just 0, Consts = True, OverSatApps = True}) = {terms: 3,506, types: 3,224, coercions: 4} *** Common sub-expression: Result size of Common sub-expression }}}
New description: While trying to do cabal install species with HP 7.10.2rc2 I discovered that it hangs compiling numeric-prelude in src/Algebra/RealRing.h. It doesn't seem to be busy computing as cpu usage is 0%. It also hangs with HP 7.10.1.20150612 but works with HP 7.10.1.20150601 {{{ ghc -V The Glorious Glasgow Haskell Compilation System, version 7.10.1.20150630 cabal install --verbose=3 numeric-prelude ... [39 of 97] Compiling Algebra.RealRing ( src/Algebra/RealRing.hs, dist/build/Algebra/RealRing.o ) ... Result size of Float out(FOS {Lam = Just 0, Consts = True, OverSatApps = True}) = {terms: 3,506, types: 3,224, coercions: 4} *** Common sub-expression: Result size of Common sub-expression }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by George): Replying to [comment:1 thomie]:
Did you try installing the same version of numeric-prelude with ghc-7.10.1. As in: is this a regression? Thanks for asking me to check that, it is a regression as noted in the description which I just modified
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie): Ok. The next thing to do would be to reduce the test. No packages, no cabal, just a single file that fails to build with ghc. Sometimes this is not so easy, but without it these type of bugs don't get fixed easily either. Maybe you want to give it a try? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by George): Sorry, I don't think I can, I will however send mail to the package maintainer, Henning Thielemann and cc Brent Yorgey whose species package depends on numeric prelude. I set the priority as high as it seems that shipping a release that can't compile a package it could previously is not a good thing. The impact of the bug is not clear. However, I personally don't need this fix. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Lemming): My first interesting observation is that GHCi (run by `cabal repl`) can load all modules. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by Lemming): * cc: ghc@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by George): Replying to [comment:6 Lemming]:
My first interesting observation is that GHCi (run by `cabal repl`) can load all modules. Thanks Lemming, what version of ghc are you using? What platform?
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Lemming): Replying to [comment:8 George]:
Thanks Lemming, what version of ghc are you using? What platform?
GHC-7.10.1.20150630 from the Ubuntu-HVR-PPA package ghc-7.10.2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by George): Replying to [comment:9 Lemming]:
Replying to [comment:8 George]:
Thanks Lemming, what version of ghc are you using? What platform?
GHC-7.10.1.20150630 from the Ubuntu-HVR-PPA package ghc-7.10.2 Can you confirm that you can reproduce the bug with cabal install?
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Lemming): I attached a minimal example that you can run with: {{{ $ ghc-7.10.1.20150630 -O RealRing.hs [1 of 1] Compiling RealRing ( RealRing.hs, RealRing.o ) RealRing.hs:11:6: Warning: Rule "NP.roundSimple :: a -> Word" may never fire because ‘roundSimple’ might inline first Probable fix: add an INLINE[n] or NOINLINE[n] pragma on ‘roundSimple’ ^C }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by George): Replying to [comment:6 Lemming]:
My first interesting observation is that GHCi (run by `cabal repl`) can load all modules. Yes, cabal repl works for me also {{{ ghc -V The Glorious Glasgow Haskell Compilation System, version 7.10.1.20150630 cabal get -s numeric-prelude cd numeric-prelude cabal sandbox init cabal install --only-dependencies cabal repl }}} However after quitting out of the repl, cabal build fails cabal build Building numeric-prelude-0.4.2... ... It hangs after emitting the following {{{ src/Algebra/RealRing.hs:369:6: Warning: Rule "NP.roundSimple :: a -> Word64" may never fire because ‘roundSimple’ might inline first Probable fix: add an INLINE[n] or NOINLINE[n] pragma on ‘roundSimple’ }}}
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Lemming): Replying to [comment:6 Lemming]:
My first interesting observation is that GHCi (run by `cabal repl`) can load all modules.
I think it is because GHCi does not optimize and the problem seems to be the rewrite rule. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by George): Replying to [comment:11 Lemming]:
I attached a minimal example that you can run with: {{{ $ ghc-7.10.1.20150630 -O RealRing.hs [1 of 1] Compiling RealRing ( RealRing.hs, RealRing.o )
RealRing.hs:11:6: Warning: Rule "NP.roundSimple :: a -> Word" may never fire because ‘roundSimple’ might inline first Probable fix: add an INLINE[n] or NOINLINE[n] pragma on ‘roundSimple’ ^C }}} Thanks! That fails for me also. It works if I compile without the -O
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by George): * cc: george (added) * os: MacOS X => Unknown/Multiple -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: MacOS X | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * cc: ghc@…, george (removed) * os: Unknown/Multiple => MacOS X Comment: Amazing. I couldn't resist looking at this, and it seems to be a very long-standing bug, introduced I think by {{{ commit 30c17e7096919c55218083c8fcb98e6287552058 Author: simonpj@microsoft.com <unknown> Date: Thu Nov 25 17:23:56 2010 +0000 Substitution should just substitute, not optimise This was causing Trac #4524, by optimising (e |> co) to e on the LHS of a rule. Result, the template variable 'co' wasn't bound any more. Now that substition doesn't optimise, it seems sensible to call simpleOptExpr rather than substExpr when substituting in the RHS of rules. Not a big deal either way. }}} The last para says "optimise the RHS of rules when substituting", but that is too strict in the `IdInfo` of an `Id` if the RULE refers to the same `Id`. I don't know how this ever worked. Patch coming. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by Lemming): * cc: ghc@…, george (added) * os: MacOS X => Unknown/Multiple -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs
-------------------------------------+-------------------------------------
Reporter: George | Owner:
Type: bug | Status: new
Priority: high | Milestone: 7.10.2
Component: Compiler | Version: 7.10.2-rc2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: merge Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | simplCore/should_compile/T10627 Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => merge * testcase: => simplCore/should_compile/T10627 Comment: OK, fixed now. Thanks for reporting. Worth merging to 7.10.2 Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: merge Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | simplCore/should_compile/T10627 Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by George): That's great! Do we understand why this worked as recently as June 1st? Also, why would the compiler hang without this fix? Just curious. Thanks -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: merge Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | simplCore/should_compile/T10627 Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Replying to [comment:20 George]:
Do we understand why this worked as recently as June 1st?
No, I'm not sure.
Also, why would the compiler hang without this fix? Just curious.
It's the knot-tying in `CoreSubst.simplRecBndrs`. Did you read `Note [Substitute lazily]` referred to in the commit message? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:21 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: merge Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | simplCore/should_compile/T10627 Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by George): Yes, in between posting the comment and reading your reply. :) Thanks for explaining! Sorry to bother you. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:22 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: closed Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash | simplCore/should_compile/T10627 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged into `ghc-7.10` as 3794b597896e1138e23043de5646e60e3d011b27. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:23 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10627: Regression: cabal install of numeric-prelude hangs -------------------------------------+------------------------------------- Reporter: George | Owner: Type: bug | Status: closed Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash | simplCore/should_compile/T10627 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Lemming): I can compile numeric-prelude with `ghc-7.10.1.20150715`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10627#comment:24 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC