summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-15 12:41:40 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-15 12:41:40 +0000
commit980155686aa373e015f51e3e279403d2aa66d4b9 (patch)
treecaae9748324f2dc478b7133a0c453748d4678b30 /test/ruby
parentf41dcd486e2004c042941b9d41400986d36f65dc (diff)
* cont.c (cont_init): clear macihne_stack_start/end of saved thread to
prevent mark machine stack of GC'ed Thread. root Fiber is not initialized by fiber_init(). based on a patch by Serge Balyuk [ruby-core:35891] fixes #4612 * test/ruby/test_fiber.rb (test_gc_root_fiber): add test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_fiber.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb
index ec64f98229..e3e40566f8 100644
--- a/test/ruby/test_fiber.rb
+++ b/test/ruby/test_fiber.rb
@@ -197,5 +197,16 @@ class TestFiber < Test::Unit::TestCase
end.join
end
end
+
+ def test_gc_root_fiber
+ bug4612 = '[ruby-core:35891]'
+
+ assert_normal_exit %q{
+ require 'fiber'
+ GC.stress = true
+ Thread.start{ Fiber.current; nil }.join
+ GC.start
+ }, bug4612
+ end
end