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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: 7
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      linux

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: