Project

General

Profile

Actions

Bug #19038

closed

Corruption of generic_iv_tbl when compacting

Added by peterzhu2118 (Peter Zhu) 2 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:110187]

Description

GitHub PR: https://github.com/ruby/ruby/pull/6494

When the generic_iv_tbl is resized up, rebuild_table performs allocations that can trigger GC. If autocompaction is enabled, then moved objects are removed from and inserted into the generic_iv_tbl. This may cause another call to rebuild_table to resize the generic_iv_tbl. When returning back to the original rebuild_table, some of the data may be stale, causing the generic_iv_tbl to be corrupted.

Co-Authored-By: @eightbitraptor (Matthew Valentine-House)

Actions #1

Updated by peterzhu2118 (Peter Zhu) 2 months ago

  • Status changed from Open to Closed

Applied in changeset git|76bae60d9b967415c5930c2c5906e14c8362a6dd.


[Bug #19038] Fix corruption of generic_iv_tbl when compacting

When the generic_iv_tbl is resized up, rebuild_table performs
allocations that can trigger GC. If autocompaction is enabled, then
moved objects are removed from and inserted into the generic_iv_tbl.
This may cause another call to rebuild_table to resize the
generic_iv_tbl. When returning back to the original rebuild_table, some
of the data may be stale, causing the generic_iv_tbl to be corrupted.

This commit changes rebuild_table to only read data from the st_table
after the allocations have completed.

Co-Authored-By: Matt Valentine-House

Updated by nagachika (Tomoyuki Chikanaga) about 2 months ago

  • Backport changed from 2.7: DONTNEED, 3.0: DONTNEED, 3.1: REQUIRED to 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONE

ruby_3_1 830fbb412b1c01f0a44b66a70b946d7e87feb6e5 merged revision(s) 76bae60d9b967415c5930c2c5906e14c8362a6dd.

Actions

Also available in: Atom PDF

Like0
Like0Like0