summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2023-02-13 09:51:59 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2023-02-13 11:42:58 -0500
commit86de48e9f69b665ba9ffb5bdc5a181a3adb1a7b8 (patch)
tree1935f52d64d1948f689851b64a83527ac771ed6b /compile.c
parent7ddcee5928d8a98337077d5a5ee61136ec84a993 (diff)
downloadruby-86de48e9f69b665ba9ffb5bdc5a181a3adb1a7b8.tar.gz
Remove ibf_dumper's WB_PROTECTED status
It doesn't have the right write barriers in place. For example, there is rb_mark_set(dump->global_buffer.obj_table); in the mark function, but there is no corresponding write barrier when adding to the table in the `ibf_dump_object() -> ibf_table_find_or_insert() -> st_insert()` code path. To insert write barrier correctly, we need to store the T_STRUCT VALUE inside `struct ibf_dump`. Instead of doing that, let's just demote it to WB unproected for correctness. These dumper object are ephemeral so there is not a huge benefit for having them WB protected. Users of the bootsnap gem ran into crashes due to this issue: https://github.com/Shopify/bootsnap/issues/436 Fixes [Bug #19419]
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 27b2d0990e..66dafe0169 100644
--- a/compile.c
+++ b/compile.c
@@ -13056,7 +13056,7 @@ ibf_dump_memsize(const void *ptr)
static const rb_data_type_t ibf_dump_type = {
"ibf_dump",
{ibf_dump_mark, ibf_dump_free, ibf_dump_memsize,},
- 0, 0, RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FREE_IMMEDIATELY
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
static void