summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@well-typed.com>2022-01-28 18:21:00 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-03-23 13:43:20 -0400
commite6d0e287272e1f5ee46d80676a1df2ff65584dad (patch)
tree65fca6e251edb63995f6909fe0b452dee4987e21
parentf214349ac9a9114e564f660d0618d683e2a4f74e (diff)
downloadhaskell-e6d0e287272e1f5ee46d80676a1df2ff65584dad.tar.gz
rts: Don't mark object code in markCAFs unless necessary
Previously `markCAFs` would call `markObjectCode` even in non-major GCs. This is problematic since `prepareUnloadCheck` is not called in such GCs, meaning that the section index has not been updated. Fixes #21254
-rw-r--r--rts/sm/GCAux.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/rts/sm/GCAux.c b/rts/sm/GCAux.c
index 41c24634c2..afed7b075d 100644
--- a/rts/sm/GCAux.c
+++ b/rts/sm/GCAux.c
@@ -157,7 +157,8 @@ markCAFs (evac_fn evac, void *user)
{
c = (StgIndStatic *)UNTAG_STATIC_LIST_PTR(c);
evac(user, &c->indirectee);
- markObjectCode(c);
+ // See Note [Object unloading] in CheckUnload.c
+ if (unload_mark_needed) markObjectCode(c);
}
for (StgIndStatic *c = revertible_caf_list;
@@ -166,6 +167,7 @@ markCAFs (evac_fn evac, void *user)
{
c = (StgIndStatic *)UNTAG_STATIC_LIST_PTR(c);
evac(user, &c->indirectee);
- markObjectCode(c);
+ // See Note [Object unloading] in CheckUnload.c
+ if (unload_mark_needed) markObjectCode(c);
}
}