From 1de793a57f7c3e5596a64530fbf5a58fc5910100 Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 31 Jan 2019 11:02:52 +0000 Subject: merge revision(s) 64589,64593: [Backport #15041] cont.c: set th->root_fiber to current fiber at fork Otherwise, th->root_fiber can point to an invalid Fiber, because Fibers do not live across fork. So consider whatever Fiber is running the root fiber. [ruby-core:88723] [Bug #15041] cont.c (rb_fiber_atfork): th->root_fiber may not exist Otherwise, bootstraptest/test_fork.rb fails with -DVM_CHECK_MODE=2 [Bug #15041] Fixes: r64589 "cont.c: set th->root_fiber to current fiber at fork" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@66968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_fiber.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb index ffcb02ce51..dec9f8028b 100644 --- a/test/ruby/test_fiber.rb +++ b/test/ruby/test_fiber.rb @@ -256,7 +256,11 @@ class TestFiber < Test::Unit::TestCase end bug5700 = '[ruby-core:41456]' assert_nothing_raised(bug5700) do - Fiber.new{ pid = fork {} }.resume + Fiber.new do + pid = fork do + Fiber.new {}.transfer + end + end.resume end pid, status = Process.waitpid2(pid) assert_equal(0, status.exitstatus, bug5700) -- cgit v1.2.3