Skip to content

Commit 673e230

Browse files
committed
stdlib: Fixing test-*atexit*-race tests on ia64
These tests require a new thread stack size set to a value (0x20000) lower than the architecture minimum (0x30000). Set the stack size to PTHREAD_STACK_MIN in this case. Checked on ia64-linux-gnu. * stdlib/test-atexit-race-common.c (do_test): Check stack size against PTHREAD_STACK_MIN.
1 parent ced64e0 commit 673e230

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2018-02-01 Adhemerval Zanella <[email protected]>
2+
3+
* stdlib/test-atexit-race-common.c (do_test): Check stack size
4+
against PTHREAD_STACK_MIN.
5+
16
2018-02-01 Dmitry V. Levin <[email protected]>
27

38
* manual/contrib.texi (Palmer Dabbelt, Arjun Shankar, Florian Weimer):

stdlib/test-atexit-race-common.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@
3434
#include <stdio.h>
3535
#include <stdlib.h>
3636
#include <support/xthread.h>
37+
#include <limits.h>
3738

3839
const size_t kNumThreads = 1024;
3940
const size_t kNumHandlers = 1024;
41+
const size_t kStacksize =
42+
0x20000 < PTHREAD_STACK_MIN ? PTHREAD_STACK_MIN : 0x20000;
4043

4144
static void *
4245
threadfunc (void *unused)
@@ -60,7 +63,7 @@ do_test (void)
6063
/* With default 8MiB Linux stack size, creating 1024 threads can cause
6164
VM exhausiton on 32-bit machines. Reduce stack size of each thread to
6265
128KiB for a maximum required VM size of 128MiB. */
63-
xpthread_attr_setstacksize (&attr, 128 * 1024);
66+
xpthread_attr_setstacksize (&attr, kStacksize);
6467

6568
for (i = 0; i < kNumThreads; ++i) {
6669
xpthread_create (&attr, threadfunc, NULL);

0 commit comments

Comments
 (0)