Repost: RFR (S) JDK-6311046: -Xcheck:jni should support checking of GetPrimitiveArrayCritical

Frederic Parain frederic.parain at oracle.com
Wed Jun 4 10:13:39 UTC 2014


Hi David,

Thank you for improving JNI safety.

  src/share/vm/prims/jni.cpp
	no comment

  src/share/vm/prims/jniCheck.cpp
         line 348, 1415 and 1486: the code checks
         both that guards have not been corrupted
         and the consistency of the tag word, but
         the error message seems to address only
         the tag word consistency check. Is is
         possible to have two distinct error
         messages here?

  src/share/vm/runtime/os.cpp
         Nice cleanup!
  	Why #include "memory/guardedMemory.hpp"
         is pushed down to line 527 instead of
         being at beginning of the file with
         other includes?

  src/share/vm/memory/guardedMemory.cpp
	no comment

  src/share/vm/memory/guardedMemory.hpp
	no comment

Regards,

Fred

On 15/05/2014 13:58, David Simms wrote:
> Gidday all:
>
> Bug/Enhancement: https://bugs.openjdk.java.net/browse/JDK-6311046
>
> Web review: http://cr.openjdk.java.net/~dsimms/6311046/rev4/
>
> Cleaned up the "hand rolled" memory bounds checking in
> os::malloc/realloc/free and type checking in checked JNI (GetString*),
> and unified into a single helper class "GuardedMemory". Added some extra
> checks to checked JNI (release mode).
>
> There is now some extra debugging support for free/release operations,
> GuardedMemory::release_for_freeing()" will now mark user bytes with
> "freeBlockPad", which did yield a result when testing.
>
> Testing Completed:
>
> Ran on all platforms:
>
>   * JPRT
>   * jteg jdk_core & jdk_svc
>   * "RT nightly".
>
>
> Cheers
> /David Simms

-- 
Frederic Parain - Oracle
Grenoble Engineering Center - France
Phone: +33 4 76 18 81 17
Email: Frederic.Parain at oracle.com


More information about the hotspot-runtime-dev mailing list