* 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/trunk@32319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2011-06-30 03:34:16 +00:00
Родитель f680230589
Коммит 5164677841
2 изменённых файлов: 19 добавлений и 2 удалений

Просмотреть файл

@ -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 09:36:37 2011 Eric Hodel <drbrain@segment7.net>
* lib/weakref.rb: Attach documentation to WeakRef and add missing

Просмотреть файл

@ -1122,8 +1122,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
/* communication pipe with timer thread and signal handler */