diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-11 00:38:47 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-11 00:38:47 +0000 |
commit | 03f06aa7affc76868bd306b3e521219d6a12b5dd (patch) | |
tree | 21d4f002a33bf391b204d1f904ce3a7a0f0f799b | |
parent | ed034f0c5af2ac11ee4d2d9637168a39017ec695 (diff) |
merges r32319 from trunk into ruby_1_9_2.
--
* thread_pthread.c (rb_thread_create_timer_thread): allocate
machine stack for the timer thread at least 12KB. FreeBSD 8.2
AMD64 causes machine stack overflow (SIGSEGV) only with
PTHREAD_STACK_MIN (maybe defined as 2KB).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@32921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | thread_pthread.c | 14 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 20 insertions, 3 deletions
@@ -1,3 +1,10 @@ +Thu Jun 30 12:25:34 2011 Koichi Sasada <ko1@atdot.net> + + * thread_pthread.c (rb_thread_create_timer_thread): allocate + machine stack for the timer thread at least 12KB. FreeBSD 8.2 + AMD64 causes machine stack overflow (SIGSEGV) only with + PTHREAD_STACK_MIN (maybe defined as 2KB). + Thu Jun 30 01:31:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> * thread.c (thread_s_pass): change RDoc description and remove diff --git a/thread_pthread.c b/thread_pthread.c index d3c2609a12..cf054f5e44 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -835,8 +835,18 @@ rb_thread_create_timer_thread(void) pthread_attr_init(&attr); #ifdef PTHREAD_STACK_MIN - pthread_attr_setstacksize(&attr, - PTHREAD_STACK_MIN + (THREAD_DEBUG ? BUFSIZ : 0)); + if (PTHREAD_STACK_MIN < 4096 * 3) { + /* Allocate the machine stack for the timer thread + * at least 12KB (3 pages). FreeBSD 8.2 AMD64 causes + * machine stack overflow only with PTHREAD_STACK_MIN. + */ + pthread_attr_setstacksize(&attr, + 4096 * 3 + (THREAD_DEBUG ? BUFSIZ : 0)); + } + else { + pthread_attr_setstacksize(&attr, + PTHREAD_STACK_MIN + (THREAD_DEBUG ? BUFSIZ : 0)); + } #endif native_mutex_lock(&timer_thread_lock); err = pthread_create(&timer_thread_id, &attr, thread_timer, 0); @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 306 +#define RUBY_PATCHLEVEL 307 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |