merge revision(s) 44670,44671,44675: [Backport #8783]

thread_pthread.c: timer thread stack size

	* thread_pthread.c (rb_thread_create_timer_thread): define the stack
  size for timer thread at compile time.
	* thread_pthread.c (rb_thread_create_timer_thread): expand timer
	  thread stack size to get rid of segfault on FreeBSD/powerpc64.
	  based on the patch by Steve Wills at [ruby-core:59923].
	  [ruby-core:56590] [Bug #8783]

	* thread_pthread.c (rb_thread_create_timer_thread): fix for platforms
	  where PTHREAD_STACK_MIN is a dynamic value and not a compile-time
	  constant.  [ruby-dev:47911] [Bug #9436]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@44940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2014-02-14 06:06:14 +00:00
parent 86d4408ce9
commit 5bcb47db2b
3 changed files with 22 additions and 10 deletions

View file

@ -1,3 +1,16 @@
Fri Feb 14 15:04:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* thread_pthread.c (rb_thread_create_timer_thread): fix for platforms
where PTHREAD_STACK_MIN is a dynamic value and not a compile-time
constant. [ruby-dev:47911] [Bug #9436]
Fri Feb 14 15:04:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* thread_pthread.c (rb_thread_create_timer_thread): expand timer
thread stack size to get rid of segfault on FreeBSD/powerpc64.
based on the patch by Steve Wills at [ruby-core:59923].
[ruby-core:56590] [Bug #8783]
Fri Feb 14 14:58:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_mod_s_constants): return its own constants for other

View file

@ -1193,17 +1193,16 @@ rb_thread_create_timer_thread(void)
pthread_attr_init(&attr);
#ifdef PTHREAD_STACK_MIN
if (PTHREAD_STACK_MIN < 4096 * 3) {
{
const size_t min_size = (4096 * 4);
/* 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.
* at least 16KB (4 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));
size_t stack_size = PTHREAD_STACK_MIN; /* may be dynamic, get only once */
if (stack_size < min_size) stack_size = min_size;
if (THREAD_DEBUG) stack_size += BUFSIZ;
pthread_attr_setstacksize(&attr, stack_size);
}
#endif

View file

@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.3"
#define RUBY_PATCHLEVEL 521
#define RUBY_PATCHLEVEL 522
#define RUBY_RELEASE_DATE "2014-02-14"
#define RUBY_RELEASE_YEAR 2014