[前][次][番号順一覧][スレッド一覧]

ruby-changes:19789

From: yugui <ko1@a...>
Date: Tue, 31 May 2011 09:12:13 +0900 (JST)
Subject: [ruby-changes:19789] yugui:r31834 (ruby_1_9_2): merges r31577 from trunk into ruby_1_9_2.

yugui	2011-05-31 09:12:02 +0900 (Tue, 31 May 2011)

  New Revision: 31834

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31834

  Log:
    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.

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/cont.c
    branches/ruby_1_9_2/test/ruby/test_fiber.rb
    branches/ruby_1_9_2/version.h

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 31833)
+++ ruby_1_9_2/ChangeLog	(revision 31834)
@@ -1,3 +1,10 @@
+Sun May 15 21:22:35 2011  CHIKANAGA Tomoyuki  <nagachika00@g...>
+
+	* 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@i...>
 
 	* lib/forwardable.rb: support 'delegate :foo => :bar' for to meet
Index: ruby_1_9_2/cont.c
===================================================================
--- ruby_1_9_2/cont.c	(revision 31833)
+++ ruby_1_9_2/cont.c	(revision 31834)
@@ -285,6 +285,7 @@
     /* 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 *
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 31833)
+++ ruby_1_9_2/version.h	(revision 31834)
@@ -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
Index: ruby_1_9_2/test/ruby/test_fiber.rb
===================================================================
--- ruby_1_9_2/test/ruby/test_fiber.rb	(revision 31833)
+++ ruby_1_9_2/test/ruby/test_fiber.rb	(revision 31834)
@@ -189,5 +189,16 @@
       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
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]