hg: jdk6/jdk6/jdk: OPENJDK6-29: JDK fails to zero jdk_version_info correctly

Alex Bligh alex at alex.org.uk
Sat Mar 22 15:12:25 UTC 2014


Apologies for broken threading (wasn't subscribed) and possible newbie mistakes:

> Well, it depends how close the code is. Having looked at backporting it, I feel
> too much has changed to risk it.
> 
> We need an OPENJDK-6 bug for this that references the fact the change is in 6989466.
> 
> You can list me as a reviewer.

I think this bug is also present elsewhere in openjdk-6, specifically in the
jvm.

This bug as filed is OPENJDK6-29, per https://java.net/jira/browse/OPENJDK6-29

This at present is 'fixed' with hg changeset:
  http://hg.openjdk.java.net/jdk6/jdk6/jdk/rev/04e4c3ec6516
which fixes an incorrect memset in JDK_GetVersionInfo0

However, reading JDK-6989972 at
  https://bugs.openjdk.java.net/browse/JDK-6989972
I note there appears to be a similar issue in
  https://bugs.openjdk.java.net/browse/JDK-8035893
which fixes (in openjdk7) an incorrect memset in the JVM in JVM_GetVersionInfo.

The patch is at:
  http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/cd30121047ac

and looks like this (apologies for cut & paste diff), and I believe should be
backported for b31.

--- a/src/share/vm/prims/jvm.cpp	Fri Feb 28 14:30:25 2014 +0400
+++ b/src/share/vm/prims/jvm.cpp	Fri Feb 28 16:00:40 2014 +0400
@@ -4360,7 +4360,7 @@
 
 JVM_ENTRY(void, JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size))
 {
-  memset(info, 0, sizeof(info_size));
+  memset(info, 0, info_size);
 
   info->jvm_version = Abstract_VM_Version::jvm_version();
   info->update_version = 0;          /* 0 in HotSpot Express VM */

-- 
Alex Bligh








More information about the jdk6-dev mailing list