diff options
| -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 |
