Skip to content

Commit

Permalink
merge revision(s) 86de48e: [Backport #19419]
Browse files Browse the repository at this point in the history
	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:
	Shopify/bootsnap#436

	Fixes [Bug #19419]
	---
	 compile.c | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)
  • Loading branch information
nagachika committed Mar 21, 2023
1 parent 26b3f0b commit caedcf3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -12659,7 +12659,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
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 4
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
#define RUBY_PATCHLEVEL 205
#define RUBY_PATCHLEVEL 206

#define RUBY_RELEASE_YEAR 2023
#define RUBY_RELEASE_MONTH 3
Expand Down

0 comments on commit caedcf3

Please sign in to comment.