[GHC] #9445: GHC Panic: Tick Exhausted with high factor

#9445: GHC Panic: Tick Exhausted with high factor -------------------------------------+------------------------------------- Reporter: adinapoli | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Keywords: panic | Operating System: MacOS X Architecture: Unknown/Multiple | Type of failure: Difficulty: Unknown | None/Unknown Blocked By: | Test Case: Related Tickets: 5539 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Hello guys, this is an old bug which has been reported so many times that I'm not sure this will be noise or something useful. In a nutshell I have been hit by this bug installing the library "SFML", which relies heavily on FFI. The only interesting thing of this report is that it was necessary an very high simpl-factor to make the installation go through! Pre-bump: {{{ Resolving dependencies... In order, the following will be installed: SFML-0.2.0.0 (reinstall) Warning: Note that reinstalls are always dangerous. Continuing anyway... Configuring SFML-0.2.0.0... Building SFML-0.2.0.0... Preprocessing library SFML-0.2.0.0... [...] [34 of 71] Compiling SFML.Graphics.Transform ( dist/build/SFML/Graphics/Transform.hs, dist/build/SFML/Graphics/Transform.o ) ghc: panic! (the 'impossible' happened) (GHC version 7.8.3 for x86_64-apple-darwin): Simplifier ticks exhausted When trying UnfoldingDone $j_sZQW{v} [lid] 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: 2655928 }}} And this was the magic line: {{{ cabal install SFML --ghc-option=-fsimpl-tick-factor=1630 }}} HTH, it turns out it's quite an annoying one! And yes, "1630" was the smaller factor which made the installation possible. Alfredo -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9445 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9445: GHC Panic: Tick Exhausted with high factor -------------------------------------+------------------------------------- Reporter: adinapoli | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: panic Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: | Difficulty: Unknown None/Unknown | Blocked By: Test Case: | Related Tickets: 5539 Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by simonpj): Urgh. I get this {{{ Resolving dependencies... Downloading SFML-0.2.0.0... Configuring SFML-0.2.0.0... cabal: Missing dependencies on foreign libraries: * Missing C libraries: csfml-window, csfml-system, csfml-graphics, csfml-network, csfml-audio This problem can usually be solved by installing the system packages that provide these libraries (you may need the "-dev" versions). If the libraries are already installed but in a non-standard location then you can use the flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are. Failed to install SFML-0.2.0.0 cabal: Error: some packages failed to install: SFML-0.2.0.0 failed during the configure step. The exception was: ExitFailure 1 }}} Are those C packages essential? It would be good to be able to reproduce this.... 1630 is rather big! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9445#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9445: GHC Panic: Tick Exhausted with high factor -------------------------------------+------------------------------------- Reporter: adinapoli | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: panic Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: | Difficulty: Unknown None/Unknown | Blocked By: Test Case: | Related Tickets: 5539 Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by adinapoli): Sorry Simon, but I have seen this just now. Yes, the are the underlying C libraries SFML links to in order to build. On which platform are you? Windows I would image? Perhaps this might point you into the right direction: http://sfml-dev.org/download/sfml/2.1/ Let me know if I can assist somehow, and yes, 1630 is quite huge! Alfredo -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9445#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9445: GHC Panic: Tick Exhausted with high factor -------------------------------------+------------------------------------- Reporter: adinapoli | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: panic Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: | Difficulty: Unknown None/Unknown | Blocked By: Test Case: | Related Tickets: 5539 Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by coffeecup.winner): I've got the same error building SFML with Haskell Platform 2014.2 32bit on Windows 7 64bit. Factor of 10000 worked for me (haven't tried more than 1000 and less than 10000). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9445#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9445: GHC Panic: Tick Exhausted with high factor -------------------------------------+------------------------------------- Reporter: adinapoli | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: panic Operating System: MacOS X | Architecture: Unknown/Multiple Type of failure: | Difficulty: Unknown None/Unknown | Blocked By: Test Case: | Related Tickets: 5539 Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by Masei): The error seems to be caused by the Num instance. abs needs a tick-factor of 109 and signum a factor of 1630. Disabling rewrite-rules (-fno-enable-rewrite-rules) let it compile again. I peek at the ghc-source but don't found any related rules. Hope it helps anyway. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9445#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9445: GHC Panic: Tick Exhausted with high factor -------------------------------------+------------------------------------- Reporter: adinapoli | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: panic Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #5539 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * os: MacOS X => Unknown/Multiple * related: 5539 => #5539 Comment: I didn't try to reproduce, but I don't think it is Mac specific. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9445#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9445: GHC Panic: Tick Exhausted with high factor -------------------------------------+------------------------------------- Reporter: adinapoli | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: panic Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #5539 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dfeuer): I've stripped it down to a small test case. Under GHC 8.0.2, this requires a tick factor somewhere between 5190 and 5210 (really). Under GHC 8.2, it compiles about as quickly as one might expect. {{{#!hs module SFML.Graphics.Transform ( Transform ) where -- | Encapsulate a 3x3 transform matrix. data Transform = Transform { m00 :: !Float, m10 :: !Float, m20 :: !Float , m01 :: !Float, m11 :: !Float, m21 :: !Float , m02 :: !Float, m12 :: !Float, m22 :: !Float } instance Num Transform where abs (Transform a00 a01 a02 a03 a04 a05 a06 a07 a08) = (Transform (abs a00) (abs a01) (abs a02) (abs a03) (abs a04) (abs a05) (abs a06) (abs a07) (abs a08)) }}} I'll install this test case so we can (hopefully) close the ticket. I am not able to test the actual package at the relevant commit (prior to https://github.com/SFML- haskell/SFML/commit/becb6c967721a77f244b3c0e3c61ac72f13d91eb) because my distribution doesn't offer all the required C libraries. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9445#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9445: GHC Panic: Tick Exhausted with high factor -------------------------------------+------------------------------------- Reporter: adinapoli | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: panic Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #5539 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dfeuer): I've filed [https://github.com/SFML-haskell/SFML/issues/25 a ticket] against SFML to consider reverting their workaround. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9445#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9445: GHC Panic: Tick Exhausted with high factor -------------------------------------+------------------------------------- Reporter: adinapoli | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: panic Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #5539 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): It's great that this one has been fixed. Thank you for adding a test case in due course. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9445#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC