This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/16291] feature request: provide simpler ways to compute stack and tls boundaries


https://sourceware.org/bugzilla/show_bug.cgi?id=16291

--- Comment #3 from Rich Felker <bugdal at aerifal dot cx> ---
The stack is never truly unlimited. There's a finite distance in address space
between the stack and the next adjacent VMA which inherently limits stack
growth. And the kernel only reserved a certain virtual address range in which
new mmaps won't be placed. But interpreting a stack limit of RLIM_INFINITY does
require making assumptions about how the kernel treats it, which might be
invalidated by changes in the kernel. So it's not easy.

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]