From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28339 invoked by alias); 4 Dec 2013 10:24:35 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 28304 invoked by uid 48); 4 Dec 2013 10:24:32 -0000 From: "konstantin.s.serebryany at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/16291] feature request: provide simpler ways to compute stack and tls boundaries Date: Wed, 04 Dec 2013 10:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: konstantin.s.serebryany at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-12/txt/msg00050.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=16291 --- Comment #4 from Kostya Serebryany --- > Can you clarify why you need to know the max size the stack might grow to, > rather than the currently valid stack range? The latter would be much easier > to obtain, and the former could (I think) become wrong if the application > uses setrlimit between the time the stack size is obtained and the time your > code needs to know it. Our code computes the stack bounds at thread initialization and never computes them again for performance reasons: the bounds are needed in the frame-pointer-based unwinder which needs to know the stack bounds, and we call the unwinder on every malloc/free, so this is hot. And we don't want to have special code like "if (in_main_thread)" in hot places. We need the stack bounds in a few other less performance-critical places too. Anyway, the moving end of the main thread's stack is the least of our concerns, tls size and non-main-thread stack bounds are more painful. -- You are receiving this mail because: You are on the CC list for the bug.