Skip to content

Commit 5bcb47d

Browse files
committed
merge revision(s) 44670,44671,44675: [Backport ruby#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 ruby#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 ruby#9436] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@44940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 86d4408 commit 5bcb47d

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
Fri Feb 14 15:04:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
2+
3+
* thread_pthread.c (rb_thread_create_timer_thread): fix for platforms
4+
where PTHREAD_STACK_MIN is a dynamic value and not a compile-time
5+
constant. [ruby-dev:47911] [Bug #9436]
6+
7+
Fri Feb 14 15:04:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
8+
9+
* thread_pthread.c (rb_thread_create_timer_thread): expand timer
10+
thread stack size to get rid of segfault on FreeBSD/powerpc64.
11+
based on the patch by Steve Wills at [ruby-core:59923].
12+
[ruby-core:56590] [Bug #8783]
13+
114
Fri Feb 14 14:58:19 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
215

316
* eval.c (rb_mod_s_constants): return its own constants for other

thread_pthread.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,17 +1193,16 @@ rb_thread_create_timer_thread(void)
11931193

11941194
pthread_attr_init(&attr);
11951195
#ifdef PTHREAD_STACK_MIN
1196-
if (PTHREAD_STACK_MIN < 4096 * 3) {
1196+
{
1197+
const size_t min_size = (4096 * 4);
11971198
/* Allocate the machine stack for the timer thread
1198-
* at least 12KB (3 pages). FreeBSD 8.2 AMD64 causes
1199-
* machine stack overflow only with PTHREAD_STACK_MIN.
1199+
* at least 16KB (4 pages). FreeBSD 8.2 AMD64 causes
1200+
* machine stack overflow only with PTHREAD_STACK_MIN.
12001201
*/
1201-
pthread_attr_setstacksize(&attr,
1202-
4096 * 3 + (THREAD_DEBUG ? BUFSIZ : 0));
1203-
}
1204-
else {
1205-
pthread_attr_setstacksize(&attr,
1206-
PTHREAD_STACK_MIN + (THREAD_DEBUG ? BUFSIZ : 0));
1202+
size_t stack_size = PTHREAD_STACK_MIN; /* may be dynamic, get only once */
1203+
if (stack_size < min_size) stack_size = min_size;
1204+
if (THREAD_DEBUG) stack_size += BUFSIZ;
1205+
pthread_attr_setstacksize(&attr, stack_size);
12071206
}
12081207
#endif
12091208

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define RUBY_VERSION "1.9.3"
2-
#define RUBY_PATCHLEVEL 521
2+
#define RUBY_PATCHLEVEL 522
33

44
#define RUBY_RELEASE_DATE "2014-02-14"
55
#define RUBY_RELEASE_YEAR 2014

0 commit comments

Comments
 (0)