JDK-8176100 : [REDO][REDO] G1 Needs pre barrier on dereference of weak JNI handles
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2017-03-02
  • Updated: 2021-02-01
  • Resolved: 2017-03-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 8 JDK 9 Other
10Fixed 8u251Fixed 9 b164Fixed openjdk8u222Fixed
Related Reports
Cloners :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8176101 :  
Description
Mach 5 9-hs detected test failures due to this changeset:

Changeset: 3bc68ff68250
Author:    kbarrett
Date:      2017-02-15 22:19 -0500
URL: http://hg.openjdk.java.net/jdk9/hs/hotspot/rev/3bc68ff68250

8166188: G1 Needs pre barrier on dereference of weak JNI handles
Summary: Add low tag to jweaks and G1 barrier for jweak loads.
Reviewed-by: mgerdin, mdoerr, pliden, dlong, dcubed, coleenp, aph, tschatzl
Contributed-by: kim.barrett@oracle.com, martin.doerr@sap.com, volker.simonis@sap.com


which was pushed at 2028 PT/2128 MT/2328 ET so it did not make the 1900 PT
2017.02.15 nightly cutoff. Mach5's 14 test failures appear to all be in JDK
tests... Of course, we don't know if there will be additional failures in
JDK9-hs nightly testing.


So the good news: Mach5 detected this failure earlier than we would
have seen it with our normal HotSpot nightly! And with the email
notification to all of the folks involved, there has already been
eight follow-up messages (I don't count this one). 
Comments
Fix Request jdk8u Patch applies cleanly net of file names and line numbers, except for running the two new tests, for which jdk8 requires a shell script to run them. Review request posted on jdk8u-dev. Hotspot runtime jtreg tests pass.
12-04-2019

Bugs found by nightly testing. Verified by passed nightly.
26-07-2017

Fix approved.
22-03-2017

Fix Request This day-one bug in G1 has become more critical as usage of weak JNI handles has drastically increased since the reintroduction of the fix in JDK-8162795. This issue is suspected to be a duplicate of an issue that has impacted both WLS JDK 9 uptake (JDK-8176365) and has occurred in hotspot nightly testing in JDK-8176325. The fix adds a tag bit to all JNI weak handles (jweak), this is needed because G1 needs to detect when a weak reference is dereferenced but the jweak type is aliased to jobject so the type system is of no help to us. The tag bit needs to be stripped out and acted upon in several pieces of platform specific code. The risk of the fix is not negligible since it has in fact been backed out twice but the problems uncovered have been easy to fix. The fix comes with regression tests for the problematic cases we came up with. It has also been tested with HS tier 2-5 common+gc and has been reviewed by a large amount of people since this is the third iteration of the fix: mdoerr, pliden, dlong, dcubed, coleenp, aph, tschatzl (both mgerdin and kbarrett have worked on the fix in different iterations and have reviewed the changesets as well). A webrev of the fix is located at: http://cr.openjdk.java.net/~mgerdin/8176100/
20-03-2017

Is this actually a new issue? If it is caused by JDK-8162795 as suggested in JDK-8176325 the problem is already in jdk9/jdk9 so this would not be an integration blocker.
10-03-2017

Transferred integration_blocker and hs_nightly labels from duplicate bug.
10-03-2017

Oh, that's right!
10-03-2017