summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2023-11-13 08:13:33 +0100
committerJean Boussier <jean.boussier@gmail.com>2023-11-13 08:57:57 +0100
commita1887f4dc2e62455a605944468e59e647f698f1a (patch)
treeef21aeac4e599bb27938bf94b2da4e85a634d2df
parent9ca41e999159096cb0872b4babbb94bf5d1af4ce (diff)
Revert "Fix crash caused by concurrent ObjectSpace.dump_all calls"
This reverts commit 9a62fd3cbae2ebb60e2f9cad782af1ad18db4319.
-rw-r--r--gc.c6
-rw-r--r--test/objspace/test_objspace.rb8
2 files changed, 1 insertions, 13 deletions
diff --git a/gc.c b/gc.c
index 2c3d3e1100..510b83c817 100644
--- a/gc.c
+++ b/gc.c
@@ -11935,11 +11935,7 @@ static void
reachable_objects_from_callback(VALUE obj)
{
rb_ractor_t *cr = GET_RACTOR();
- struct gc_mark_func_data_struct *cur_mfd = cr->mfd;
- cur_mfd->mark_func(obj, cr->mfd->data);
- /* mark_func might give up the GVL, in which time some other thread might set
- mfd. In that case, set it back to the right value for this thread. */
- cr->mfd = cur_mfd;
+ cr->mfd->mark_func(obj, cr->mfd->data);
}
void
diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb
index 1a8d7a24ba..1f1709fb76 100644
--- a/test/objspace/test_objspace.rb
+++ b/test/objspace/test_objspace.rb
@@ -918,14 +918,6 @@ class TestObjSpace < Test::Unit::TestCase
assert_equal 2, ObjectSpace.dump_shapes(output: :string, since: RubyVM.stat(:next_shape_id) - 2).lines.size
end
- def test_dump_all_in_parallel_bug_19922
- dump_ten_times = ->() { 10.times { ObjectSpace.dump_all.tap { _1.close } } }
- t = Thread.new { dump_ten_times.call }
- dump_ten_times.call
- t.value
- # Bug #19922 would cause this test to crash.
- end
-
private
def utf8_❨╯°□°❩╯︵┻━┻