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

ruby-changes:43988

From: nobu <ko1@a...>
Date: Sat, 3 Sep 2016 11:28:44 +0900 (JST)
Subject: [ruby-changes:43988] nobu:r56060 (trunk): thread_pthread.c: check stack on co-routine case

nobu	2016-09-03 11:28:31 +0900 (Sat, 03 Sep 2016)

  New Revision: 56060

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

  Log:
    thread_pthread.c: check stack on co-routine case
    
    * thread_pthread.c (ruby_init_stack): check stack bounds even if
      get_main_stack succeeded, on the "co-routine" case.
      https://github.com/ruby/ruby/commit/53953ee#commitcomment-18887413

  Modified files:
    trunk/ChangeLog
    trunk/thread_pthread.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 56059)
+++ ChangeLog	(revision 56060)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Sep  3 11:28:29 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* thread_pthread.c (ruby_init_stack): check stack bounds even if
+	  get_main_stack succeeded, on the "co-routine" case.
+	  https://github.com/ruby/ruby/commit/53953ee#commitcomment-18887413
+
 Fri Sep  2 16:06:59 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* internal.h (MEMO_V1_SET, MEMO_V2_SET): fix typos.  use the macro
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 56059)
+++ thread_pthread.c	(revision 56060)
@@ -749,7 +749,7 @@ ruby_init_stack(volatile VALUE *addr https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L749
 	    native_main_thread.stack_maxsize = size;
 	    native_main_thread.stack_start = stackaddr;
 	    reserve_stack(stackaddr, size);
-	    return;
+	    goto bound_check;
 	}
     }
 #endif
@@ -797,6 +797,9 @@ ruby_init_stack(volatile VALUE *addr https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L797
 #endif
     }
 
+#if MAINSTACKADDR_AVAILABLE
+  bound_check:
+#endif
     /* If addr is out of range of main-thread stack range estimation,  */
     /* it should be on co-routine (alternative stack). [Feature #2294] */
     {

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

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