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>2023-01-12 07:49:04 -0500
commit3242139fbd18df324460e22619c1a1fb3b258a07 (patch)
tree89f13d71573e6a5a38bdcd775fa0171a9c00aca9
parentdb11f3586085901e89705f69aff472e027c0748f (diff)
downloadhaskell-3242139fbd18df324460e22619c1a1fb3b258a07.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 60021f6b2a..40d8a45806 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