summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-29 08:04:09 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-29 08:04:09 +0000
commitac543abe91d7325ace7254f635f34e71e1faaf2e (patch)
tree5ca62909a8025cef2d949b57932b43df0a62b678 /test
parent43d3f813bc75dc532e15af5d22b4e6593030e8ff (diff)
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_fiber.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb
index ef7790b53c..c835246fda 100644
--- a/test/ruby/test_fiber.rb
+++ b/test/ruby/test_fiber.rb
@@ -269,7 +269,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)