[GHC] #13715: test dynamic-paper for way profasm fails with Simplifier ticks exhausted

#13715: test dynamic-paper for way profasm fails with Simplifier ticks exhausted -------------------------------------+------------------------------------- Reporter: George | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1-rc2 Keywords: simplifier | Operating System: Unknown/Multiple ticks | Architecture: | Type of failure: Compile-time Unknown/Multiple | crash or panic Test Case: dynamic-paper | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- on ghc 8.2.1-rc2 on a mac running the latest Xcode and os {{{ make TEST=dynamic-paper WAY=profasm fails with ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.2.0.20170507 for x86_64-apple-darwin): Simplifier ticks exhausted When trying UnfoldingDone delta ... Call stack: CallStack (from HasCallStack): prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1134:58 in ghc:Outputable callStackDoc, called at compiler/utils/Outputable.hs:1138:37 in ghc:Outputable pprPanic, called at compiler/simplCore/SimplMonad.hs:199:31 in ghc:SimplMonad it also fails with 1000 ticks make TEST=dynamic-paper WAY=profasm EXTRA_HC_OPTS='-fsimpl-tick- factor=1000' so there may be an infinite loop -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13715 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13715: test dynamic-paper for way profasm fails with Simplifier ticks exhausted -------------------------------------+------------------------------------- Reporter: George | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1-rc2 Resolution: | Keywords: simplifier | ticks Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: dynamic-paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by George): * Attachment "sbug.hs" added. simplified version (26 lines) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13715 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13715: test dynamic-paper for way profasm fails with Simplifier ticks exhausted -------------------------------------+------------------------------------- Reporter: George | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1-rc2 Resolution: | Keywords: simplifier | ticks Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: dynamic-paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by George): added attachment , simplified version of bug with 26 lines, sbug.hs. The problem can be reproduced with {{{ ghc -c sbug.hs -O -fprof-auto -prof -static }}} adding {{{ -fsimpl-tick-factor=1000 }}} still results in the error: Simplifier ticks exhausted. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13715#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13715: test dynamic-paper for way profasm fails with Simplifier ticks exhausted -------------------------------------+------------------------------------- Reporter: George | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Research | needed Component: Compiler | Version: 8.2.1-rc2 Resolution: | Keywords: simplifier | ticks Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: dynamic-paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * milestone: => Research needed Comment: Aha! Dimitrios and I identified this problem with `TypeRep`, and wrote about this in Section 7 of [https://www.microsoft.com/en- us/research/publication/typed-reflection-in-haskell/ Typed reflection in Haskell]. This example probably comes straight from that section. Divergence is absolutely expected here; and the simplifier-tick mechanism correctly prevents the compiler from hanging. Of course, it would be better to spot the problem and not inline the function, but I don't know how to do that. An interesting research problem. Meanwhile, since there is no immediate prospect of solving this, and it's not causing any problems in practice, I'll move to milestone "research needed". -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13715#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13715: test dynamic-paper for way profasm fails with Simplifier ticks exhausted -------------------------------------+------------------------------------- Reporter: George | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Research | needed Component: Compiler | Version: 8.2.1-rc2 Resolution: | Keywords: simplifier | ticks Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: dynamic-paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by George): Is it a bug that it only diverges with "-fprof-auto -auto"? It compiles fine without those options. Yes, the code does come from that paper, as mentioned in a comment in the non-simplified version. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13715#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13715: test dynamic-paper for way profasm fails with Simplifier ticks exhausted -------------------------------------+------------------------------------- Reporter: George | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Research | needed Component: Compiler | Version: 8.2.1-rc2 Resolution: | Keywords: simplifier | ticks Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: dynamic-paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): It diverges for me (with HEAD) even without profiling. I can't explain why it doesn't for you. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13715#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13715: test dynamic-paper for way profasm fails with Simplifier ticks exhausted -------------------------------------+------------------------------------- Reporter: George | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Research | needed Component: Compiler | Version: 8.2.1-rc2 Resolution: | Keywords: simplifier | ticks Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: dynamic-paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by George): I think we get different results because I am using rc2 and you are using head. With the testsuite distributed with rc2 divergence is classified as failure when it seems it should be classified as success -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13715#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13715: test dynamic-paper for way profasm fails with Simplifier ticks exhausted -------------------------------------+------------------------------------- Reporter: George | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Research | needed Component: Compiler | Version: 8.2.1-rc2 Resolution: | Keywords: simplifier | ticks Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: dynamic-paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by alpmestan): I'm seeing a failure for `profasm` as well with a recent checkout of the master branch (commit 8b823f270e), with the simplifier tick limit error. If we increase the limit, we run out of stack space. If we increase the stack size enough with -K, we run out of simplifier ticks again. I'll mark the test as expected broken with the `profasm` way, but this does look rather suspicious. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13715#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13715: test dynamic-paper for way profasm fails with Simplifier ticks exhausted -------------------------------------+------------------------------------- Reporter: George | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Research | needed Component: Compiler | Version: 8.2.1-rc2 Resolution: | Keywords: simplifier | ticks Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: dynamic-paper Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by alpmestan): * cc: alpmestan (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13715#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC