Project

General

Profile

Actions

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.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:110136]

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

Actions

Also available in: Atom PDF

Like0
Like0