From 86c8e15170484fe23b311e567717053f147ffd9c Mon Sep 17 00:00:00 2001 From: "NARUSE, Yui" Date: Mon, 7 Feb 2022 19:58:46 +0900 Subject: merge revision(s) 2a76440fac62b: [Backport #18501] [Bug #18501] Fire write barrier after hash has been written Before this change the write barrier was executed before the key and value were actually reachable via the Hash. This could cause inconsistencies in object coloration which would lead to accidental collection of dup'd keys. Example: 1. Object O is grey, Object P is white. 2. Write barrier fires O -> P 3. Write barrier does nothing 4. Malloc happens, which starts GC 5. GC colors O black 6. P is written in to O (now we have O -> P reference) 7. P is now accidentally treated as garbage --- hash.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) --- version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'version.h') diff --git a/version.h b/version.h index da7aae466f..206b97d979 100644 --- a/version.h +++ b/version.h @@ -11,7 +11,7 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 14 +#define RUBY_PATCHLEVEL 15 #define RUBY_RELEASE_YEAR 2022 #define RUBY_RELEASE_MONTH 2 -- cgit v1.2.3