aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2014-10-06 22:29:44 +0200
committerSverker Eriksson <[email protected]>2014-10-06 22:29:44 +0200
commitdd853b15e9fb770a3f04fe4504fbfbb8de89e28d (patch)
tree9f766df686e974f200985fe56b10d70d973662ff /erts
parente16f287c28ac93b54772169958c965733aa67e66 (diff)
downloadotp-dd853b15e9fb770a3f04fe4504fbfbb8de89e28d.tar.gz
otp-dd853b15e9fb770a3f04fe4504fbfbb8de89e28d.tar.bz2
otp-dd853b15e9fb770a3f04fe4504fbfbb8de89e28d.zip
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().
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/erl_alloc_util.c5
1 files changed, 5 insertions, 0 deletions
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