summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-31 11:02:52 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-31 11:02:52 +0000
commit1de793a57f7c3e5596a64530fbf5a58fc5910100 (patch)
treedb2d6557759d6ee7c76bdfea003d97a85e3c76af /thread.c
parent3d89e55ba384dc065c7f76e0bac2350c4606109b (diff)
merge revision(s) 64589,64593: [Backport #15041]
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] 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" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@66968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 3992753304..0415ea8c6a 100644
--- a/thread.c
+++ b/thread.c
@@ -4172,12 +4172,14 @@ terminate_atfork_i(rb_thread_t *th, const rb_thread_t *current_th)
}
}
+void rb_fiber_atfork(rb_thread_t *);
void
rb_thread_atfork(void)
{
rb_thread_t *th = GET_THREAD();
rb_thread_atfork_internal(th, terminate_atfork_i);
th->join_list = NULL;
+ rb_fiber_atfork(th);
/* We don't want reproduce CVE-2003-0900. */
rb_reset_random_seed();