aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_alloc_util.c
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2014-11-04 12:21:20 +0100
committerErlang/OTP <[email protected]>2014-11-04 12:21:20 +0100
commit04e86b7300706dd76ea927a31e287cf4084434a1 (patch)
treeedf83c5586ef2060464373000990730b78e09719 /erts/emulator/beam/erl_alloc_util.c
parent79cf526f1ccd98706388d1472ec7abdc4aa25bd1 (diff)
parent891cc466c957e91c7770f0a91ba83b65a268c2c1 (diff)
downloadotp-04e86b7300706dd76ea927a31e287cf4084434a1.tar.gz
otp-04e86b7300706dd76ea927a31e287cf4084434a1.tar.bz2
otp-04e86b7300706dd76ea927a31e287cf4084434a1.zip
Merge branch 'sverk/cpool_fetch-dc_list-bug/OTP-12249' into maint-17
* sverk/cpool_fetch-dc_list-bug/OTP-12249: erts: Fix bug when delayed deallocated carrier is reused by cpool_fetch
Diffstat (limited to 'erts/emulator/beam/erl_alloc_util.c')
-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)