JDK-8300024 : Replace use of JNI_COMMIT mode with mode 0
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 8,11,17,21
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2023-01-12
  • Updated: 2023-01-12
Related Reports
Cloners :  
Relates :  
Description
In files:

src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.cpp
src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp
test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineRetransform/libRedefineRetransform.cpp

the JNI_COMMIT mode is used with ReleaseLongArrayElements / ReleaseByteArrayElements. This mode does not release memory allocated by the corresponding GetXXXArrayElements functions and creates a memory leak. This code should be using mode 0 to ensure the underlying array is freed.
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/11963 Date: 2023-01-12 09:23:49 +0000
12-01-2023