Skip to content

Commit

Permalink
[erts] Fix cpool_delete()
Browse files Browse the repository at this point in the history
When setting modification marker on the 'prev' field of a carrier to
delete from a pool, we back off and wait for the content of the
field to receive expected value if it did not have that from the
beginning. Due to a copy-paste bug; when this happened, we waited on
a completely different memory location which caused the scheduler
thread doing this to get stuck forever. This is obviously a very
rare scenario, since this bug has been present for 11 years without
being reported.
  • Loading branch information
rickard-green committed Jun 28, 2024
1 parent 0863bd3 commit e176896
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion erts/emulator/beam/erl_alloc_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -3479,7 +3479,7 @@ cpool_delete(Allctr_t *allctr, Allctr_t *prev_allctr, Carrier_t *crr)
b = 1;
do {
b = backoff(b);
tmp = cpool_read(&cpd2p->prev);
tmp = cpool_read(&crr->cpool.prev);
} while (tmp != val);
}

Expand Down

0 comments on commit e176896

Please sign in to comment.