Opened 4 years ago

Last modified 2 years ago

#10584 new bug

Installation of SFML failed

Reported by: SoleSoul Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.8.4
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time performance bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by bgamari)

This report is bad because I have no idea what I'm reporting but the compiler asked me to so there you go:

% cabal install sfml                                   :(
Resolving dependencies...
Configuring SFML-0.2.0.0...
Building SFML-0.2.0.0...
Failed to install SFML-0.2.0.0
Build log ( /home/user/.cabal/logs/SFML-0.2.0.0.log ):
Configuring SFML-0.2.0.0...
Building SFML-0.2.0.0...
Preprocessing library SFML-0.2.0.0...
[ 1 of 71] Compiling SFML.Window.WindowHandle ( src/SFML/Window/WindowHandle.hs, dist/build/SFML/Window/WindowHandle.o )
[ 2 of 71] Compiling SFML.SFDisplayable ( src/SFML/SFDisplayable.hs, dist/build/SFML/SFDisplayable.o )
[ 3 of 71] Compiling SFML.SFCopyable  ( src/SFML/SFCopyable.hs, dist/build/SFML/SFCopyable.o )
[ 4 of 71] Compiling SFML.System.InputStream ( dist/build/SFML/System/InputStream.hs, dist/build/SFML/System/InputStream.o )
[ 5 of 71] Compiling SFML.SFResource  ( src/SFML/SFResource.hs, dist/build/SFML/SFResource.o )
[ 6 of 71] Compiling SFML.Utils       ( src/SFML/Utils.hs, dist/build/SFML/Utils.o )
[ 7 of 71] Compiling SFML.Window.VideoMode ( dist/build/SFML/Window/VideoMode.hs, dist/build/SFML/Window/VideoMode.o )
[ 8 of 71] Compiling SFML.Window.Types ( src/SFML/Window/Types.hs, dist/build/SFML/Window/Types.o )
[ 9 of 71] Compiling SFML.Window.Keyboard ( dist/build/SFML/Window/Keyboard.hs, dist/build/SFML/Window/Keyboard.o )
[10 of 71] Compiling SFML.Window.Joystick ( dist/build/SFML/Window/Joystick.hs, dist/build/SFML/Window/Joystick.o )
[11 of 71] Compiling SFML.Window.ContextSettings ( dist/build/SFML/Window/ContextSettings.hs, dist/build/SFML/Window/ContextSettings.o )
[12 of 71] Compiling SFML.Window.Context ( dist/build/SFML/Window/Context.hs, dist/build/SFML/Window/Context.o )
[13 of 71] Compiling SFML.System.Vector3 ( dist/build/SFML/System/Vector3.hs, dist/build/SFML/System/Vector3.o )
[14 of 71] Compiling SFML.System.Vector2 ( dist/build/SFML/System/Vector2.hs, dist/build/SFML/System/Vector2.o )
[15 of 71] Compiling SFML.Window.Mouse ( dist/build/SFML/Window/Mouse.hs, dist/build/SFML/Window/Mouse.o )
[16 of 71] Compiling SFML.Window.Event ( dist/build/SFML/Window/Event.hs, dist/build/SFML/Window/Event.o )
[17 of 71] Compiling SFML.Window.SFWindow ( src/SFML/Window/SFWindow.hs, dist/build/SFML/Window/SFWindow.o )
[18 of 71] Compiling SFML.Window.Window ( dist/build/SFML/Window/Window.hs, dist/build/SFML/Window/Window.o )
[19 of 71] Compiling SFML.System.Time ( dist/build/SFML/System/Time.hs, dist/build/SFML/System/Time.o )
[20 of 71] Compiling SFML.Audio.SFSoundBuffer ( src/SFML/Audio/SFSoundBuffer.hs, dist/build/SFML/Audio/SFSoundBuffer.o )
[21 of 71] Compiling SFML.System.Sleep ( dist/build/SFML/System/Sleep.hs, dist/build/SFML/System/Sleep.o )
[22 of 71] Compiling SFML.System.Clock ( src/SFML/System/Clock.hs, dist/build/SFML/System/Clock.o )
[23 of 71] Compiling SFML.System      ( src/SFML/System.hs, dist/build/SFML/System.o )
[24 of 71] Compiling SFML.Window      ( src/SFML/Window.hs, dist/build/SFML/Window.o )
[25 of 71] Compiling SFML.Graphics.Types ( src/SFML/Graphics/Types.hs, dist/build/SFML/Graphics/Types.o )
[26 of 71] Compiling SFML.Graphics.SFSmoothTexture ( src/SFML/Graphics/SFSmoothTexture.hs, dist/build/SFML/Graphics/SFSmoothTexture.o )
[27 of 71] Compiling SFML.Graphics.SFShapeResizable ( src/SFML/Graphics/SFShapeResizable.hs, dist/build/SFML/Graphics/SFShapeResizable.o )
[28 of 71] Compiling SFML.Graphics.SFCoordSpace ( src/SFML/Graphics/SFCoordSpace.hs, dist/build/SFML/Graphics/SFCoordSpace.o )
[29 of 71] Compiling SFML.Graphics.SFBindable ( src/SFML/Graphics/SFBindable.hs, dist/build/SFML/Graphics/SFBindable.o )
[30 of 71] Compiling SFML.Graphics.Rect ( dist/build/SFML/Graphics/Rect.hs, dist/build/SFML/Graphics/Rect.o )
[31 of 71] Compiling SFML.Graphics.SFBounded ( src/SFML/Graphics/SFBounded.hs, dist/build/SFML/Graphics/SFBounded.o )
[32 of 71] Compiling SFML.Graphics.SFViewable ( src/SFML/Graphics/SFViewable.hs, dist/build/SFML/Graphics/SFViewable.o )
[33 of 71] Compiling SFML.Graphics.Texture ( src/SFML/Graphics/Texture.hs, dist/build/SFML/Graphics/Texture.o )
[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.10.1 for x86_64-unknown-linux):
	Simplifier ticks exhausted
  When trying UnfoldingDone $j_sJFj
  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: 190129

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

cabal: Error: some packages failed to install:
SFML-0.2.0.0 failed during the building phase. The exception was:
ExitFailure 1
cabal install sfml  7.18s user 0.76s system 93% cpu 8.460 total

Change History (8)

comment:1 Changed 4 years ago by simonpj

Thanks. What happens if you increase the limit?

comment:2 Changed 4 years ago by SoleSoul

Cabal doesn't seem to look at this flag (and if it does, 10000 wasn't enough). I want to pass this flag to ghc but I don't know where cabal keeps the sources of the packages it downloads. Does it delete them on a failed build?

