[commit: ghc] master: Add -fghci-leak-check to check for space leaks (5fe6aaa)

git at git.haskell.org git at git.haskell.org
Wed May 9 12:45:18 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5fe6aaa3756cda654374ebfd883fa8f064ff64a4/ghc

>---------------------------------------------------------------

commit 5fe6aaa3756cda654374ebfd883fa8f064ff64a4
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Wed May 2 11:01:13 2018 +0100

    Add -fghci-leak-check to check for space leaks
    
    Summary:
    Space leaks in GHCi emerge from time to time and tend to come back again
    after they get fixed. This is an attempt to limit regressions by
    
    * adding a reliable detection for some classes of space leaks in GHCi
    * turning on leak checking for all GHCi tests in the test suite, so that
      we'll notice if the leak appears again.
    
    The idea for detecting space leaks is quite simple:
    
    * find some data that we expect to be GC'd later, make a weak pointer to it
    * when we expect the data to be dead, do a `performGC` and then check
      the status of the weak pointer.
    
    It would be nice to apply this trick to lots of things in GHC,
    e.g. ensuring that HsSyn is not retained after the desugarer, or
    ensuring that CoreSyn from the previous simplifier pass is not retained.
    
    Test Plan: validate
    
    Reviewers: bgamari, simonpj, erikd, niteria
    
    Subscribers: thomie, carter
    
    GHC Trac Issues: #15111
    
    Differential Revision: https://phabricator.haskell.org/D4658


>---------------------------------------------------------------

5fe6aaa3756cda654374ebfd883fa8f064ff64a4
 compiler/main/DynFlags.hs                   |  2 +
 docs/users_guide/ghci.rst                   | 11 ++++++
 ghc/GHCi/Leak.hs                            | 59 +++++++++++++++++++++++++++++
 ghc/GHCi/UI.hs                              | 15 +++++++-
 ghc/ghc-bin.cabal.in                        |  1 +
 testsuite/config/ghc                        |  2 +-
 testsuite/tests/ghci/scripts/T9293.stdout   |  4 ++
 testsuite/tests/ghci/scripts/ghci057.stdout |  4 ++
 8 files changed, 96 insertions(+), 2 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5fe6aaa3756cda654374ebfd883fa8f064ff64a4


More information about the ghc-commits mailing list