Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6675312

Linux glibc stack guard-pages can overlap with hotspot guard pages

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • 9
    • 7
    • hotspot
    • 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.

            dholmes David Holmes
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: