JDK-8169373 introduced code to work around Linux glibc NPTL pthread implementation bug about guard size prior to glibc 2.27. As [~simonis] mentioned, the glibc NPTL bug has been fixed in glibc 2.27 in https://sourceware.org/bugzilla/show_bug.cgi?id=22637.
Now running a JDK with glibc 2.27+ leads to less usable stack space due to the workaround code. We have observed JVM crashes with internal tests due to their high usage of stack space and the workaround code. Ideally we should avoid applying the workaround code for glibc 2.27+.
Several options are:
- Automatically detect glibc version, then apply the workaround depending on glibc version. We have an internal patch that does this, but it adds code complexity and is perhaps a bit overkill.
- Add a JVM flag so that users could disable the workaround if needed.
- Do nothing for now, and remove the workaround code once OpenJDK stops supporting glibc prior to 2.27.