aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-06-29 23:30:23 +0200
committerSverker Eriksson <[email protected]>2017-06-30 15:01:08 +0200
commitdbbf643c632a175a28ea39ba780947ff13eca039 (patch)
treed5772d7603404b967482350ce8de0b8e4db30407 /erts/emulator/beam
parent5e1b5ef47f3f2b898d30e0425823835bd9a574d4 (diff)
downloadotp-dbbf643c632a175a28ea39ba780947ff13eca039.tar.gz
otp-dbbf643c632a175a28ea39ba780947ff13eca039.tar.bz2
otp-dbbf643c632a175a28ea39ba780947ff13eca039.zip
erts: Fix bug in quick alloc
The effect of the race is that a pre-allocated memory block is inserted last without updating tail.data.last, which will cause all subsequent insertions to also fail to update tail.data.last. Hence all pre-allocation for this quick alloc instance is leaked for this thread and will fallback on erts_alloc.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_sched_spec_pre_alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_sched_spec_pre_alloc.c b/erts/emulator/beam/erl_sched_spec_pre_alloc.c
index caec24bc03..ca2d834381 100644
--- a/erts/emulator/beam/erl_sched_spec_pre_alloc.c
+++ b/erts/emulator/beam/erl_sched_spec_pre_alloc.c
@@ -161,7 +161,7 @@ enqueue_remote_managed_thread(erts_sspa_chunk_header_t *chdr,
if ((i & 1) == 0)
itmp = itmp2;
else {
- enq = (erts_sspa_blk_t *) itmp;
+ enq = (erts_sspa_blk_t *) itmp2;
itmp = erts_atomic_read_acqb(&enq->next_atmc);
ASSERT(itmp != ERTS_AINT_NULL);
}