ghc-7.8-rc2 in -O2 mode eats all stack and RAM on pandoc-citeproc / highlighting-kate

Simon Peyton Jones simonpj at microsoft.com
Fri Apr 4 16:19:48 UTC 2014


Sergei

SpecConstr is too aggressive: it sometimes blows up the program badly and we have no good solution.  See Trac #7898, #7068, #7944, #5550, #8836.

I notice that the latter three are actually fixed in 7.8, so worth trying that.  If it still fails, do add instructions to reproduce to one of the above open tickets, or make a new one.


Amos Robinson (cc'd) was working on this problem, but I have not heard anything recently.

It surely ought to be possible to "throttle" it a bit so that it stops before generating too vast a program.

Meanwhile you can use -fno-spec-constr to simply switch it off for offending modules.  That should get you going.  

Simon

| -----Original Message-----
| From: ghc-devs [mailto:ghc-devs-bounces at haskell.org] On Behalf Of
| Sergei Trofimovich
| Sent: 03 April 2014 21:20
| To: ghc-devs at haskell.org
| Subject: Re: ghc-7.8-rc2 in -O2 mode eats all stack and RAM on pandoc-
| citeproc / highlighting-kate
| 
| On Sat, 22 Mar 2014 22:21:42 +0300
| Sergei Trofimovich <slyich at gmail.com> wrote:
| 
| > Hello!
| >
| > I have noticed the problem in ghc-7.6.3 first when tried to build all
| > haskell userland with -O2 opt level.
| >
| > It led to amazing bugs!
| >
| > Here is one of those (highlighting-kate hackage package):
| > > [281 of 452] Compiling Text.Highlighting.Kate.Syntax.Asp (
| > > highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.hs,
| > > highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.o )
| > > stack overflow: use +RTS -K<size> to increase it
| >
| > How to reproduce it:
| > 1. Download a bundled file (6.6MB):
| >
| > http://code.haskell.org/~slyfox/selfcontained-eater-ghc-7.8-
| rc2.tar.gz
| > 2. Unpack and run there:
| >   ./mk.sh
| >
| > The script is designed to plug any built ghc version w/o external
| depends.
| >
| > Command will fail as:
| >     $ ./mk.sh
| >     ...
| >     [281 of 452] Compiling Text.Highlighting.Kate.Syntax.Asp (
| highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.hs,
| highlighting-kate-0.5.6.1/Text/Highlighting/Kate/Syntax/Asp.o )
| >     stack overflow: use +RTS -K<size> to increase it
| >
| > On ghc-7.6.3 it will progress a bit more: down to 452 file and will
| > crash there similar way.
| >
| > I've 'cabal unpack'-ed all sources and configured/de-.hsc-ed them
| > manually/added needed -DWhatever / added {-# LANGUAGE CPP #-} around.
| > Nothing else.
| >
| > It's very hard to shrink such large thing manually down to 2-3 files.
| > Would be cool if ghc (and cabal) would be able to spit something
| > self-sufficient (like 'gcc -i' does) for devs to reproduce.
| >
| > Adding '-v' shows such log:
| >     ...
| >     *** Simplifier:
| >     Result size of Simplifier iteration=1
| >       = {terms: 21,973, types: 21,838, coercions: 1,842}
| >     Result size of Simplifier iteration=2
| >       = {terms: 21,952, types: 21,819, coercions: 1,842}
| >     Result size of Simplifier
| >       = {terms: 21,950, types: 21,817, coercions: 1,842}
| >     *** SpecConstr:
| >     Result size of SpecConstr***<CRASH>
| 
| Nobody interested? Is it too scary?
| 
| Such inliner blowups are hard to shrink down from real examples down to
| toy ones. I could try to but I need a bit of guidance.
| 
| Maybe you need only an intermediate core step right before an OOM,
| whatever?
| 
| Thanks!
| 
| --
| 
|   Sergei


More information about the ghc-devs mailing list