aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2017-09-25 17:51:34 -0700
committerPaul Pluzhnikov <ppluzhnikov@google.com>2017-09-25 17:51:34 -0700
commit8f8349870fbcd822b0bdbd3200bc0245f812dae4 (patch)
tree8a0c6ebb68f01adefb4088cc061c5b1491a3a131 /stdlib
parent3de93d194a5d27cabfe40ddf58aea36939498ba4 (diff)
downloadglibc-8f8349870fbcd822b0bdbd3200bc0245f812dae4.tar
glibc-8f8349870fbcd822b0bdbd3200bc0245f812dae4.tar.gz
glibc-8f8349870fbcd822b0bdbd3200bc0245f812dae4.tar.bz2
glibc-8f8349870fbcd822b0bdbd3200bc0245f812dae4.zip
Reduce total memory required to create all threads to 128MiB. This fixes
intermittent failure in stdlib/test-{atexit,at_quick_exit,...} tests (Bug 22207).
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/test-atexit-race-common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/stdlib/test-atexit-race-common.c b/stdlib/test-atexit-race-common.c
index b3792837c7..3a03e06cb9 100644
--- a/stdlib/test-atexit-race-common.c
+++ b/stdlib/test-atexit-race-common.c
@@ -57,6 +57,11 @@ do_test (void)
xpthread_attr_init (&attr);
xpthread_attr_setdetachstate (&attr, 1);
+ /* With default 8MiB Linux stack size, creating 1024 threads can cause
+ VM exhausiton on 32-bit machines. Reduce stack size of each thread to
+ 128KiB for a maximum required VM size of 128MiB. */
+ xpthread_attr_setstacksize (&attr, 128 * 1024);
+
for (i = 0; i < kNumThreads; ++i) {
xpthread_create (&attr, threadfunc, NULL);
}