[Git][ghc/ghc][master] rts: Drop racy assertion
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Mon Dec 19 00:34:47 UTC 2022
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
b3eacd64 by Ben Gamari at 2022-12-18T19:34:24-05:00
rts: Drop racy assertion
0e274c39bf836d5bb846f5fa08649c75f85326ac added an assertion in
`dirty_MUT_VAR` checking that the MUT_VAR being dirtied was clean.
However, this isn't necessarily the case since another thread may have
raced us to dirty the object.
- - - - -
1 changed file:
- rts/sm/Storage.c
Changes:
=====================================
rts/sm/Storage.c
=====================================
@@ -1404,7 +1404,10 @@ allocatePinned (Capability *cap, W_ n /*words*/, W_ alignment /*bytes*/, W_ alig
void
dirty_MUT_VAR(StgRegTable *reg, StgMutVar *mvar, StgClosure *old)
{
+#if defined(THREADED_RTS)
+ // This doesn't hold in the threaded RTS as we may race with another thread.
ASSERT(RELAXED_LOAD(&mvar->header.info) == &stg_MUT_VAR_CLEAN_info);
+#endif
Capability *cap = regTableToCapability(reg);
// No barrier required here as no other heap object fields are read. See
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b3eacd64fb36724ed6c5d2d24a81211a161abef1
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b3eacd64fb36724ed6c5d2d24a81211a161abef1
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/20221218/cc3d4723/attachment.html>
More information about the ghc-commits
mailing list