[Git][ghc/ghc][wip/andreask/compacting_gc_crash] Compacting GC: Handle black holes in large objects.

Andreas Klebinger (@AndreasK) gitlab at gitlab.haskell.org
Fri Nov 22 19:23:05 UTC 2024



Andreas Klebinger pushed to branch wip/andreask/compacting_gc_crash at Glasgow Haskell Compiler / GHC


Commits:
88c67134 by Andreas Klebinger at 2024-11-22T20:03:12+01:00
Compacting GC: Handle black holes in large objects.

As #14497 showed black holes can appear inside large objects when
we capture a computation and later blackhole it like we do for AP_STACK
closures.

Fixes #24791

- - - - -


2 changed files:

- rts/sm/Compact.c
- rts/sm/Evac.c


Changes:

=====================================
rts/sm/Compact.c
=====================================
@@ -68,6 +68,10 @@
     pointer.
    ------------------------------------------------------------------------- */
 
+static /* STATIC_INLINE */ P_
+thread_obj (const StgInfoTable *info, P_ p);
+
+
 STATIC_INLINE W_
 UNTAG_PTR(W_ p)
 {
@@ -567,6 +571,13 @@ update_fwd_large( bdescr *bd )
       // nothing to follow
       continue;
 
+    // See Note [Black holes in large objects] in Evac.c for why.
+    case BLACKHOLE:
+      {
+        thread_obj(info, p);
+        continue;
+      }
+
     case MUT_ARR_PTRS_CLEAN:
     case MUT_ARR_PTRS_DIRTY:
     case MUT_ARR_PTRS_FROZEN_CLEAN:


=====================================
rts/sm/Evac.c
=====================================
@@ -1112,6 +1112,8 @@ evacuate_BLACKHOLE(StgClosure **p)
         return;
     }
 
+    // Note [Black holes in large objects]
+    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     // blackholes *can* be in a large object: when raiseAsync() creates an
     // AP_STACK the payload might be large enough to create a large object.
     // See #14497.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/88c67134a556fa6061fb854518697cbb285cf3e5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/88c67134a556fa6061fb854518697cbb285cf3e5
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241122/ac0f8c54/attachment-0001.html>


More information about the ghc-commits mailing list