Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
In the Linux NPTL pthread implementation the guard size mechanism is not implemented properly. The posix standard requires to add the size of the guard pages to the stack size, instead Linux takes the space out of 'stacksize'. The Posix standard http://pubs.opengroup.org/onlinepubs/9699919799/ says "the implementation allocates extra memory at the overflow end of the stack". The linux man page https://linux.die.net/man/3/pthread_attr_setguardsize says "As at glibc 2.8, the NPTL threading implementation includes the guard area within the stack size allocation, rather than allocating extra space at the end of the stack, as POSIX.1 requires". I encounter this problem in runtime/Thread/TooSmallStackSize.java on ppc with 64K pages. _compiler_thread_min_stack_allowed is 128K on ppc, and ppc specifies two OS guard pages. The VM crashes in pthread creation because there is no usable space in the thread stack after allocating the guard pages. This fix adapts the requested stack size on Linux by the size of the guard pages to mimick proper behaviour.
|