From 59a6ed8cc10e11720cb3eaea8d4750d29cd61167 Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 20 Mar 2018 02:08:27 +0000 Subject: merge revision(s) 62668: [Backport #14578] thread.c: reset waitq of keeping mutexes in child We must not maintain references to threads in the parent process in any mutexes held by the child process. * thread_sync.c (rb_mutex_cleanup_keeping_mutexes): new function * thread.c (rb_thread_atfork): cleanup keeping mutexes [ruby-core:85940] [Bug #14578] Fixes: r58604 (commit 3586c9e0876e784767a1c1adba9ebc2499fa0ec2) ("reduce rb_mutex_t size from 160 to 80 bytes on 64-bit") git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 1 + 1 file changed, 1 insertion(+) (limited to 'thread.c') diff --git a/thread.c b/thread.c index 9f2267a1f4..fad0ce6efc 100644 --- a/thread.c +++ b/thread.c @@ -4208,6 +4208,7 @@ rb_thread_atfork(void) rb_thread_t *th = GET_THREAD(); rb_thread_atfork_internal(th, terminate_atfork_i); th->join_list = NULL; + rb_mutex_cleanup_keeping_mutexes(th); /* We don't want reproduce CVE-2003-0900. */ rb_reset_random_seed(); -- cgit v1.2.3