ruby-changes:20873
From: yugui <ko1@a...>
Date: Thu, 11 Aug 2011 09:39:34 +0900 (JST)
Subject: [ruby-changes:20873] yugui:r32921 (ruby_1_9_2): merges r32319 from trunk into ruby_1_9_2.
yugui 2011-08-11 09:38:47 +0900 (Thu, 11 Aug 2011) New Revision: 32921 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32921 Log: 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). Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/thread_pthread.c branches/ruby_1_9_2/version.h Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 32920) +++ ruby_1_9_2/ChangeLog (revision 32921) @@ -1,3 +1,10 @@ +Thu Jun 30 12:25:34 2011 Koichi Sasada <ko1@a...> + + * 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@g...> * thread.c (thread_s_pass): change RDoc description and remove Index: ruby_1_9_2/thread_pthread.c =================================================================== --- ruby_1_9_2/thread_pthread.c (revision 32920) +++ ruby_1_9_2/thread_pthread.c (revision 32921) @@ -835,8 +835,18 @@ 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); Index: ruby_1_9_2/version.h =================================================================== --- ruby_1_9_2/version.h (revision 32920) +++ ruby_1_9_2/version.h (revision 32921) @@ -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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/