8000 merge revision(s) 44670,44671,44673,44675: [Backport #8783] · github/ruby@61d1261 · GitHub
[go: up one dir, main page]

Skip to content

Commit 61d1261

Browse files
committed
merge revision(s) 44670,44671,44673,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_2_1@45119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent b3445c0 commit 61d1261

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+
Sat Feb 22 15:56:53 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+
Sat Feb 22 15:56:53 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
Sat Feb 22 15:13:38 2014 Benoit Daloze <eregontp@gmail.com>
215

316
* range.c (Range#size): [DOC] improve description and add examples.

thread_pthread.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,17 +1479,16 @@ rb_thread_create_timer_thread(void)
14791479
exit(EXIT_FAILURE);
14801480
}
14811481
# ifdef PTHREAD_STACK_MIN
1482-
if (PTHREAD_STACK_MIN < 4096 * 3) {
1482+
{
1483+
const size_t min_size = (4096 * 4);
14831484
/* Allocate the machine stack for the timer thread
1484-
* at least 12KB (3 pages). FreeBSD 8.2 AMD64 causes
1485-
* machine stack overflow only with PTHREAD_STACK_MIN.
1485+
* at least 16KB (4 pages). FreeBSD 8.2 AMD64 causes
1486+
* machine stack overflow only with PTHREAD_STACK_MIN.
14861487
*/
1487-
pthread_attr_setstacksize(&attr,
1488-
4096 * 3 + (THREAD_DEBUG ? BUFSIZ : 0));
1489-
}
1490-
else {
1491-
pthread_attr_setstacksize(&attr,
1492-
PTHREAD_STACK_MIN + (THREAD_DEBUG ? BUFSIZ : 0));
1488+
size_t stack_size = PTHREAD_STACK_MIN; /* may be dynamic, get only once */
1489+
if (stack_size < min_size) stack_size = min_size;
1490+
if (THREAD_DEBUG) stack_size += BUFSIZ;
1491+
pthread_attr_setstacksize(&attr, stack_size);
14931492
}
14941493
# endif
14951494
#endif

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.1.1"
22
#define RUBY_RELEASE_DATE "2014-02-22"
3-
#define RUBY_PATCHLEVEL 63
3+
#define RUBY_PATCHLEVEL 64
44

55
#define RUBY_RELEASE_YEAR 2014
66
#define RUBY_RELEASE_MONTH 2

0 commit comments

Comments
 (0)
0