[Git][ghc/ghc][wip/fix-checkClosure] rts: fix checkClosure error message

Cheng Shao (@TerrorJack) gitlab at gitlab.haskell.org
Wed May 29 10:35:44 UTC 2024



Cheng Shao pushed to branch wip/fix-checkClosure at Glasgow Haskell Compiler / GHC


Commits:
639aa028 by Cheng Shao at 2024-05-29T10:35:25+00:00
rts: fix checkClosure error message

This patch fixes an error message in checkClosure() when the closure
has already been evacuated. The previous logic was meant to print the
evacuated closure's type in the error message, but it was completely
wrong, given info was not really an info table, but a tagged pointer
that points to the closure's new address.

- - - - -


1 changed file:

- rts/sm/Sanity.c


Changes:

=====================================
rts/sm/Sanity.c
=====================================
@@ -357,7 +357,8 @@ checkClosure( const StgClosure* p )
     info = ACQUIRE_LOAD(&p->header.info);
 
     if (IS_FORWARDING_PTR(info)) {
-        barf("checkClosure: found EVACUATED closure %d", info->type);
+        ASSERT(LOOKS_LIKE_CLOSURE_PTR(info));
+        barf("checkClosure: found EVACUATED closure %u", GET_INFO((StgClosure*)UN_FORWARDING_PTR(info))->type);
     }
 
 #if defined(PROFILING)



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/639aa02898fe4c135ea98f987bc8912aa37c1994

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/639aa02898fe4c135ea98f987bc8912aa37c1994
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/20240529/2bd8ed1e/attachment.html>


More information about the ghc-commits mailing list