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

-Xcheck:jni should support checking of GetPrimitiveArrayCritical

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 6
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b22
    • CPU:
      sparc
    • OS:
      solaris_9

      Backports

        Description

        While debugging 6300721 I discovered that user code was walking off the end on a Java array being accessed using GetPrimitiveArrayCritical. Our implementation returns a pointer to the interior of the array so walking off the end stomps the java heap. It's permissible to return a copy and I think with -Xcheck:jni that's what we should do. We should return a chunk of memory with a guard region at each end and when ReleasePrimitiveArrayCritical is called the guard regions should be checked to see they are overwritten.
        We should also do this for Release/Get*ArrayElements. It would have been useful in diagnosing 6532325 as a JNI problem and not a JVM problem.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  dsimms David Simms
                  Reporter:
                  never Tom Rodriguez
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: