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

ruby-changes:52385

From: normal <ko1@a...>
Date: Fri, 31 Aug 2018 04:14:59 +0900 (JST)
Subject: [ruby-changes:52385] normal:r64593 (trunk): cont.c (rb_fiber_atfork): th->root_fiber may not exist

normal	2018-08-31 04:14:37 +0900 (Fri, 31 Aug 2018)

  New Revision: 64593

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64593

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

  Modified files:
    trunk/cont.c
Index: cont.c
===================================================================
--- cont.c	(revision 64592)
+++ cont.c	(revision 64593)
@@ -1981,11 +1981,13 @@ fiber_to_s(VALUE fibval) https://github.com/ruby/ruby/blob/trunk/cont.c#L1981
 void
 rb_fiber_atfork(rb_thread_t *th)
 {
-    if (&th->root_fiber->cont.saved_ec != th->ec) {
-        th->root_fiber = th->ec->fiber_ptr;
-        th->root_fiber->cont.type = ROOT_FIBER_CONTEXT;
+    if (th->root_fiber) {
+        if (&th->root_fiber->cont.saved_ec != th->ec) {
+            th->root_fiber = th->ec->fiber_ptr;
+            th->root_fiber->cont.type = ROOT_FIBER_CONTEXT;
+        }
+        th->root_fiber->prev = 0;
     }
-    th->root_fiber->prev = 0;
 }
 #endif
 

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

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