Opened 3 years ago

Closed 3 years ago

#9857 closed bug (fixed)

GHC 7.9 panics (simplifier ticks exhausted) on `half-0.2`

Reported by: hvr Owned by: simonpj
Priority: high Milestone: 7.10.1
Component: Compiler Version: 7.9
Keywords: Cc: ekmett
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case: patsyn/should_compile/T9857
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Compiling hackage:half-0.2 results in a GHC Panic:

$ ghc --version && ghc --print-project-git-commit-id
The Glorious Glasgow Haskell Compilation System, version 7.9.20141202
bf2d75417b5be7e8a79a26ee57a81e00682dabd4

$ cabal get half-0.2 && cd half-0.2/src/Numeric/
Unpacking to half-0.2/

$ ghc -Wall -O -fforce-recomp -c Half.hs 
ghc: panic! (the 'impossible' happened)
  (GHC version 7.9.20141202 for x86_64-unknown-linux):
	Simplifier ticks exhausted
  When trying UnfoldingDone lvl_s5yo
  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: 125160

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

Attachments (1)

Half.hs (4.8 KB) - added by hvr 3 years ago.
src/Numeric/Half.hs from half-0.2 package

Download all attachments as: .zip

Change History (8)

comment:1 Changed 3 years ago by hvr

Priority: normalhigh

since this is actually a regression to 7.8, I'm increasing the priority to high

Changed 3 years ago by hvr

Attachment: Half.hs added

src/Numeric/Half.hs from half-0.2 package

comment:2 Changed 3 years ago by simonpj

What factor works?

comment:3 Changed 3 years ago by hvr

I've tried up to -fsimpl-tick-factor=100000 and it still fails:

$ ghc -Wall -O -fforce-recomp -fsimpl-tick-factor=100000 -c Half.hs 
ghc: panic! (the 'impossible' happened)
  (GHC version 7.9.20141202 for x86_64-unknown-linux):
	Simplifier ticks exhausted
  When trying UnfoldingDone lvl_s5yo
  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: 125160000

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

does it make sense to try even higher?

comment:4 Changed 3 years ago by hvr

Milestone: 7.10.1

comment:5 Changed 3 years ago by hvr

comment:6 Changed 3 years ago by simonpj

Fixed by this (whose commit message contains a mis-typed ticket number)

commit fbb42b2ea42b6467135f26db47d9c296e7ad75a3
Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Sat Dec 13 22:47:01 2014 +0000

    Pattern-synonym matcher and builder Ids must be *LocalIds*
    
    This easy-to-make mistake meant that pattern-synonym matcher and
    builder Ids weren't being treated as locally defined by the simpplier.
    That meant that we never looked up them up in the environment, got an
    out-of-date unfolding, which made the Simplifier fall into an infinite
    loop.  This was the cause of Trac #98587, but it was quite tricky to
    find!
    
    In a separate patch I'll make Lint check for locally-bound GlobalIds,
    since they are always an error.

comment:7 Changed 3 years ago by simonpj

Resolution: fixed
Status: newclosed
Test Case: patsyn/should_compile/T9857
Note: See TracTickets for help on using tickets.