Space leak with :trace
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,
- :main runs in 30M constant space,
- :trace main does not.
Launching ghci with a heap space limit, e.g. +RTS -M300M, makes 2) eventually crash.
Trac metadata
Trac field | Value |
---|---|
Version | 6.8.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | GHCi |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | mnislaih@gmail.com |
Operating system | |
Architecture | Unknown |