ruby-changes:38315
From: usa <ko1@a...>
Date: Tue, 28 Apr 2015 14:14:48 +0900 (JST)
Subject: [ruby-changes:38315] usa:r50396 (ruby_2_1): merge revision(s) 50316: [Backport #11030]
usa 2015-04-28 14:14:29 +0900 (Tue, 28 Apr 2015) New Revision: 50396 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50396 Log: merge revision(s) 50316: [Backport #11030] * thread_pthread.c (reserve_stack): keep sp safe zone to get rid of crash by -fstack-check. [ruby-core:68740] [Bug #11030] 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/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 50395) +++ ruby_2_1/ChangeLog (revision 50396) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Tue Apr 28 14:14:16 2015 Nobuyoshi Nakada <nobu@r...> + + * thread_pthread.c (reserve_stack): keep sp safe zone to get rid + of crash by -fstack-check. [ruby-core:68740] [Bug #11030] + Fri Apr 24 17:27:31 2015 Koichi Sasada <ko1@a...> * test/fiddle/test_handle.rb: fix syntax. Index: ruby_2_1/thread_pthread.c =================================================================== --- ruby_2_1/thread_pthread.c (revision 50395) +++ ruby_2_1/thread_pthread.c (revision 50396) @@ -657,11 +657,16 @@ reserve_stack(volatile char *limit, size https://github.com/ruby/ruby/blob/trunk/ruby_2_1/thread_pthread.c#L657 # endif struct rlimit rl; volatile char buf[0x100]; + enum {stack_check_margin = 0x1000}; /* for -fstack-check */ + STACK_GROW_DIR_DETECTION; if (!getrlimit(RLIMIT_STACK, &rl) && rl.rlim_cur == RLIM_INFINITY) return; + if (size < stack_check_margin) return; + size -= stack_check_margin; + size -= sizeof(buf); /* margin */ if (IS_STACK_DIR_UPPER()) { const volatile char *end = buf + sizeof(buf); @@ -669,13 +674,14 @@ reserve_stack(volatile char *limit, size https://github.com/ruby/ruby/blob/trunk/ruby_2_1/thread_pthread.c#L674 if (limit > end) { size = limit - end; limit = alloca(size); - limit[size-1] = 0; + limit[stack_check_margin+size-1] = 0; } } else { limit -= size; if (buf > limit) { limit = alloca(buf - limit); + limit -= stack_check_margin; limit[0] = 0; } } Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 50395) +++ ruby_2_1/version.h (revision 50396) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.7" -#define RUBY_RELEASE_DATE "2015-04-24" -#define RUBY_PATCHLEVEL 338 +#define RUBY_RELEASE_DATE "2015-04-28" +#define RUBY_PATCHLEVEL 339 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 4 -#define RUBY_RELEASE_DAY 24 +#define RUBY_RELEASE_DAY 28 #include "ruby/version.h" Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r50316 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/