[OPENJDK6-29] JDK fails to zero jdk_version_info correctly Created: 26/Feb/14  Updated: 28/Jul/14  Resolved: 28/Jul/14

Status: Resolved
Project: openjdk6
Component/s: None
Affects Version/s: b28, b29, b30
Fix Version/s: b31

Type: Bug Priority: Major
Reporter: andrewdinn Assignee: andrewhaley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


Function JDK_GetVersionInfo0 is suppose to memset the incoming jdk_version_info struct, info, using the supplied size_t value, info_size, as the byte count. The current code calls

memset(info, 0, sizeof(info_size));

i.e. it only zeroes 8 bytes. It should be

memset(info, 0, info_size);

This can cause mayhem in the JVM because the flag fields at the end of the struct end up taking values determined by the contents of the stack frame where info is allocated. In particular, it can cause the post-jdk6-b28 GC to enqueue discovered References using the wrong link field which means that no reference processing (including finalization) occurs.

Comment by andrewdinn [ 26/Feb/14 ]

n.b. the hotspot GC change set which this bug runs afoul of is the fix with id 6989466

Comment by gnu_andrew [ 26/Feb/14 ]

6989466 is the JDK changeset in 7 which also contains this same fix and the reason why this issue is only seen with hs23 on 6.

Comment by gnu_andrew [ 26/Feb/14 ]

b31 is the next release.

Comment by omajid [ 02/Apr/14 ]

The (proprietary) JDK 6 bug was: https://bugs.openjdk.java.net/browse/JDK-6989972

That bug contains the exact same patch.

Comment by gnu_andrew [ 28/Jul/14 ]

Fixed in http://hg.openjdk.java.net/jdk6/jdk6/jdk/rev/04e4c3ec6516

Generated at Mon Oct 24 05:09:34 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.