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

ruby-changes:51920

From: normal <ko1@a...>
Date: Tue, 31 Jul 2018 06:48:38 +0900 (JST)
Subject: [ruby-changes:51920] normal:r64134 (trunk): thread_pthread.c (unregister_ubf_list): assert unblock.func is unset

normal	2018-07-31 06:48:32 +0900 (Tue, 31 Jul 2018)

  New Revision: 64134

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

  Log:
    thread_pthread.c (unregister_ubf_list): assert unblock.func is unset
    
    We must not allow reentry into ubf_list_head once we delete
    ourselves, otherwise we could hang in there forever.
    
    [ruby-core:88218] [Bug #14945]

  Modified files:
    trunk/thread_pthread.c
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 64133)
+++ thread_pthread.c	(revision 64134)
@@ -1178,6 +1178,9 @@ unregister_ubf_list(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L1178
 {
     struct list_node *node = &th->native_thread_data.ubf_list;
 
+    /* we can't allow re-entry into ubf_list_head */
+    VM_ASSERT(th->unblock.func == 0);
+
     if (!list_empty((struct list_head*)node)) {
         rb_native_mutex_lock(&ubf_list_lock);
 	list_del_init(node);

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

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