From patchwork Tue Sep 26 00:09:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Pluzhnikov X-Patchwork-Id: 23142 Received: (qmail 93237 invoked by alias); 26 Sep 2017 00:10:27 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 93227 invoked by uid 89); 26 Sep 2017 00:10:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=Reduce X-HELO: mail-vk0-f52.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=OrlA/SK93twxGH3a/Yo0c6rn/h8q0Bcrbw82UKRKK4Y=; b=XjIVziYiQkeiFPzGOBKDSJ2ggnwsRIzPo0LETaCO+973iyaWsWMIAw6ZRUCree6eHF u2ZzjbeZbZ9nhk2uLlNVmPxenzT+ahkWysWeWb6ESs1wiD/xL8B0yysTiT9Xd7MLXyen vUeaVM8NtL4I45JofhL4jjj56TkW+A0xLKPt8k1KeWlancpwtcyn8h6OlL3N/By6eNiD jQpo3fjwt1klYJ+5IMVr5U6+Vo/RfLCHdBFt6CDzbU6ivK1u3b2gh+4AO7jTBYcdqPcS m6XyvQdW8+lsb/i17hHlGI46XZKOjChlY0U8lKXyKJ8REYHY8BigTJpBsjoH4cj488R+ 5XCQ== X-Gm-Message-State: AHPjjUgdBp1qGnXL8b3PjWuRIhr2mXrQ3RMATEGg6G6NrJYKKwmUQChw JXq9E+VcnxjfGeiiq0uUElfEf9NoANKTt6wbPKiV+XEZFoE= X-Google-Smtp-Source: AOwi7QCc6QK4uujFUl6VdMrbBXczs7fyzux6z+18pw2seeBAN22jnL1NhD8T8gLyNxHYgHbjhR/OE8Usai2DGpabcYA= X-Received: by 10.31.191.81 with SMTP id p78mr7003674vkf.127.1506384623047; Mon, 25 Sep 2017 17:10:23 -0700 (PDT) MIME-Version: 1.0 From: Paul Pluzhnikov Date: Mon, 25 Sep 2017 17:09:52 -0700 Message-ID: Subject: [patch] Fix for BZ 22207 -- intermittent failure to create threads on 32-bit machines To: GLIBC Devel Cc: "H.J. Lu" Greetings, In stdlib/test-{atexit,at_quick_exit,cxa_atexit,on_exit} tests, I am creating 1024 new threads. With default 8MiB Linux thread stack size, if all threads are alive at the same time, this would require 8GiB of VM, which is a bit of a problem on 32-bit machines. Attached patch reduces total VM space required for all threads to 128MiB. Proposed commit message: --- Reduce total memory required to create all threads to 128MiB. This fixes intermittent failure in stdlib/test-{atexit,at_quick_exit,cxa_atexit,on_exit} tests (Bug 22207). --- Thanks, 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); }