JDK-8068184 : Fix for JDK-8032832 caused a deadlock
Type:Bug
Component:core-libs
Sub-Component:java.net
Affected Version:8u25,8u60
Priority:P2
Status:Closed
Resolution:Fixed
OS:generic
CPU:generic
Submitted:2014-12-23
Updated:2020-06-01
Resolved:2019-11-21
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.
Additional classloader synchronization introduced with JDK-8032832 caused a new deadlock in NetBeans.
Related NetBeans bug:
https://netbeans.org/bugzilla/show_bug.cgi?id=248308#c5
Comments
Fix Request (13u)
I would like to downport this for parity with 11. Applies clean.
26-03-2020
Fix Request (8u):
Please approve backporting this to jdk8u/jdk8u-dev for Oracle JDK feature parity. The patch applies as-is after path unshuffeling. Fails reproducer before. Passes after.
25-02-2020
Fix Request (11u)
I would like to downport this for parity with 11.0.7-oracle. Applies clean.
25-11-2019
A compatible with JDK 7 version of the test case was attached to the bug record as the file "JDKBug8068184ExampleForJDK7.zip". It is the original test case, but with all lambda expressions substituted for corresponding anonymous classes in order to let it be compiled and executed by JDK 7.
The attached test case "JDKBug8068184Example.zip" allows to reproduce the bug with JDK 14 compiled with the latest source code in "http://hg.openjdk.java.net/jdk/jdk" repository. Confirm that this bug is a regression of the fix for JDK-8032832.
This bug shows that locking on "java.lang.ClassLoader" objects is bad and error prone practice. The fix for the bug JDK-8032832 was addressing Java Plug-in specific deadlock. Support for Java Plug-in ended in March 2019. The only correct way to resolve this bug is to revert changes introduced by that fix.
21-11-2019
Attaching a standalone example to show the problem. Based on examples by phansson from various linked bugs.
31-10-2017
Chris, Anton, can the deadlock be fixed for the nearest JDK 8 update?