Ticket #2128 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

Space leak with :trace

Reported by: mnislaih Owned by: igloo
Priority: normal Milestone: 6.8 branch
Component: GHCi Version: 6.8.2
Keywords: Cc: mnislaih@…
Operating System: MacOS X Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

There is some ugly space behaviour going on with :trace.

I noticed while during a long running debugging session. My program runs for about 30 seconds (under ghci) and then throws a stack overflow exception. It does run in around 64M constant space. While launched under :trace, the space usage grows constantly up to 3.5G, and at this point my system dies, never reaching the exception.

I have been able to replicate using a smaller example.

import Data.List

loop x = if x == 0 then 0 : loop 1 else 0 : loop 0

main =  print (foldl' (+) 0 (loop 1))

Under ghci 6.8.2, 1) :main runs in 30M constant space, 2) :trace main does not.

Launching ghci with a heap space limit, e.g. +RTS -M300M, makes 2) eventually crash.

Change History

Changed 5 years ago by igloo

  • difficulty set to Unknown
  • milestone set to 6.8 branch

Changed 5 years ago by igloo

  • owner set to igloo

Changed 5 years ago by igloo

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

Fixed in HEAD and 6.8:

Sun Mar 16 14:17:48 PDT 2008  Ian Lynagh <igloo@earth.li>
  * Fix a space leak in :trace (trac #2128)
  We were doing lots of cons'ing and tail'ing without forcing the tails,
  so were building up lots of thunks.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.