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

-Xcheck:jni should support checking of GetPrimitiveArrayCritical

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 6
    • hotspot
    • b22
    • sparc
    • solaris_9

        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.

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

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: