summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-29 08:04:09 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-29 08:04:09 +0000
commitac543abe91d7325ace7254f635f34e71e1faaf2e (patch)
tree5ca62909a8025cef2d949b57932b43df0a62b678 /thread.c
parent43d3f813bc75dc532e15af5d22b4e6593030e8ff (diff)
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64589 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 066d34c42a..e40b120f72 100644
--- a/thread.c
+++ b/thread.c
@@ -4381,6 +4381,7 @@ terminate_atfork_i(rb_thread_t *th, const rb_thread_t *current_th)
/* mjit.c */
void mjit_child_after_fork(void);
+void rb_fiber_atfork(rb_thread_t *);
void
rb_thread_atfork(void)
{
@@ -4388,6 +4389,7 @@ rb_thread_atfork(void)
rb_thread_atfork_internal(th, terminate_atfork_i);
th->join_list = NULL;
rb_mutex_cleanup_keeping_mutexes(th);
+ rb_fiber_atfork(th);
/* We don't want reproduce CVE-2003-0900. */
rb_reset_random_seed();