[Git][ghc/ghc][master] rts: fix checkClosure error message

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Sep 4 11:20:40 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
0d3bc2fa by Cheng Shao at 2024-09-04T07:20:06-04: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/0d3bc2fa3a9a8c342ec34bb9d32e493655a4ec69

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0d3bc2fa3a9a8c342ec34bb9d32e493655a4ec69
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/20240904/a23528bb/attachment.html>


More information about the ghc-commits mailing list