mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-22 16:26:05 +00:00
8210300: runtime/MemberName/MemberNameLeak.java fails with RuntimeException
Added flag -XX:+UnlockDiagnosticVMOptions to tests failing in product builds Reviewed-by: dcubed, dholmes
This commit is contained in:
parent
fe326ad022
commit
891765ee5e
@ -45,6 +45,7 @@ public class CleanProtectionDomain {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-Xlog:protectiondomain+table=debug",
|
||||
"--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
|
||||
"-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:+WhiteBoxAPI",
|
||||
"-Xbootclasspath/a:.",
|
||||
Test.class.getName());
|
||||
@ -70,13 +71,20 @@ public class CleanProtectionDomain {
|
||||
|
||||
test();
|
||||
|
||||
System.gc();
|
||||
// Wait until ServiceThread cleans ProtectionDomain table.
|
||||
// When the TestClassLoader is unloaded by GC, at least one
|
||||
// ProtectionDomainCacheEntry will be eligible for removal.
|
||||
do {
|
||||
removedCount = wb.protectionDomainRemovedCount();
|
||||
} while (removedCountOrig == removedCount);
|
||||
int cnt = 0;
|
||||
while (true) {
|
||||
if (cnt++ % 30 == 0) {
|
||||
System.gc();
|
||||
}
|
||||
removedCount = wb.resolvedMethodRemovedCount();
|
||||
if (removedCountOrig != removedCount) {
|
||||
break;
|
||||
}
|
||||
Thread.sleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
private static class TestClassLoader extends ClassLoader {
|
||||
|
||||
@ -56,19 +56,26 @@ public class MemberNameLeak {
|
||||
mh.invokeExact(leak);
|
||||
}
|
||||
|
||||
System.gc(); // make mh unused
|
||||
|
||||
// Wait until ServiceThread cleans ResolvedMethod table
|
||||
do {
|
||||
int cnt = 0;
|
||||
while (true) {
|
||||
if (cnt++ % 30 == 0) {
|
||||
System.gc(); // make mh unused
|
||||
}
|
||||
removedCount = wb.resolvedMethodRemovedCount();
|
||||
} while (removedCountOrig == removedCount);
|
||||
if (removedCountOrig != removedCount) {
|
||||
break;
|
||||
}
|
||||
Thread.sleep(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void test(String gc) throws Throwable {
|
||||
// Run this Leak class with logging
|
||||
// Run this Leak class with logging
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-Xlog:membername+table=trace",
|
||||
"-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:+WhiteBoxAPI",
|
||||
"-Xbootclasspath/a:.",
|
||||
gc, Leak.class.getName());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user