Ticket #1709 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

simplifier causes stack overflow in ghc-6.8.0.20070916

Reported by: Christian.Maeder@… Owned by: simonpj
Priority: normal Milestone: 6.8.1
Component: Compiler Version: 6.8
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

In order to reproduce the bug, you'll have to checkout uni:

svn co https://svn-agbkb.informatik.uni-bremen.de/uni/trunk uni

install the package HaXml?-1.13.2 (to be found as uni/HaXml/HaXml.tgz) The packages pretty and containers have be added to HaXml.cabal.

Within uni call:

./configure
make packages

Compilation fails with:

FileDialog.hs:742:0:
    Warning: Definition but no type signature for `deleteFileImg'
             Inferred type: deleteFileImg :: IO Image
*** Desugar:
    Result size = 5899
*** Simplify:
    Result size = 4328
    Result size = 4254
    Result size = 4254
    Result size = 4254
    Result size = 4254
*** Specialise:
    Result size = 4254
*** Float out (not lambdas, not constants):
    Result size = 4906
*** Float inwards:
    Result size = 4906
*** Simplify:
*** Deleting temp files:
Warning: deleting non-existent /tmp/ghc23343_0/ghc23343_0.s
*** Deleting temp dirs:
stack overflow: use +RTS -K<size> to increase it

If I increase with +RTS -K100m compilation exhausts the heap after 18 minutes:

*** Simplify:
Heap exhausted;
Current maximum heap size is 999997440 bytes (953 Mb);
use `+RTS -M<size>' to increase it.

Attachments

Dist.hs Download (482 bytes) - added by guest 6 years ago.
FileDialog.hs Download (83 bytes) - added by guest 6 years ago.

Change History

Changed 6 years ago by simonmar

  • owner set to simonpj
  • milestone set to 6.8.1

Changed 6 years ago by guest

The problem also shows up with ghc-6.8.0.20071014, Christian

Changed 6 years ago by simonpj

Excellent report thank you.

I finally managed to get everything built and thereby reproduced it. What was happening was that a strict function was ending up as a loop-breaker. But in the interface file we said "this is is strict, and here's its worker". So its unfolding was, in effect, exposed, and we got an infinite inlining loop.

It's a bizarre case that should not really arise, so I'll pursue that. But meanwhile I have fixed the actual bug.

(Ian, it turned out that I fixed it directly in the 6.8 branch. I'll push to the HEAD too myself.)

Christian: would you like to check, using tonight's snapshot, that all is well? I'll leave the bug open for now.

Simon

Changed 6 years ago by guest

Changed 6 years ago by guest

Changed 6 years ago by guest

Thanks a lot for looking into this! (I'll check it tomorrow.) Meanwhile I've created a boiled down test case:

ghc --make -O -XFlexibleInstances -fallow-undecidable-instances FileDialog.hs
rm FileDialog.o
ghc --make -O FileDialog.hs

Changed 6 years ago by guest

ghc-6.8.0.20071016 is able to compile now all our uni- and hets- sources! Thanks again for taking the trouble of checking out, package modification and installation as well as tracking down the actual problem!

Changed 6 years ago by simonmar

  • status changed from new to closed
  • resolution set to fixed

Simon fixed this:

Tue Oct 16 06:18:40 PDT 2007  simonpj@microsoft.com
  * Fix #1709: do not expose the worker for a loop-breaker
Note: See TracTickets for help on using tickets.