diff options
author | NARUSE, Yui <naruse@airemix.jp> | 2023-03-07 10:11:43 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2023-03-07 10:11:43 +0900 |
commit | f1cde05d99898f491c8e302ae74029468fdb6eb9 (patch) | |
tree | 4dee1145d94e9e2de5f2cfc72d882beb6fe9445f | |
parent | f93c7b9f58966fd04496bfeb2538fb1ff41f788e (diff) | |
download | ruby-f1cde05d99898f491c8e302ae74029468fdb6eb9.tar.gz |
merge revision(s) 86de48e9f69b665ba9ffb5bdc5a181a3adb1a7b8: [Backport #19419]
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]
---
compile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-rw-r--r-- | compile.c | 2 | ||||
-rw-r--r-- | version.h | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -13062,7 +13062,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 @@ -11,7 +11,7 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 1 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 34 +#define RUBY_PATCHLEVEL 35 #include "ruby/version.h" #include "ruby/internal/abi.h" |