
#12571: GHC panic -------------------------------------+------------------------------------- Reporter: prsteele | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Linux Architecture: x86_64 | Type of failure: Compile-time (amd64) | crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I received the following error message from GHC: {{{ <no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.10.3 for x86_64-unknown-linux): Simplifier ticks exhausted When trying UnfoldingDone $fStorableWord21 To increase the limit, use -fsimpl-tick-factor=N (default 100) If you need to do this, let GHC HQ know, and what factor you needed To see detailed counts use -ddump-simpl-stats Total ticks: 8040 Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} When I followed the suggestion of adding `-fsimpl-tick-factor=200` the compiler proceeds normally (finding a syntax error in a file). Removing this option, strangely, also causes the compiler to proceed normally. I can no longer reproduce this bug, although several compilations in a row (before adding the option) reproduced the bug. Although I cannot reproduce this bug, the syntax error that is present came from an error of the form: {{{#!hs f :: A -> M B f a = do x <- g a let c = h a in do ... }}} The actual file is attached. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12571 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12571: GHC panic -------------------------------------+------------------------------------- Reporter: prsteele | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by prsteele): * Attachment "DB.hs" added. The file containing the syntax error that the compiler was eventually able to find. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12571 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12571: GHC panic -------------------------------------+------------------------------------- Reporter: prsteele | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): The error is because GHC was doing too much inlining. The syntax error is completely unrelated. Maybe if you try with `-fforce-recomp` you will be able to reproduce the problem? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12571#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12571: GHC panic -------------------------------------+------------------------------------- Reporter: prsteele | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by prsteele): Adding {{{-fforce-recomp}}} did in fact cause the bug to resurface. I've used this to isolate the value I need for {{{-fsimpl-tick-factor}}} to cause the compiler to succeed. In particular, {{{-fsimpl-tick- factor=110}}} causes the compiler to fail, but {{{-fsimpl-tick- factor=111}}} causes the compiler to succeed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12571#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12571: GHC panic -------------------------------------+------------------------------------- Reporter: prsteele | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * status: new => infoneeded Comment: Please provide the code which causes the inlining to happen. These kinds of reports are usually because a library author is over zealous adding inline pragmas to everything. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12571#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12571: GHC panic -------------------------------------+------------------------------------- Reporter: prsteele | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by prsteele): * Attachment "ghc-bug.zip" added. A snapshot of the code that can exhibit the bug -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12571 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12571: GHC panic -------------------------------------+------------------------------------- Reporter: prsteele | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by prsteele): I have attached a ZIP file containing a snapshot of the project. The project currently can be compiled via `cabal build create-tables`. However, if you remove the `-fsimpl-tick-factor=131` in the `recipes.cabal` file (or decrease the number to 130 or below) the bug appears. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12571#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12571: GHC panic -------------------------------------+------------------------------------- Reporter: prsteele | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): From initial inspection, it seems that the reason for the message is that `postgresql-simple` uses bytestrings to represent the query type. Basically every function in the bytestring library is marked inline so when the `String` is converted to a `Bytestring` using the builder function which maps over the whole string, a lot of inlining is then exposed which GHC dutifully performs. The reason this trips things up is that your strings are quite long I think and there are quite a few of them in the file. So I'm not sure what to suggest here, it seems the best would be to just keep the flag in your cabal file as the compile time didn't seem too long to me. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12571#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12571: ByteString builder causes the optimiser to run out of ticks -------------------------------------+------------------------------------- Reporter: prsteele | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: duplicate | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * status: infoneeded => closed * resolution: => duplicate Comment: Seems like https://github.com/haskell/bytestring/issues/45 is related. so I will close this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12571#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC