summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-31 00:12:02 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-31 00:12:02 +0000
commitfffe09dd3dabd7dbcdbb1483bbed350563cd3b65 (patch)
tree0325a523bfc52ecd6628e918779880fc090642e0
parent31dc2ea28fe807a9c793147ba6417cbf6f34e383 (diff)
merges r31577 from trunk into ruby_1_9_2.
-- * 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/branches/ruby_1_9_2@31834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--cont.c1
-rw-r--r--test/ruby/test_fiber.rb11
-rw-r--r--version.h2
4 files changed, 20 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3c38cc9794..89e0250c17 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sun May 15 21:22:35 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
+
+ * 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.
+
Wed May 11 19:45:27 2011 Keiju Ishitsuka <keiju@ishitsuka.com>
* lib/forwardable.rb: support 'delegate :foo => :bar' for to meet
diff --git a/cont.c b/cont.c
index ff7cfd50e9..d1c2d6c356 100644
--- a/cont.c
+++ b/cont.c
@@ -285,6 +285,7 @@ cont_init(rb_context_t *cont, rb_thread_t *th)
/* save thread context */
cont->saved_thread = *th;
cont->saved_thread.local_storage = 0;
+ cont->saved_thread.machine_stack_start = cont->saved_thread.machine_stack_end = 0;
}
static rb_context_t *
diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb
index edfe55a1d3..6c839cfe62 100644
--- a/test/ruby/test_fiber.rb
+++ b/test/ruby/test_fiber.rb
@@ -189,5 +189,16 @@ class TestFiber < Test::Unit::TestCase
f1.transfer
}, '[ruby-dev:40833]'
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
diff --git a/version.h b/version.h
index 712fdaca53..1968722c60 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 251
+#define RUBY_PATCHLEVEL 252
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1