From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21839 invoked by alias); 15 Jan 2018 15:20:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 21695 invoked by uid 89); 15 Jan 2018 15:20:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy= X-HELO: albireo.enyo.de From: Florian Weimer To: libc-alpha@sourceware.org Subject: Re: [PATCH] [BZ #22637] Fix stack guard size accounting References: <20180115150839.4EA504034FFAF@oldenburg.str.redhat.com> Date: Mon, 15 Jan 2018 15:20:00 -0000 In-Reply-To: <20180115150839.4EA504034FFAF@oldenburg.str.redhat.com> (Florian Weimer's message of "Mon, 15 Jan 2018 16:08:39 +0100") Message-ID: <87po6b6tdr.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-01/txt/msg00518.txt.bz2 * Florian Weimer: > From: Szabolcs Nagy > > Previously if user requested S stack and G guard when creating a > thread, the total mapping was S and the actual available stack was > S - G - static_tls, which is not what the user requested. > > This patch fixes the guard size accounting by pretending the user > requested S+G stack. This way all later logic works out except > when reporting the user requested stack size (pthread_getattr_np) > or when computing the minimal stack size (__pthread_get_minstack). > > Normally this will increase thread stack allocations by one page. > TLS accounting is not affected, that will require a separate fix. > > [BZ #22637] > * nptl/descr.h (stackblock, stackblock_size): Update comments. > * nptl/allocatestack.c (allocate_stack): Add guardsize to stacksize. > * nptl/nptl-init.c (__pthread_get_minstack): Remove guardsize from > stacksize. > * nptl/pthread_getattr_np.c (pthread_getattr_np): Likewise. > > (cherry picked from commit 630f4cc3aa019ede55976ea561f1a7af2f068639) Please disregard. Should have gone to libc-stable.