aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2014-10-28 17:42:00 +0100
committerSverker Eriksson <[email protected]>2014-10-28 17:42:00 +0100
commitff7739cfae9c2b0915842572284a702d52b2d8db (patch)
tree7ec0a55fe35188e02bb54c089aa8a61e6eb62ab5
parent9e9d456cc9db4f04b07afe1d149a0065f85409b1 (diff)
parent891cc466c957e91c7770f0a91ba83b65a268c2c1 (diff)
downloadotp-ff7739cfae9c2b0915842572284a702d52b2d8db.tar.gz
otp-ff7739cfae9c2b0915842572284a702d52b2d8db.tar.bz2
otp-ff7739cfae9c2b0915842572284a702d52b2d8db.zip
Merge branch 'sverk/cpool_fetch-dc_list-bug/OTP-12249' into maint
* sverk/cpool_fetch-dc_list-bug/OTP-12249: erts: Fix bug when delayed deallocated carrier is reused by cpool_fetch
-rw-r--r--erts/emulator/beam/erl_alloc_util.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_alloc_util.c b/erts/emulator/beam/erl_alloc_util.c
index a4e164bf51..55052430e1 100644
--- a/erts/emulator/beam/erl_alloc_util.c
+++ b/erts/emulator/beam/erl_alloc_util.c
@@ -1775,6 +1775,18 @@ handle_delayed_dealloc(Allctr_t *allctr,
* data has been overwritten by the queue.
*/
Carrier_t *crr = FIRST_BLK_TO_MBC(allctr, blk);
+
+ /* Restore word overwritten by the dd-queue as it will be read
+ * if this carrier is pulled from dc_list by cpool_fetch()
+ */
+ ERTS_ALC_CPOOL_ASSERT(FBLK_TO_MBC(blk) != crr);
+ ERTS_ALC_CPOOL_ASSERT(sizeof(ErtsAllctrDDBlock_t) == sizeof(void*));
+#ifdef MBC_ABLK_OFFSET_BITS
+ blk->u.carrier = crr;
+#else
+ blk->carrier = crr;
+#endif
+
ERTS_ALC_CPOOL_ASSERT(ERTS_ALC_IS_CPOOL_ENABLED(allctr));
ERTS_ALC_CPOOL_ASSERT(allctr == crr->cpool.orig_allctr);
ERTS_ALC_CPOOL_ASSERT(((erts_aint_t) allctr)