From dd853b15e9fb770a3f04fe4504fbfbb8de89e28d Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 6 Oct 2014 22:29:44 +0200 Subject: erts: Fix bug causing mbc removed from cpool to be used at pool entrance Clear both IN_POOL and BUSY flags when empty carrier is removed is removed from pool to be destroyed. Earlier it was enough to leave BUSY flag set but now with pooled_list we must clear IN_POOL to avoid using it as cpool_entrance in cpool_fetch(). --- erts/emulator/beam/erl_alloc_util.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'erts/emulator/beam') diff --git a/erts/emulator/beam/erl_alloc_util.c b/erts/emulator/beam/erl_alloc_util.c index ba16e5c3a3..0ea9b62103 100644 --- a/erts/emulator/beam/erl_alloc_util.c +++ b/erts/emulator/beam/erl_alloc_util.c @@ -3877,6 +3877,11 @@ destroy_carrier(Allctr_t *allctr, Block_t *blk, Carrier_t **busy_pcrr_pp) if (busy_pcrr_pp && *busy_pcrr_pp) { ERTS_ALC_CPOOL_ASSERT(*busy_pcrr_pp == crr); *busy_pcrr_pp = NULL; + ERTS_ALC_CPOOL_ASSERT(erts_smp_atomic_read_nob(&crr->allctr) + == (((erts_aint_t) allctr) + | ERTS_CRR_ALCTR_FLG_IN_POOL + | ERTS_CRR_ALCTR_FLG_BUSY)); + erts_smp_atomic_set_nob(&crr->allctr, ((erts_aint_t) allctr)); cpool_delete(allctr, allctr, crr); } else -- cgit v1.2.3