From bada580716441f07fcf5f7783201591714586b3c Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 6 Dec 2022 06:55:59 -0500 Subject: 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. --- rts/sm/Storage.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c index 1760fed51a..15a9bca397 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 -- cgit v1.2.1