From 012bc5654a45b0b35acc0df7465154114bbc5dac Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Wed, 19 Jan 2022 11:37:36 -0800 Subject: [PATCH] Add Ruby patch to test GC issues with object tracing enabled It's possible we just need a `RB_GC_GUARD` to prevent `obj` from being prematurely freed by the garbage collector. This is test out https://github.com/ruby/ruby/pull/5470/files. Part of https://gitlab.com/gitlab-org/gitlab/-/issues/350296 --- patches/ruby/2.7.5/object-tracing-segfault.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 patches/ruby/2.7.5/object-tracing-segfault.patch diff --git a/patches/ruby/2.7.5/object-tracing-segfault.patch b/patches/ruby/2.7.5/object-tracing-segfault.patch new file mode 100644 index 0000000..b2a49db --- /dev/null +++ b/patches/ruby/2.7.5/object-tracing-segfault.patch @@ -0,0 +1,12 @@ +diff --git a/ext/objspace/object_tracing.c b/ext/objspace/object_tracing.c +index a057ac2a96..a122247e3b 100644 +--- a/ext/objspace/object_tracing.c ++++ b/ext/objspace/object_tracing.c +@@ -110,6 +110,7 @@ newobj_i(VALUE tpval, void *data) + info->class_path = class_path_cstr; + info->generation = rb_gc_count(); + st_insert(arg->object_table, (st_data_t)obj, (st_data_t)info); ++ RB_GC_GUARD(obj); + } + + static void