Details
-
Bug
-
Resolution: Fixed
-
P4
-
20
-
b04
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8292287 | 17.0.6-oracle | Harold Seigel | P4 | Resolved | Fixed | b01 |
JDK-8294798 | 17.0.6 | Goetz Lindenmaier | P4 | Resolved | Fixed | b01 |
Description
https://github.com/openjdk/jdk/blob/f3da7ff66e83a44118c090b7729dce858f0df1b1/test/hotspot/jtreg/runtime/cds/appcds/customLoader/test-classes/HelloUnload.java#L101
URLClassLoader urlClassLoader =
new URLClassLoader("HelloClassLoader", urls, null);
if (doUnload) {
String loaderName = urlClassLoader.getName();
int loadedRefcount = wb.getSymbolRefcount(loaderName);
System.out.println("Refcount of symbol " + loaderName + " is " + loadedRefcount);
...
int unloadedRefcount = wb.getSymbolRefcount(loaderName);
System.out.println("Refcount of symbol " + loaderName + " is " + unloadedRefcount);
// refcount of a permanent symbol will not be decremented
if (loadedRefcount != 65535) {
ClassUnloadCommon.failIf(unloadedRefcount != (loadedRefcount - 1), "Refcount must be decremented");
}
}
This portion of the test is copied from
https://github.com/openjdk/jdk/blob/f3da7ff66e83a44118c090b7729dce858f0df1b1/test/hotspot/jtreg/runtime/ClassUnload/UnloadTest.java#L65
which was introduced in
However, HelloUnload is archived, so the Symbol for the literal string "HelloClassLoader" is also archived, which means it will always have a refcount of 65535
Output:
class CustomLoadee
java.net.URLClassLoader@2b193f2d
Refcount of symbol HelloClassLoader is 65535
Is CustomLoadee alive? false
Refcount of symbol HelloClassLoader is 65535
Attachments
Issue Links
- backported by
-
JDK-8292287 CDS test HelloUnload.java should not use literal string as ClassLoader name
-
- Resolved
-
-
JDK-8294798 CDS test HelloUnload.java should not use literal string as ClassLoader name
-
- Resolved
-
- relates to
-
JDK-8289257 Some custom loader tests failed due to symbol refcount not decremented
-
- Resolved
-
-
JDK-8210559 ClassLoaderData Symbols can leak
-
- Resolved
-
- links to
-
Commit openjdk/jdk17u-dev/0464eaf9
-
Commit openjdk/jdk/e322e77e
-
Review openjdk/jdk17u-dev/744
-
Review openjdk/jdk/9297