Bug #19029
closed
Moving a transient heap allocated array between size pools can trigger GC while in GC
Added by eightbitraptor (Matthew Valentine-House) over 1 year ago.
Updated over 1 year ago.
Description
Github PR 6466
RARRAY_PTR when called with a transient array detransients the array before returning its pointer which allocates in the heap.
Because RARRAY_PTR was being used during compaction (when re-embedding arrays that have moved between size pools) this introduces the possibility that we can hit a malloc threshold, triggering GC, while in the middle of compaction.
We should avoid this by using safer functions to get hold of the pointer. Since we know that the array is not embedded here, we can use ARY_HEAP_PTR and ARY_EMBED_PTR directly
- Status changed from Open to Closed
Applied in changeset git|892f350a7db4d2cc99c5061d2e74498dfc4809ca.
[Bug #19029] Don't start GC during compaction
RARRAY_PTR when called with a transient array detransients the array
before returning its pointer which allocates in the heap.
Because RARRAY_PTR was being used during compaction (when re-embedding
arrays that have moved between size pools) this introduces the
possibility that we can hit a malloc threshold, triggering GC, while in
the middle of compaction.
We should avoid this by using safer functions to get hold of the
pointer. Since we know that the array is not embedded here, we can use
ARY_HEAP_PTR and ARY_EMBED_PTR directly
Also available in: Atom
PDF
Like0
Like0