[commit: ghc] ghc-7.2: fix an assertion failure, and possibly some bogosity (see comment) (1271c8b)

Ian Lynagh igloo at earth.li
Wed Jul 20 23:22:16 CEST 2011


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : ghc-7.2

http://hackage.haskell.org/trac/ghc/changeset/1271c8b4abe8941b6fd7b36d70b4fdc7c8fc0db0

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

commit 1271c8b4abe8941b6fd7b36d70b4fdc7c8fc0db0
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Wed Jul 20 15:25:58 2011 +0100

    fix an assertion failure, and possibly some bogosity (see comment)

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

 rts/RetainerProfile.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c
index 4bfda6f..028b3e3 100644
--- a/rts/RetainerProfile.c
+++ b/rts/RetainerProfile.c
@@ -1754,6 +1754,7 @@ retainRoot(void *user STG_UNUSED, StgClosure **tl)
     currentStackBoundary = stackTop;
 
     c = UNTAG_CLOSURE(*tl);
+    maybeInitRetainerSet(c);
     if (c != &stg_END_TSO_QUEUE_closure && isRetainer(c)) {
 	retainClosure(c, c, getRetainerFrom(c));
     } else {
@@ -1856,6 +1857,15 @@ computeRetainerSet( void )
  *    However, this is not necessary because any static indirection objects
  *    are just traversed through to reach dynamic objects. In other words,
  *    they are not taken into consideration in computing retainer sets.
+ *
+ * SDM (20/7/2011): I don't think this is doing anything sensible,
+ * because it happens before retainerProfile() and at the beginning of
+ * retainerProfil() we change the sense of 'flip'.  So all of the
+ * calls to maybeInitRetainerSet() here are initialising retainer sets
+ * with the wrong flip.  Also, I don't see why this is necessary.  I
+ * added a maybeInitRetainerSet() call to retainRoot(), and that seems
+ * to have fixed the assertion failure in retainerSetOf() I was
+ * encountering.
  * -------------------------------------------------------------------------- */
 void
 resetStaticObjectForRetainerProfiling( StgClosure *static_objects )





More information about the Cvs-ghc mailing list