-
Bug
-
Resolution: Won't Fix
-
P3
-
7
-
generic
-
linux
Gary Benson reported on the OpenJDK hotspot-dev mailing list:
The first thing I discovered is that the current linux code is wrong
when there are guard pages. The comment above current_stack_region
in os_linux_{i486,amd64,x86}.cpp puts the guard page outside the
region reported by pthread_attr_getstack(), which is not the case.
It needs to use pthread_attr_getguardsize() and trim that many bytes
from the bottom of the region reported by pthread_attr_getstack().
For Java threads we don't set any glibc guardpages, but for natively attaching threads we assume that the glibc guardpage is outside the stack area as reported by pthread_attr_getstack and pthread_attr_getstacksize.
However it seems glibc doesn't read the POSIX specification in the same way:
https://bugzilla.redhat.com/show_bug.cgi?id=435337
as a result hotspot's guard pages may overlap the glibc guard pages on attached threads.
The first thing I discovered is that the current linux code is wrong
when there are guard pages. The comment above current_stack_region
in os_linux_{i486,amd64,x86}.cpp puts the guard page outside the
region reported by pthread_attr_getstack(), which is not the case.
It needs to use pthread_attr_getguardsize() and trim that many bytes
from the bottom of the region reported by pthread_attr_getstack().
For Java threads we don't set any glibc guardpages, but for natively attaching threads we assume that the glibc guardpage is outside the stack area as reported by pthread_attr_getstack and pthread_attr_getstacksize.
However it seems glibc doesn't read the POSIX specification in the same way:
https://bugzilla.redhat.com/show_bug.cgi?id=435337
as a result hotspot's guard pages may overlap the glibc guard pages on attached threads.
- relates to
-
JDK-7107135 Stack guard pages are no more protected after loading a shared library with executable stack
- Closed
-
JDK-8009302 Mac OS X: JVM crash on infinite recursion on Appkit Thread
- Closed
-
JDK-8169373 Work around linux NPTL stack guard error
- Resolved