summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-04-09 10:42:07 +0000
committerIan Lynagh <igloo@earth.li>2010-04-09 10:42:07 +0000
commit129e7b91d1cd0fc583b6bba01e39d10c30db18be (patch)
tree48d65f3e5e26839d601ecdb226b7264140a0b5d8
parentf278f0676579f67075033a4f9857715909c4b71e (diff)
downloadhaskell-129e7b91d1cd0fc583b6bba01e39d10c30db18be.tar.gz
Handle IND_STATIC in isRetainer
IND_STATIC used to be an error, but at the moment it can happen as isAlive doesn't look through IND_STATIC as it ignores static closures. See trac #3956 for a program that hit this error.
-rw-r--r--rts/RetainerProfile.c6
-rw-r--r--rts/sm/GCAux.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c
index d14ba06bf6..07a3db435b 100644
--- a/rts/RetainerProfile.c
+++ b/rts/RetainerProfile.c
@@ -1054,6 +1054,10 @@ isRetainer( StgClosure *c )
case PAP:
// indirection
case IND_PERM:
+ // IND_STATIC used to be an error, but at the moment it can happen
+ // as isAlive doesn't look through IND_STATIC as it ignores static
+ // closures. See trac #3956 for a program that hit this error.
+ case IND_STATIC:
case BLACKHOLE:
// static objects
case CONSTR_STATIC:
@@ -1069,8 +1073,6 @@ isRetainer( StgClosure *c )
//
// Error case
//
- // IND_STATIC cannot be *c, *cp, *r in the retainer profiling loop.
- case IND_STATIC:
// CONSTR_NOCAF_STATIC
// cannot be *c, *cp, *r in the retainer profiling loop.
case CONSTR_NOCAF_STATIC:
diff --git a/rts/sm/GCAux.c b/rts/sm/GCAux.c
index cbbb8b636f..f69c81d5e0 100644
--- a/rts/sm/GCAux.c
+++ b/rts/sm/GCAux.c
@@ -45,6 +45,10 @@ isAlive(StgClosure *p)
// ignore static closures
//
+ // ToDo: This means we never look through IND_STATIC, which means
+ // isRetainer needs to handle the IND_STATIC case rather than
+ // raising an error.
+ //
// ToDo: for static closures, check the static link field.
// Problem here is that we sometimes don't set the link field, eg.
// for static closures with an empty SRT or CONSTR_STATIC_NOCAFs.