ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:110136] [Ruby master Bug#19029] Moving a transient heap allocated array between size pools can trigger GC while in GC
@ 2022-09-28 18:47 eightbitraptor (Matthew Valentine-House)
  0 siblings, 0 replies; only message in thread
From: eightbitraptor (Matthew Valentine-House) @ 2022-09-28 18:47 UTC (permalink / raw)
  To: ruby-core

Issue #19029 has been reported by eightbitraptor (Matthew Valentine-House).

----------------------------------------
Bug #19029: Moving a transient heap allocated array between size pools can trigger GC while in GC
https://bugs.ruby-lang.org/issues/19029

* Author: eightbitraptor (Matthew Valentine-House)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
[Github PR 6466](https://github.com/ruby/ruby/pull/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



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-28 18:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28 18:47 [ruby-core:110136] [Ruby master Bug#19029] Moving a transient heap allocated array between size pools can trigger GC while in GC eightbitraptor (Matthew Valentine-House)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).