RFR(XS): 8204652: [aix] fix thread stack allocation, too big stack sizes not recognized

David Holmes david.holmes at oracle.com
Mon Jun 11 11:16:44 UTC 2018

On 11/06/2018 7:40 PM, Thomas Stüfe wrote:
> On Mon, Jun 11, 2018 at 10:35 AM, David Holmes <david.holmes at oracle.com> wrote:
> <snip>
>>> As we know linux is bad at implementing the pthread functionality here:
>>> It accepts setting the big value as stack size, and only when you call
>>> create
>>> you get the failure.
>> Does POSIX require otherwise?
> No. Since pthread_attr_setstacksize() and pthread_create() happen at
> different times, the memory situation may be different at thread
> creation time, so any check for available memory done at
> pthread_attr_setstacksize() time is of course incomplete.
> Of course the OS could weed out obvious bogus values when
> pthread_attr_setstacksize() is called. But it is not required to do
> so.
> But I talked this over with Goetz offline - I think to be correct, one
> would have to handle error returns from pthread_attr_setstacksize() on
> Linux too. The fact that the glibc allows any silly stack size to be
> set at that point is a glibc implementation detail, and may e.g.
> change when compiling with a different libc.

True but in that case, for product, we just fallback to the defaults. I 
wonder if Portola [1] ran into this at all with Musl ...


[1] http://hg.openjdk.java.net/portola/portola

> But that is not urgent.
> <snip>
> ..Thomas

More information about the hotspot-runtime-dev mailing list