RFR(xs): 8187028: [aix] Real thread stack size may be up to 64K smaller than requested one

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Thu Aug 31 13:54:51 UTC 2017


Hi Thomas,

is it possible that AIX takes the os guard pages out of the stack in your case?
But if I remember correctly, AIX added them to the size of the stack correctly,
linux has non-standard behavior, see also create_thread in os_linux.cpp.

Instead of thread->stack_base() - thread->stack_size(); please use stack_end().

Did you check this does not break the stack sizing tests? I think they start the
VM with small stacks and expect the VM not to start up. Now it might start
up if the bug is not on that platform because the stack is 64K bigger than
expected.

Best regards,
  Goetz.




From: ppc-aix-port-dev [mailto:ppc-aix-port-dev-bounces at openjdk.java.net] On Behalf Of Thomas Stüfe
Sent: Thursday, August 31, 2017 12:09 PM
To: ppc-aix-port-dev at openjdk.java.net
Subject: RFR(xs): 8187028: [aix] Real thread stack size may be up to 64K smaller than requested one

Hi all,

please review this change:

Bug:
https://bugs.openjdk.java.net/browse/JDK-8187028

change:
http://cr.openjdk.java.net/~stuefe/webrevs/8187028-aix-Real-thread-stack-size-may-be-up-to-64K-smaller-than-requested-one/webrev.00/webrev/

The issue is that on AIX, pthread library seems to have a bug where it sometimes gives us less thread stack space than we requested (a variable amount, but seems to be 0..64K). This may cause intermittent stack overflow errors if the stacks are very small to begin with.

The workaround is to add 64K to the requested stack size to account for the fact that the OS may give us up to 64K less stack.

Also, improved logging.

Thanks, Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/ppc-aix-port-dev/attachments/20170831/aa01d0da/attachment-0001.html>


More information about the ppc-aix-port-dev mailing list