summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-12-06 06:55:59 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-12-18 19:34:24 -0500
commitb3eacd64fb36724ed6c5d2d24a81211a161abef1 (patch)
tree71e69a7a54985775a920e46655b629f76c11594c
parent6fe2d778e9ad015f35c520724d7f222a015586ed (diff)
downloadhaskell-b3eacd64fb36724ed6c5d2d24a81211a161abef1.tar.gz
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.
-rw-r--r--rts/sm/Storage.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c
index 1760fed51a..40353ea180 100644
--- a/rts/sm/Storage.c
+++ b/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