Reduce total memory required to create all threads to 128MiB. This fixes
authorPaul Pluzhnikov <ppluzhnikov@google.com>
Tue, 26 Sep 2017 00:51:34 +0000 (17:51 -0700)
committerPaul Pluzhnikov <ppluzhnikov@google.com>
Tue, 26 Sep 2017 00:51:34 +0000 (17:51 -0700)
intermittent failure in stdlib/test-{atexit,at_quick_exit,...} tests
(Bug 22207).

ChangeLog
stdlib/test-atexit-race-common.c

index dddda15..a92b239 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-25  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+       [BZ #22207]
+       * stdlib/test-atexit-race-common.c (do_test): Minimize required
+       VM size.
+
 2017-09-25  DJ Delorie  <dj@redhat.com>
 
        [BZ #22161]
index b379283..3a03e06 100644 (file)
@@ -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);
   }