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

ruby-changes:42320

From: usa <ko1@a...>
Date: Tue, 29 Mar 2016 21:07:54 +0900 (JST)
Subject: [ruby-changes:42320] usa:r54394 (ruby_2_1): merge revision(s) 54256: [Backport #12118] [Backport #12218]

usa	2016-03-29 21:07:49 +0900 (Tue, 29 Mar 2016)

  New Revision: 54394

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

  Log:
    merge revision(s) 54256: [Backport #12118] [Backport #12218]
    
    * thread_pthread.c (reserve_stack): fix reserving position where
      the stack growing bottom to top. [Bug #12118]

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/thread_pthread.c
    branches/ruby_2_1/version.h
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 54393)
+++ ruby_2_1/version.h	(revision 54394)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.9"
-#define RUBY_RELEASE_DATE "2016-03-26"
-#define RUBY_PATCHLEVEL 486
+#define RUBY_RELEASE_DATE "2016-03-29"
+#define RUBY_PATCHLEVEL 487
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 3
-#define RUBY_RELEASE_DAY 26
+#define RUBY_RELEASE_DAY 29
 
 #include "ruby/version.h"
 
Index: ruby_2_1/thread_pthread.c
===================================================================
--- ruby_2_1/thread_pthread.c	(revision 54393)
+++ ruby_2_1/thread_pthread.c	(revision 54394)
@@ -675,17 +675,31 @@ reserve_stack(volatile char *limit, size https://github.com/ruby/ruby/blob/trunk/ruby_2_1/thread_pthread.c#L675
 	const volatile char *end = buf + sizeof(buf);
 	limit += size;
 	if (limit > end) {
-	    size = limit - end;
-	    limit = alloca(size);
-	    limit[stack_check_margin+size-1] = 0;
+	    /* |<-bottom (=limit(a))                                     top->|
+	     * | .. |<-buf 256B |<-end                          | stack check |
+	     * |  256B  |              =size=                   | margin (4KB)|
+	     * |              =size=         limit(b)->|  256B  |             |
+	     * |                |       alloca(sz)     |        |             |
+	     * | .. |<-buf      |<-limit(c)    [sz-1]->0>       |             |
+	     */
+	    size_t sz = limit - end;
+	    limit = alloca(sz);
+	    limit[sz-1] = 0;
 	}
     }
     else {
 	limit -= size;
 	if (buf > limit) {
-	    limit = alloca(buf - limit);
-	    limit[0] = 0; /* ensure alloca is called */
-	    limit -= stack_check_margin;
+	    /* |<-top (=limit(a))                                     bottom->|
+	     * | .. | 256B buf->|                               | stack check |
+	     * |  256B  |              =size=                   | margin (4KB)|
+	     * |              =size=         limit(b)->|  256B  |             |
+	     * |                |       alloca(sz)     |        |             |
+	     * | .. |      buf->|           limit(c)-><0>       |             |
+	     */
+	    size_t sz = buf - limit;
+	    limit = alloca(sz);
+	    limit[0] = 0;
 	}
     }
 }
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 54393)
+++ ruby_2_1/ChangeLog	(revision 54394)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Tue Mar 29 21:07:30 2016  NARUSE, Yui  <naruse@r...>
+
+	* thread_pthread.c (reserve_stack): fix reserving position where
+	  the stack growing bottom to top. [Bug #12118]
+
 Fri Mar 25 18:42:46 2016  Koichi ITO  <koic.ito@g...>
 
 	* variable.c: Added documentation about order of `Module#constants`

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r54256


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

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