comment:3 Changed 4 years ago by Phyx-

you can use cabal unpack sfml to ask it to put the sources in the $cwd for you.

comment:4 Changed 4 years ago by SoleSoul

Ok, I've got it!

My system: 4770k 8GB RAM Intel SSD

I ran cabal build --ghc-options=-fsimpl-tick-factor=10000

It succeeded!

Although the whole build except for this part was done in a blink of an eye, this part took: 3.1 GB of RAM 8:32 minutes

comment:5 Changed 4 years ago by thomie

Version: 7.10.17.8.4

Here is a test to reproduce the problem:

module T10584 where

data Transform = Transform
    { m00 :: !Float, m10 :: !Float, m20 :: !Float
    , m01 :: !Float, m11 :: !Float, m21 :: !Float
    , m02 :: !Float, m12 :: !Float, m22 :: !Float
    }

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))

Fails with 7.8.4 and higher, but not with 7.6.3.

$ ghc-7.8.4 T10584.hs -fsimpl-tick-factor=200 -O -fforce-recomp
[1 of 1] Compiling T10584           ( T10584.hs, T10584.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.8.4 for x86_64-unknown-linux):
	Simplifier ticks exhausted
    When trying UnfoldingDone $j_s1vT{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: 73282

comment:6 Changed 4 years ago by rwbarton

Reminiscent of #10421. With GHC 7.8.4, -fsimpl-tick-factor=800 was enough and then GHC expanded out all the possible cases of positive and negative a0i. In GHC 7.10.1 abs has three cases (to handle negative zero correctly) so you really have to crank up the -fsimpl-tick-factor...

Note that abs does not have any sort of INLINE pragma.

comment:7 Changed 2 years ago by bgamari

Type of failure: None/UnknownCompile-time performance bug

comment:8 Changed 2 years ago by bgamari

Description: modified (diff)
Note: See TracTickets for help on using tickets.