Merge branch 'master' into 20.03-LTS-NEXT

This commit is contained in:
jvmboy 2020-12-29 16:15:31 +08:00
commit 07d9ab5424
9 changed files with 6927 additions and 2 deletions

View File

@ -0,0 +1,115 @@
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
index eecd6807..11b24341 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
@@ -461,11 +461,11 @@ public class ClassWriter extends ClassFile {
poolbuf.appendChar(pool.put(names.fromString((String)value)));
} else if (value instanceof UniqueType) {
Type type = ((UniqueType)value).type;
- if (type instanceof MethodType) {
+ if (type.hasTag(METHOD)) {
poolbuf.appendByte(CONSTANT_MethodType);
poolbuf.appendChar(pool.put(typeSig((MethodType)type)));
} else {
- if (type.hasTag(CLASS)) enterInner((ClassSymbol)type.tsym);
+ Assert.check(type.hasTag(ARRAY));
poolbuf.appendByte(CONSTANT_Class);
poolbuf.appendChar(pool.put(xClassName(type)));
}
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java
index 4389d08b..f87c1053 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java
@@ -28,6 +28,7 @@ package com.sun.tools.javac.jvm;
import com.sun.tools.javac.code.Kinds;
import com.sun.tools.javac.code.Symbol;
import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.code.TypeTag;
import com.sun.tools.javac.code.Type;
import com.sun.tools.javac.code.Types;
import com.sun.tools.javac.code.Types.UniqueType;
@@ -126,7 +127,14 @@ public class Pool {
} else if (o instanceof VarSymbol) {
return new Variable((VarSymbol)o, types);
} else if (o instanceof Type) {
- return new UniqueType((Type)o, types);
+ Type t = (Type)o;
+ // ClassRefs can come from ClassSymbols or from Types.
+ // Return the symbol for these types to avoid duplicates
+ // in the constant pool
+ if (t.hasTag(TypeTag.CLASS))
+ return t.tsym;
+ else
+ return new UniqueType(t, types);
} else {
return o;
}
diff --git a/langtools/test/tools/javac/jvm/ClassRefDupInConstantPoolTest.java b/langtools/test/tools/javac/jvm/ClassRefDupInConstantPoolTest.java
new file mode 100644
index 00000000..98c7cf8d
--- /dev/null
+++ b/langtools/test/tools/javac/jvm/ClassRefDupInConstantPoolTest.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8015927
+ * @summary Class reference duplicates in constant pool
+ * @clean ClassRefDupInConstantPoolTest$Duplicates.class
+ * @run main ClassRefDupInConstantPoolTest
+ */
+
+import java.util.TreeSet;
+
+import com.sun.tools.classfile.*;
+import com.sun.tools.classfile.ConstantPool.*;
+
+public class ClassRefDupInConstantPoolTest {
+ public static void main(String[] args) throws Exception {
+ ClassFile cls = ClassFile.read(ClassRefDupInConstantPoolTest.class.
+ getResourceAsStream("ClassRefDupInConstantPoolTest$Duplicates.class"));
+ ConstantPool pool = cls.constant_pool;
+
+ int duplicates = 0;
+ TreeSet<Integer> set = new TreeSet<>();
+ for (CPInfo i : pool.entries()) {
+ if (i.getTag() == ConstantPool.CONSTANT_Class) {
+ CONSTANT_Class_info ci = (CONSTANT_Class_info)i;
+ if (!set.add(ci.name_index)) {
+ duplicates++;
+ System.out.println("DUPLICATE CLASS REF " + ci.getName());
+ }
+ }
+ }
+ if (duplicates > 0)
+ throw new Exception("Test Failed");
+ }
+
+ class Duplicates {
+ String concat(String s1, String s2) {
+ return s1 + (s2 == s1 ? " " : s2);
+ }
+ }
+}

View File

@ -0,0 +1,91 @@
diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
index c481ea5d..f1f92b6a 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
@@ -297,6 +297,29 @@ public class TypeAnnotationPosition {
isValidOffset = true;
}
+ public boolean hasCatchType() {
+ return exception_index < 0 && exception_index != Integer.MIN_VALUE;
+ }
+
+ public int getCatchType() {
+ Assert.check(hasCatchType(),
+ "exception_index does not contain valid catch info");
+ return ((-this.exception_index) - 1) & 0xff ;
+ }
+
+ public int getStartPos() {
+ Assert.check(hasCatchType(),
+ "exception_index does not contain valid catch info");
+ return ((-this.exception_index) - 1) >> 8;
+ }
+
+ public void setCatchInfo(final int catchType, final int startPos) {
+ Assert.check(this.exception_index < 0,
+ "exception_index already contains a bytecode index");
+ Assert.check(catchType >= 0, "Expected a valid catch type");
+ this.exception_index = -((catchType | startPos << 8) + 1);
+ }
+
/**
* Decode the binary representation for a type path and set
* the {@code location} field.
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java
index 738c5a1d..622a5942 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java
@@ -2135,14 +2135,16 @@ public class Code {
// same location; updating one is enough.
// Use -666 as a marker that the exception_index was already updated.
if (p.type_index != -666) {
- p.exception_index = findExceptionIndex(p.type_index);
+ p.exception_index = findExceptionIndex(p);
p.type_index = -666;
}
}
}
}
- private int findExceptionIndex(int catchType) {
+ private int findExceptionIndex(TypeAnnotationPosition p) {
+ final int catchType = p.getCatchType();
+ final int startPos = p.getStartPos();
if (catchType == Integer.MIN_VALUE) {
// We didn't set the catch type index correctly.
// This shouldn't happen.
@@ -2154,8 +2156,9 @@ public class Code {
for (int i = 0; i < len; ++i) {
char[] catchEntry = iter.head;
iter = iter.tail;
- char ct = catchEntry[3];
- if (catchType == ct) {
+ int ct = catchEntry[3];
+ int sp = catchEntry[0];
+ if (catchType == ct && sp == startPos) {
return i;
}
}
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
index 4cc7fb7b..f79d3eee 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
@@ -1609,7 +1609,7 @@ public class Gen extends JCTree.Visitor {
if (subCatch.type.isAnnotated()) {
for (Attribute.TypeCompound tc :
subCatch.type.getAnnotationMirrors()) {
- tc.position.type_index = catchType;
+ tc.position.setCatchInfo(catchType, startpc);
}
}
}
@@ -1626,7 +1626,7 @@ public class Gen extends JCTree.Visitor {
if (subCatch.type.isAnnotated()) {
for (Attribute.TypeCompound tc :
subCatch.type.getAnnotationMirrors()) {
- tc.position.type_index = catchType;
+ tc.position.setCatchInfo(catchType, startpc);
}
}
}

View File

@ -0,0 +1,165 @@
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
index 40248923..637d83b2 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
@@ -2051,6 +2051,9 @@ public class ClassReader {
}
private List<Type> adjustMethodParams(long flags, List<Type> args) {
+ if (args.isEmpty()) {
+ return args;
+ }
boolean isVarargs = (flags & VARARGS) != 0;
if (isVarargs) {
Type varargsElem = args.last();
diff --git a/langtools/test/tools/javac/AvoidNPEAtClassReader/AvoidNPEAtClassReaderTest.java b/langtools/test/tools/javac/AvoidNPEAtClassReader/AvoidNPEAtClassReaderTest.java
new file mode 100644
index 00000000..3b47d694
--- /dev/null
+++ b/langtools/test/tools/javac/AvoidNPEAtClassReader/AvoidNPEAtClassReaderTest.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8207160
+ * @summary ClassReader::adjustMethodParams can potentially return null if the args list is empty
+ * @compile pkg/Outer.jasm pkg/Outer$Inner.jasm AvoidNPEAtClassReaderTest.java
+ */
+
+
+/** this test is checking that javac doesn't fail with NPE when reading inner classes with constructors
+ * that doesn't have as a parameter a reference to the outer class. Such constructors were generated by
+ * versions of javac previous to JDK7.
+ */
+
+import pkg.*;
+
+public class AvoidNPEAtClassReaderTest {
+ public void bar(Outer outer) {
+ Object stuff = outer.foo();
+ }
+}
diff --git a/langtools/test/tools/javac/AvoidNPEAtClassReader/pkg/Outer$Inner.jasm b/langtools/test/tools/javac/AvoidNPEAtClassReader/pkg/Outer$Inner.jasm
new file mode 100644
index 00000000..d3ee1331
--- /dev/null
+++ b/langtools/test/tools/javac/AvoidNPEAtClassReader/pkg/Outer$Inner.jasm
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+super public final class Outer$Inner
+ version 52:0
+{
+
+final synthetic Field this$0:"Lpkg/Outer;";
+
+public Method "<init>":"()V"
+ stack 1 locals 1
+{
+ aload_0;
+ invokespecial Method java/lang/Object."<init>":"()V";
+ return;
+}
+
+public final InnerClass Inner=class Outer$Inner of class Outer;
+
+} // end Class Outer$Inner
diff --git a/langtools/test/tools/javac/AvoidNPEAtClassReader/pkg/Outer.jasm b/langtools/test/tools/javac/AvoidNPEAtClassReader/pkg/Outer.jasm
new file mode 100644
index 00000000..29239b13
--- /dev/null
+++ b/langtools/test/tools/javac/AvoidNPEAtClassReader/pkg/Outer.jasm
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+super public class Outer
+ version 52:0
+{
+
+
+public Method "<init>":"()V"
+ stack 1 locals 1
+{
+ aload_0;
+ invokespecial Method java/lang/Object."<init>":"()V";
+ return;
+}
+
+public Method foo:"()Lpkg/Outer$Inner;"
+ stack 1 locals 1
+{
+ aconst_null;
+ areturn;
+}
+
+public final InnerClass Inner=class Outer$Inner of class Outer;
+
+} // end Class Outer

View File

@ -112,7 +112,7 @@ index 000000000..d4c93b390
+++ b/hotspot/test/compiler/c2/TestReplaceEquivPhis.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2020, Huawei Technologies Co. Ltd. All rights reserved.
+ * Copyright (c) 2020, Huawei Technologies Co., LTD. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it

2121
G1-memory-uncommit.patch Executable file

File diff suppressed because it is too large Load Diff

461
add-appcds-file-lock.patch Executable file
View File

@ -0,0 +1,461 @@
diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp
index f27d04d0..306315e9 100644
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp
@@ -4022,8 +4022,12 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
if (_host_klass == NULL && SystemDictionaryShared::is_sharing_possible(loader_data)) {
if (name != NULL) {
ResourceMark rm(THREAD);
- classlist_file->print_cr("%s", name->as_C_string());
- classlist_file->flush();
+ char *class_name = name->as_C_string();
+ // TODO Skip JFR-related classes in classlist file to avoid conflicts between appcds and jfr.
+ if ((class_name != NULL) && (strstr(class_name, "jfr") == NULL)) {
+ classlist_file->print_cr("%s", class_name);
+ classlist_file->flush();
+ }
}
}
}
diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp
index d27bf484..3f28d38e 100644
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp
@@ -1283,41 +1283,43 @@ instanceKlassHandle SystemDictionary::load_shared_class(
// null) or the same class loader is used to load previously
// defined class
bool bFound = false;
- if (class_loader.is_null()) {
- // condition1: Bootstrap class loader loaded
- bFound = (ik()->class_loader_data() == NULL || ik()->class_loader_data()->is_the_null_class_loader_data());
- } else if (ik()->class_loader_data() != NULL) {
- // condition2: App Class Loader
- // condition3: ExtClass Loader
- // Condition4: not fake class Loader, real one
- bFound = ((ik->has_fake_loader_data_App() && SystemDictionary::is_app_class_loader(class_loader)) ||
- (ik->has_fake_loader_data_Ext() && SystemDictionary::is_ext_class_loader(class_loader)) ||
- (!ik->has_fake_loader_data() && ik()->class_loader() == class_loader()));
- }
- if (!bFound) {
- return instanceKlassHandle();
- }
+ if (class_loader.is_null()) {
+ // condition1: Bootstrap class loader loaded
+ bFound = (ik()->class_loader_data() == NULL || ik()->class_loader_data()->is_the_null_class_loader_data());
+ } else if (ik()->class_loader_data() != NULL) {
+ // condition2: App Class Loader
+ // condition3: ExtClass Loader
+ // condition4: not fake class Loader, real one
+ bFound = ((ik->has_fake_loader_data_App() && SystemDictionary::is_app_class_loader(class_loader)) ||
+ (ik->has_fake_loader_data_Ext() && SystemDictionary::is_ext_class_loader(class_loader)) ||
+ (!ik->has_fake_loader_data() && ik()->class_loader() == class_loader()));
+ }
+ if (!bFound) {
+ return instanceKlassHandle();
+ }
- // get protection domain for this class if not loaded by null class loader
- if (class_loader.not_null()) {
- ResourceMark rm(THREAD);
- char* name = ik->name()->as_C_string();
- Handle klass_name = java_lang_String::create_from_str(name, CHECK_0);
- JavaValue result(T_OBJECT);
-
- // ClassLoaderData* loader_data = ClassLoaderData::class_loader_data(class_loader());
- JavaCalls::call_virtual(&result,
- class_loader,
- KlassHandle(THREAD, SystemDictionary::URLClassLoader_klass()),
- vmSymbols::getProtectionDomainInternal_name(),
- vmSymbols::getProtectionDomainInternal_signature(),
- klass_name,
- THREAD);
- return load_shared_class(ik, class_loader, Handle(THREAD, (oop) result.get_jobject()), THREAD);
- } else {
- return load_shared_class(ik, class_loader, Handle(), THREAD);
- }
+ // get protection domain for this class if not loaded by null class loader
+ if (class_loader.not_null()) {
+ ResourceMark rm(THREAD);
+ char* name = ik->name()->as_C_string();
+ Handle klass_name = java_lang_String::create_from_str(name, CHECK_0);
+ JavaValue result(T_OBJECT);
+
+ // load_shared_class need protected domain to handle non-bootstrap loaded class,
+ // so here call_virtual to call getProtectionDomainInternal function of URLClassLoader.java,
+ // to get protected domain and save into result.
+ JavaCalls::call_virtual(&result,
+ class_loader,
+ KlassHandle(THREAD, SystemDictionary::URLClassLoader_klass()),
+ vmSymbols::getProtectionDomainInternal_name(),
+ vmSymbols::getProtectionDomainInternal_signature(),
+ klass_name,
+ THREAD);
+ return load_shared_class(ik, class_loader, Handle(THREAD, (oop) result.get_jobject()), THREAD);
+ } else {
+ return load_shared_class(ik, class_loader, Handle(), THREAD);
}
+ }
}
return instanceKlassHandle();
}
@@ -1396,8 +1398,12 @@ instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik,
// unless AppCDS is enabled
if (SystemDictionaryShared::is_sharing_possible(loader_data)) {
ResourceMark rm(THREAD);
- classlist_file->print_cr("%s", ik->name()->as_C_string());
- classlist_file->flush();
+ char *class_name = ik->name()->as_C_string();
+ // TODO Skip JFR-related classes in classlist file to avoid conflicts between appcds and jfr.
+ if ((class_name != NULL) && (strstr(class_name, "jfr") == NULL)) {
+ classlist_file->print_cr("%s", class_name);
+ classlist_file->flush();
+ }
}
}
@@ -1472,8 +1478,10 @@ instanceKlassHandle SystemDictionary::load_instance_class(Symbol* class_name, Ha
// the call stack. Bootstrap classloader is parallel-capable,
// so no concurrency issues are expected.
CLEAR_PENDING_EXCEPTION;
- k = JfrUpcalls::load_event_handler_proxy_class(THREAD);
- assert(!k.is_null(), "invariant");
+ if (!DumpSharedSpaces) {
+ k = JfrUpcalls::load_event_handler_proxy_class(THREAD);
+ assert(!k.is_null(), "invariant");
+ }
}
#endif
diff --git a/hotspot/src/share/vm/classfile/systemDictionaryShared.hpp b/hotspot/src/share/vm/classfile/systemDictionaryShared.hpp
index a8dbda2e..1bd61b02 100644
--- a/hotspot/src/share/vm/classfile/systemDictionaryShared.hpp
+++ b/hotspot/src/share/vm/classfile/systemDictionaryShared.hpp
@@ -28,6 +28,7 @@
#include "classfile/dictionary.hpp"
#include "classfile/systemDictionary.hpp"
+#include "verifier.hpp"
class SystemDictionaryShared: public SystemDictionary {
public:
@@ -70,7 +71,16 @@ public:
static void finalize_verification_dependencies() {}
static bool check_verification_dependencies(Klass* k, Handle class_loader,
Handle protection_domain,
- char** message_buffer, TRAPS) {return true;}
+ char** message_buffer, TRAPS) {
+ if (EnableSplitVerifierForAppCDS) {
+ ClassVerifier split_verifier(k, THREAD);
+ split_verifier.verify_class(THREAD);
+ if (HAS_PENDING_EXCEPTION) {
+ return false; // use the existing exception
+ }
+ }
+ return true;
+ }
};
#endif // SHARE_VM_CLASSFILE_SYSTEMDICTIONARYSHARED_HPP
diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp
index 9923058b..eb267b83 100644
--- a/hotspot/src/share/vm/classfile/verifier.cpp
+++ b/hotspot/src/share/vm/classfile/verifier.cpp
@@ -561,7 +561,8 @@ void ClassVerifier::verify_class(TRAPS) {
for (int index = 0; index < num_methods; index++) {
// Check for recursive re-verification before each method.
- if (was_recursively_verified()) return;
+ // in CDS Sharing state we still verify the code.
+ if (!UseAppCDS && was_recursively_verified()) return;
Method* m = methods->at(index);
if (m->is_native() || m->is_abstract() || m->is_overpass()) {
diff --git a/hotspot/src/share/vm/memory/filemap.cpp b/hotspot/src/share/vm/memory/filemap.cpp
index 17447587..d2095e63 100644
--- a/hotspot/src/share/vm/memory/filemap.cpp
+++ b/hotspot/src/share/vm/memory/filemap.cpp
@@ -22,6 +22,7 @@
*
*/
+#include "jvm.h"
#include "precompiled.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/sharedClassUtil.hpp"
@@ -33,10 +34,13 @@
#include "memory/oopFactory.hpp"
#include "oops/objArrayOop.hpp"
#include "runtime/arguments.hpp"
+#include "runtime/globals.hpp"
#include "runtime/java.hpp"
#include "runtime/os.hpp"
#include "services/memTracker.hpp"
+#include "utilities/debug.hpp"
#include "utilities/defaultStream.hpp"
+#include "utilities/ostream.hpp"
# include <sys/stat.h>
# include <errno.h>
@@ -362,11 +366,33 @@ bool FileMapInfo::open_for_read() {
return true;
}
-
// Write the FileMapInfo information to the file.
-
void FileMapInfo::open_for_write() {
- _full_path = make_log_name(Arguments::GetSharedArchivePath(), NULL);
+ if (UseAppCDS && AppCDSLockFile != NULL) {
+ char* pos = strrchr(const_cast<char*>(AppCDSLockFile), '/');
+ if (pos != NULL && pos != AppCDSLockFile) { // No directory path specified
+ char buf[PATH_MAX + 1] = "\0";
+ char filePath[PATH_MAX] = "\0";
+ int length = pos - AppCDSLockFile + 1;
+ strncpy(filePath, AppCDSLockFile, length);
+ if (realpath(filePath, buf) == NULL) {
+ fail_stop("A risky filePath:%s, buf:%s, length:%d", filePath, buf, length);
+ }
+ _appcds_file_lock_path = os::strdup(AppCDSLockFile, mtInternal);
+ if (_appcds_file_lock_path == NULL) {
+ fail_stop("Failed to create appcds file lock.");
+ }
+ int lock_fd = open(_appcds_file_lock_path, O_CREAT | O_WRONLY | O_EXCL, S_IRUSR | S_IWUSR);
+ if (lock_fd < 0) {
+ tty->print_cr("The lock path is: %s", _appcds_file_lock_path);
+ tty->print_cr("Failed to create jsa file !\n Please check: \n 1. The directory exists.\n "
+ "2. You have the permission.\n 3. Make sure no other process using the same lock file.\n");
+ JVM_Exit(0);
+ }
+ tty->print_cr("You are using file lock %s in concurrent mode", AppCDSLockFile);
+ }
+ }
+ _full_path = make_log_name(Arguments::GetSharedArchivePath(), NULL);
if (PrintSharedSpaces) {
tty->print_cr("Dumping shared data to file: ");
tty->print_cr(" %s", _full_path);
@@ -452,6 +478,7 @@ void FileMapInfo::write_bytes(const void* buffer, int nbytes) {
// close and remove the file. See bug 6372906.
close();
remove(_full_path);
+ remove(_appcds_file_lock_path);
fail_stop("Unable to write to shared archive file.", NULL);
}
}
@@ -492,6 +519,10 @@ void FileMapInfo::write_bytes_aligned(const void* buffer, int nbytes) {
// Close the shared archive file. This does NOT unmap mapped regions.
void FileMapInfo::close() {
+ if (UseAppCDS && AppCDSLockFile != NULL) {
+ // delete appcds.lock
+ remove(_appcds_file_lock_path);
+ }
if (_file_open) {
if (::close(_fd) < 0) {
fail_stop("Unable to close the shared archive file.");
diff --git a/hotspot/src/share/vm/memory/filemap.hpp b/hotspot/src/share/vm/memory/filemap.hpp
index acff6c9d..c09fbca1 100644
--- a/hotspot/src/share/vm/memory/filemap.hpp
+++ b/hotspot/src/share/vm/memory/filemap.hpp
@@ -143,6 +143,7 @@ public:
FileMapHeader * _header;
const char* _full_path;
+ const char* _appcds_file_lock_path;
char* _paths_misc_info;
static FileMapInfo* _current_info;
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
index 073c38ac..ebb5e114 100644
--- a/hotspot/src/share/vm/runtime/arguments.cpp
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
@@ -36,6 +36,7 @@
#include "prims/jvmtiExport.hpp"
#include "runtime/arguments.hpp"
#include "runtime/arguments_ext.hpp"
+#include "runtime/globals.hpp"
#include "runtime/globals_extension.hpp"
#include "runtime/java.hpp"
#include "services/management.hpp"
@@ -1493,7 +1494,6 @@ void Arguments::set_use_compressed_oops() {
// the only value that can override MaxHeapSize if we are
// to use UseCompressedOops is InitialHeapSize.
size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize);
-
if (max_heap_size <= max_heap_for_compressed_oops()) {
#if !defined(COMPILER1) || defined(TIERED)
if (FLAG_IS_DEFAULT(UseCompressedOops)) {
@@ -3023,9 +3023,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
if (!process_argument("+UseAppCDS", args->ignoreUnrecognized, origin)) {
return JNI_EINVAL;
} else {
- const char* n = "SharedArchiveFile";
- Flag* shared_archive_flag = Flag::find_flag(n, strlen(n), true, true);
- shared_archive_flag->unlock_diagnostic();
FLAG_SET_CMDLINE(bool, UseAppCDS, true);
}
}
@@ -3382,6 +3379,9 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
} else if (match_option(option, "-Xshare:off", &tail)) {
FLAG_SET_CMDLINE(bool, UseSharedSpaces, false);
FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false);
+ // -Xtypecheck
+ } else if (match_option(option, "-Xtypecheck:on", &tail)) {
+ FLAG_SET_CMDLINE(bool, EnableSplitVerifierForAppCDS, true);
// -Xverify
} else if (match_option(option, "-Xverify", &tail)) {
if (strcmp(tail, ":all") == 0 || strcmp(tail, "") == 0) {
@@ -3632,7 +3632,10 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true);
FLAG_SET_CMDLINE(bool, TraceClassPaths, true);
}
-
+ if (DumpSharedSpaces && !UseAppCDS && AppCDSLockFile != NULL) {
+ jio_fprintf(defaultStream::error_stream(), "AppCDSLockFile is only used when AppCDS is enabled.");
+ return JNI_ERR;
+ }
// Change the default value for flags which have different default values
// when working with older JDKs.
#ifdef LINUX
@@ -4057,6 +4060,7 @@ static char* get_shared_archive_path() {
return shared_archive_path;
}
+
#ifndef PRODUCT
// Determine whether LogVMOutput should be implicitly turned on.
static bool use_vm_log() {
@@ -4199,6 +4203,7 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
return JNI_ENOMEM;
}
+
// Set up VerifySharedSpaces
if (FLAG_IS_DEFAULT(VerifySharedSpaces) && SharedArchiveFile != NULL) {
VerifySharedSpaces = true;
diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp
index 6f7ff138..03f293e3 100644
--- a/hotspot/src/share/vm/runtime/arguments.hpp
+++ b/hotspot/src/share/vm/runtime/arguments.hpp
@@ -473,6 +473,7 @@ class Arguments : AllStatic {
static bool CheckCompileOnly;
static char* SharedArchivePath;
+ static char* AppCDSLockPath;
public:
// Parses the arguments, first phase
diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp
index 65b11caa..b72efd45 100644
--- a/hotspot/src/share/vm/runtime/globals.hpp
+++ b/hotspot/src/share/vm/runtime/globals.hpp
@@ -4007,15 +4007,21 @@ class CommandLineFlags {
product(ccstr, SharedClassListFile, NULL, \
"Override the default CDS class list") \
\
- diagnostic(ccstr, SharedArchiveFile, NULL, \
+ product(ccstr, SharedArchiveFile, NULL, \
"Override the default location of the CDS archive file") \
\
+ product(ccstr, AppCDSLockFile, NULL, \
+ "Override the default location of the AppCDS lock file") \
+ \
product(ccstr, ExtraSharedClassListFile, NULL, \
"Extra classlist for building the CDS archive file") \
\
product(bool, UseAppCDS, false, \
"Enable Application Class Data Sharing (AppCDS)") \
\
+ product(bool, EnableSplitVerifierForAppCDS, false, \
+ "Enable Type Check (AppCDS)") \
+ \
experimental(uintx, ArrayAllocatorMallocLimit, \
SOLARIS_ONLY(64*K) NOT_SOLARIS(max_uintx), \
"Allocation less than this value will be allocated " \
diff --git a/hotspot/src/share/vm/utilities/ostream.cpp b/hotspot/src/share/vm/utilities/ostream.cpp
index 2b458fe4..587b839b 100644
--- a/hotspot/src/share/vm/utilities/ostream.cpp
+++ b/hotspot/src/share/vm/utilities/ostream.cpp
@@ -34,6 +34,9 @@
#include "utilities/ostream.hpp"
#include "utilities/top.hpp"
#include "utilities/xmlstream.hpp"
+
+# include <sys/file.h>
+
#ifdef TARGET_OS_FAMILY_linux
# include "os_linux.inline.hpp"
#endif
@@ -376,7 +379,7 @@ stringStream::~stringStream() {}
xmlStream* xtty;
outputStream* tty;
outputStream* gclog_or_tty;
-CDS_ONLY(fileStream* classlist_file;) // Only dump the classes that can be stored into the CDS archive
+CDS_ONLY(jsaFileStream* classlist_file;) // Only dump the classes that can be stored into the CDS archive
extern Mutex* tty_lock;
#define EXTRACHARLEN 32
@@ -760,6 +763,36 @@ void fileStream::flush() {
fflush(_file);
}
+jsaFileStream::jsaFileStream(const char* file_name) : fileStream(file_name, "a") {
+ if (_file != NULL) {
+ if (flock(fileno(_file), LOCK_EX | LOCK_NB) != 0) {
+ if (errno == EWOULDBLOCK) {
+ warning("file %s is locked by another process\n", file_name);
+ } else {
+ warning("Cannot lock file %s due to %s\n", file_name, strerror(errno));
+ }
+ fclose(_file);
+ _file = NULL;
+ _need_close = false;
+ } else {
+ if (::ftruncate(fileno(_file), 0) != 0) {
+ warning("Fail to ftruncate file %s due to %s\n", file_name, strerror(errno));
+ }
+ ::rewind(_file);
+ }
+ }
+}
+
+jsaFileStream::~jsaFileStream() {
+ // flock is released automatically when _file is closed
+ // Ensure the following sequnce in fclose
+ // 1. fflush. 2. flock(unlock); 3. close
+ if (_file != NULL) {
+ if (_need_close) fclose(_file);
+ _file = NULL;
+ }
+}
+
fdStream::fdStream(const char* file_name) {
_fd = open(file_name, O_WRONLY | O_CREAT | O_TRUNC, 0666);
_need_close = true;
@@ -1362,7 +1395,7 @@ void ostream_init_log() {
if (DumpLoadedClassList != NULL) {
const char* list_name = make_log_name(DumpLoadedClassList, NULL);
classlist_file = new(ResourceObj::C_HEAP, mtInternal)
- fileStream(list_name);
+ jsaFileStream(list_name);
FREE_C_HEAP_ARRAY(char, list_name, mtInternal);
}
#endif
diff --git a/hotspot/src/share/vm/utilities/ostream.hpp b/hotspot/src/share/vm/utilities/ostream.hpp
index 530c523c..c69289fb 100644
--- a/hotspot/src/share/vm/utilities/ostream.hpp
+++ b/hotspot/src/share/vm/utilities/ostream.hpp
@@ -214,7 +214,13 @@ class fileStream : public outputStream {
void flush();
};
-CDS_ONLY(extern fileStream* classlist_file;)
+class jsaFileStream : public fileStream {
+ public:
+ jsaFileStream(const char* file_name);
+ ~jsaFileStream();
+};
+
+CDS_ONLY(extern jsaFileStream* classlist_file;)
// unlike fileStream, fdStream does unbuffered I/O by calling
// open() and write() directly. It is async-safe, but output

3720
add-appcds-test-case.patch Executable file

File diff suppressed because it is too large Load Diff

217
delete-untrustworthy-cacert.patch Executable file
View File

@ -0,0 +1,217 @@
diff --git a/jdk/make/data/cacerts/addtrustexternalca b/jdk/make/data/cacerts/addtrustexternalca
deleted file mode 100644
index ad84cad9..00000000
--- a/jdk/make/data/cacerts/addtrustexternalca
+++ /dev/null
@@ -1,32 +0,0 @@
-Owner: CN=AddTrust External CA Root, OU=AddTrust External TTP Network, O=AddTrust AB, C=SE
-Issuer: CN=AddTrust External CA Root, OU=AddTrust External TTP Network, O=AddTrust AB, C=SE
-Serial number: 1
-Valid from: Tue May 30 10:48:38 GMT 2000 until: Sat May 30 10:48:38 GMT 2020
-Signature algorithm name: SHA1withRSA
-Subject Public Key Algorithm: 2048-bit RSA key
-Version: 3
------BEGIN CERTIFICATE-----
-MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
-MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
-IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
-MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
-FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
-bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
-dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
-H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
-uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
-mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
-a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
-E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
-WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
-VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
-Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
-cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
-IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
-AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
-YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
-6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
-Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
-c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
-mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
------END CERTIFICATE-----
diff --git a/jdk/make/data/cacerts/addtrustqualifiedca b/jdk/make/data/cacerts/addtrustqualifiedca
deleted file mode 100644
index 0c62d44c..00000000
--- a/jdk/make/data/cacerts/addtrustqualifiedca
+++ /dev/null
@@ -1,32 +0,0 @@
-Owner: CN=AddTrust Qualified CA Root, OU=AddTrust TTP Network, O=AddTrust AB, C=SE
-Issuer: CN=AddTrust Qualified CA Root, OU=AddTrust TTP Network, O=AddTrust AB, C=SE
-Serial number: 1
-Valid from: Tue May 30 10:44:50 GMT 2000 until: Sat May 30 10:44:50 GMT 2020
-Signature algorithm name: SHA1withRSA
-Subject Public Key Algorithm: 2048-bit RSA key
-Version: 3
------BEGIN CERTIFICATE-----
-MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEU
-MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3
-b3JrMSMwIQYDVQQDExpBZGRUcnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1
-MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcxCzAJBgNVBAYTAlNFMRQwEgYDVQQK
-EwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIzAh
-BgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG9w0B
-AQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwq
-xBb/4Oxx64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G
-87B4pfYOQnrjfxvM0PC3KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i
-2O+tCBGaKZnhqkRFmhJePp1tUvznoD1oL/BLcHwTOK28FSXx1s6rosAx1i+f4P8U
-WfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GRwVY18BTcZTYJbqukB8c1
-0cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HUMIHRMB0G
-A1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0T
-AQH/BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6Fr
-pGkwZzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQL
-ExRBZGRUcnVzdCBUVFAgTmV0d29yazEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlm
-aWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBABmrder4i2VhlRO6aQTv
-hsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxGGuoYQ992zPlm
-hpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X
-dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3
-P6CxB9bpT9zeRXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9Y
-iQBCYz95OdBEsIJuQRno3eDBiFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5no
-xqE=
------END CERTIFICATE-----
diff --git a/jdk/make/data/cacerts/thawtepremiumserverca b/jdk/make/data/cacerts/thawtepremiumserverca
deleted file mode 100644
index 2df456ab..00000000
--- a/jdk/make/data/cacerts/thawtepremiumserverca
+++ /dev/null
@@ -1,27 +0,0 @@
-Owner: EMAILADDRESS=premium-server@thawte.com, CN=Thawte Premium Server CA, OU=Certification Services Division, O=Thawte Consulting cc, L=Cape Town, ST=Western Cape, C=ZA
-Issuer: EMAILADDRESS=premium-server@thawte.com, CN=Thawte Premium Server CA, OU=Certification Services Division, O=Thawte Consulting cc, L=Cape Town, ST=Western Cape, C=ZA
-Serial number: 36122296c5e338a520a1d25f4cd70954
-Valid from: Thu Aug 01 00:00:00 GMT 1996 until: Fri Jan 01 23:59:59 GMT 2021
-Signature algorithm name: SHA1withRSA
-Subject Public Key Algorithm: 1024-bit RSA key
-Version: 3
------BEGIN CERTIFICATE-----
-MIIDNjCCAp+gAwIBAgIQNhIilsXjOKUgodJfTNcJVDANBgkqhkiG9w0BAQUFADCB
-zjELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJ
-Q2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UE
-CxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhh
-d3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNl
-cnZlckB0aGF3dGUuY29tMB4XDTk2MDgwMTAwMDAwMFoXDTIxMDEwMTIzNTk1OVow
-gc4xCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcT
-CUNhcGUgVG93bjEdMBsGA1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNV
-BAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRo
-YXd0ZSBQcmVtaXVtIFNlcnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1z
-ZXJ2ZXJAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2
-aovXwlue2oFBYo847kkEVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560
-ZXUCTe/LCaIhUdib0GfQug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j
-+ao6hnO2RlNYyIkFvYMRuHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/
-BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBlkKyID1bZ5jA01CbH0FDxkt5r1DmI
-CSLGpmODA/eZd9iy5Ri4XWPz1HP7bJyZePFLeH0ZJMMrAoT4vCLZiiLXoPxx7JGH
-IPG47LHlVYCsPVLIOQ7C8MAFT9aCdYy9X9LcdpoFEsmvcsPcJX6kTY4XpeCHf+Ga
-WuFg3GQjPEIuTQ==
------END CERTIFICATE-----
diff --git a/jdk/make/data/cacerts/utnuserfirstobjectca b/jdk/make/data/cacerts/utnuserfirstobjectca
deleted file mode 100644
index 80a0b5c2..00000000
--- a/jdk/make/data/cacerts/utnuserfirstobjectca
+++ /dev/null
@@ -1,33 +0,0 @@
-Owner: CN=UTN-USERFirst-Object, OU=http://www.usertrust.com, O=The USERTRUST Network, L=Salt Lake City, ST=UT, C=US
-Issuer: CN=UTN-USERFirst-Object, OU=http://www.usertrust.com, O=The USERTRUST Network, L=Salt Lake City, ST=UT, C=US
-Serial number: 44be0c8b500024b411d3362de0b35f1b
-Valid from: Fri Jul 09 18:31:20 GMT 1999 until: Tue Jul 09 18:40:36 GMT 2019
-Signature algorithm name: SHA1withRSA
-Subject Public Key Algorithm: 2048-bit RSA key
-Version: 3
------BEGIN CERTIFICATE-----
-MIIEZjCCA06gAwIBAgIQRL4Mi1AAJLQR0zYt4LNfGzANBgkqhkiG9w0BAQUFADCB
-lTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
-Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
-dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHTAbBgNVBAMTFFVUTi1VU0VSRmlyc3Qt
-T2JqZWN0MB4XDTk5MDcwOTE4MzEyMFoXDTE5MDcwOTE4NDAzNlowgZUxCzAJBgNV
-BAYTAlVTMQswCQYDVQQIEwJVVDEXMBUGA1UEBxMOU2FsdCBMYWtlIENpdHkxHjAc
-BgNVBAoTFVRoZSBVU0VSVFJVU1QgTmV0d29yazEhMB8GA1UECxMYaHR0cDovL3d3
-dy51c2VydHJ1c3QuY29tMR0wGwYDVQQDExRVVE4tVVNFUkZpcnN0LU9iamVjdDCC
-ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6qgT+jo2F4qjEAVZURnicP
-HxzfOpuCaDDASmEd8S8O+r5596Uj71VRloTN2+O5bj4x2AogZ8f02b+U60cEPgLO
-KqJdhwQJ9jCdGIqXsqoc/EHSoTbL+z2RuufZcDX65OeQw5ujm9M89RKZd7G3CeBo
-5hy485RjiGpq/gt2yb70IuRnuasaXnfBhQfdDWy/7gbHd2pBnqcP1/vulBe3/IW+
-pKvEHDHd17bR5PDv3xaPslKT16HUiaEHLr/hARJCHhrh2JU022R5KP+6LhHC5ehb
-kkj7RwvCbNqtMoNB86XlQXD9ZZBt+vpRxPm9lisZBCzTbafc8H9vg2XiaquHhnUC
-AwEAAaOBrzCBrDALBgNVHQ8EBAMCAcYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E
-FgQU2u1kdBScFDyr3ZmpvVsoTYs8ydgwQgYDVR0fBDswOTA3oDWgM4YxaHR0cDov
-L2NybC51c2VydHJ1c3QuY29tL1VUTi1VU0VSRmlyc3QtT2JqZWN0LmNybDApBgNV
-HSUEIjAgBggrBgEFBQcDAwYIKwYBBQUHAwgGCisGAQQBgjcKAwQwDQYJKoZIhvcN
-AQEFBQADggEBAAgfUrE3RHjb/c652pWWmKpVZIC1WkDdIaXFwfNfLEzIR1pp6ujw
-NTX00CXzyKakh0q9G7FzCL3Uw8q2NbtZhncxzaeAFK4T7/yxSPlrJSUtUbYsbUXB
-mMiKVl0+7kNOPmsnjtA6S4ULX9Ptaqd1y9Fahy85dRNacrACgZ++8A+EVCBibGnU
-4U3GDZlDAQ0Slox4nb9QorFEqmrPF3rPbw/U+CRVX/A0FklmPlBGyWNxODFiuGK5
-81OtbLUrohKqGU8J2l7nk8aOFAj+8DCAGKCGhU3IfdeLA/5u1fedFqySLKAj5ZyR
-Uh+U3xeUc8OzwcFxBSAAeL0TUh2oPs0AH8g=
------END CERTIFICATE-----
diff --git a/jdk/make/data/cacerts/verisigntsaca b/jdk/make/data/cacerts/verisigntsaca
deleted file mode 100644
index 9813ddae..00000000
--- a/jdk/make/data/cacerts/verisigntsaca
+++ /dev/null
@@ -1,24 +0,0 @@
-Owner: CN=Thawte Timestamping CA, OU=Thawte Certification, O=Thawte, L=Durbanville, ST=Western Cape, C=ZA
-Issuer: CN=Thawte Timestamping CA, OU=Thawte Certification, O=Thawte, L=Durbanville, ST=Western Cape, C=ZA
-Serial number: 67c8e1e8e3be1cbdfc913b8ea6238749
-Valid from: Wed Jan 01 00:00:00 GMT 1997 until: Fri Jan 01 23:59:59 GMT 2021
-Signature algorithm name: SHA1withRSA
-Subject Public Key Algorithm: 1024-bit RSA key
-Version: 3
------BEGIN CERTIFICATE-----
-MIICsDCCAhmgAwIBAgIQZ8jh6OO+HL38kTuOpiOHSTANBgkqhkiG9w0BAQUFADCB
-izELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTEUMBIGA1UEBxML
-RHVyYmFudmlsbGUxDzANBgNVBAoTBlRoYXd0ZTEdMBsGA1UECxMUVGhhd3RlIENl
-cnRpZmljYXRpb24xHzAdBgNVBAMTFlRoYXd0ZSBUaW1lc3RhbXBpbmcgQ0EwHhcN
-OTcwMTAxMDAwMDAwWhcNMjEwMTAxMjM1OTU5WjCBizELMAkGA1UEBhMCWkExFTAT
-BgNVBAgTDFdlc3Rlcm4gQ2FwZTEUMBIGA1UEBxMLRHVyYmFudmlsbGUxDzANBgNV
-BAoTBlRoYXd0ZTEdMBsGA1UECxMUVGhhd3RlIENlcnRpZmljYXRpb24xHzAdBgNV
-BAMTFlRoYXd0ZSBUaW1lc3RhbXBpbmcgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0A
-MIGJAoGBANYrWHhhRYZT6jR7UZztsOYuGA7+4F+oJ9O0yeB8WU4WDnNUYMF/9p8u
-6TqFJBU820cEY8OexJQaWt9MevPZQx08EHp5JduQ/vBR5zDWQQD9nyjfeb6Uu522
-FOMjhdepQeBMpHmwKxqL8vg7ij5FrHGSALSQQZj7X+36ty6K+Ig3AgMBAAGjEzAR
-MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAS+mqF4EF+3kKMZ/F
-QfRWVKvpwuWXjhj+kckMPiZkyaFMJ2SnvQGTVXFuF0853BvcSTUQOSP/ypvIz2Y/
-3Ewa1IEGQlIf4SaxFhe65nByMUToTo1b5NP50OOPJWQx5yr4GIg2GlLFDUE1G2m3
-JvUXzMEZXkt8XOKDgJH6L/uatxY=
------END CERTIFICATE-----
diff --git a/jdk/test/sun/security/lib/cacerts/VerifyCACerts.java b/jdk/test/sun/security/lib/cacerts/VerifyCACerts.java
index af78073b..6b5f692e 100644
--- a/jdk/test/sun/security/lib/cacerts/VerifyCACerts.java
+++ b/jdk/test/sun/security/lib/cacerts/VerifyCACerts.java
@@ -57,7 +57,7 @@ public class VerifyCACerts {
// SHA-256 of cacerts, can be generated with
// shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95
private static final String CHECKSUM
- = "84:BB:36:9E:B0:07:A7:C5:7F:38:EC:36:82:5C:0F:46:C0:35:3B:B1:1F:06:C2:D0:47:B9:39:FA:87:64:E5:9D";
+ = "8E:A5:85:3C:66:C0:7C:B1:2A:B6:67:31:B3:4A:8E:78:1B:8D:DC:49:F1:42:65:DB:CE:7C:69:41:F3:94:3A:F7";
// map of cert alias to SHA-256 fingerprint
@SuppressWarnings("serial")
@@ -92,12 +92,6 @@ public class VerifyCACerts {
"E7:93:C9:B0:2F:D8:AA:13:E2:1C:31:22:8A:CC:B0:81:19:64:3B:74:9C:89:89:64:B1:74:6D:46:C3:D4:CB:D2");
put("usertrusteccca [jdk]",
"4F:F4:60:D5:4B:9C:86:DA:BF:BC:FC:57:12:E0:40:0D:2B:ED:3F:BC:4D:4F:BD:AA:86:E0:6A:DC:D2:A9:AD:7A");
- put("utnuserfirstobjectca [jdk]",
- "6F:FF:78:E4:00:A7:0C:11:01:1C:D8:59:77:C4:59:FB:5A:F9:6A:3D:F0:54:08:20:D0:F4:B8:60:78:75:E5:8F");
- put("addtrustexternalca [jdk]",
- "68:7F:A4:51:38:22:78:FF:F0:C8:B1:1F:8D:43:D5:76:67:1C:6E:B2:BC:EA:B4:13:FB:83:D9:65:D0:6D:2F:F2");
- put("addtrustqualifiedca [jdk]",
- "80:95:21:08:05:DB:4B:BC:35:5E:44:28:D8:FD:6E:C2:CD:E3:AB:5F:B9:7A:99:42:98:8E:B8:F4:DC:D0:60:16");
put("baltimorecybertrustca [jdk]",
"16:AF:57:A9:F6:76:B0:AB:12:60:95:AA:5E:BA:DE:F2:2A:B3:11:19:D6:44:AC:95:CD:4B:93:DB:F3:F2:6A:EB");
put("digicertglobalrootca [jdk]",
@@ -262,12 +256,6 @@ public class VerifyCACerts {
@SuppressWarnings("serial")
private static final HashSet<String> EXPIRY_EXC_ENTRIES = new HashSet<String>() {
{
- // Valid until: Tue Jul 09 14:40:36 EDT 2019
- add("utnuserfirstobjectca [jdk]");
- // Valid until: Sat May 30 10:38:31 GMT 2020
- add("addtrustexternalca [jdk]");
- // Valid until: Sat May 30 10:44:50 GMT 2020
- add("addtrustqualifiedca [jdk]");
}
};

View File

@ -915,7 +915,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r
Name: java-%{javaver}-%{origin}
Version: %{javaver}.%{updatever}.%{buildver}
Release: 7
Release: 14
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
# also included the epoch in their virtual provides. This created a
@ -1063,6 +1063,13 @@ Patch134: PS-GC-adding-acquire_size-method-for-PSParallelCompa.patch
Patch135: 8223940-Private-key-not-supported-by-chosen-signature.patch
Patch136: 8236512-PKCS11-Connection-closed-after-Cipher.doFinal-and-NoPadding.patch
Patch137: 8250861-Crash-in-MinINode-Ideal-PhaseGVN-bool.patch
Patch138: add-appcds-file-lock.patch
Patch139: G1-memory-uncommit.patch
Patch140: 8015927-Class-reference-duplicates-in-constant-pool.patch
Patch141: 8040327-Eliminate-AnnotatedType-8040319-Clean-up-type-annotation-exception-index.patch
Patch142: 8207160-ClassReader-adjustMethodParams-can-potentially-return-null-if-the-args-list-is-empty.patch
Patch143: delete-untrustworthy-cacert.patch
Patch144: add-appcds-test-case.patch
#############################################
#
@ -1481,6 +1488,13 @@ pushd %{top_level_dir_name}
%patch135 -p1
%patch136 -p1
%patch137 -p1
%patch138 -p1
%patch139 -p1
%patch140 -p1
%patch141 -p1
%patch142 -p1
%patch143 -p1
%patch144 -p1
popd
@ -2097,6 +2111,27 @@ require "copy_jdk_configs.lua"
%endif
%changelog
* Thu Dec 24 2020 lee18767 <lijunhui15@huawei.com> - 1:1.8.0.272-b10.14
- add add-appcds-test-case.patch
* Wed Dec 23 2020 hubodao <hubodao@huawei.com> - 1:1.8.0.272-b10.13
- add delete-untrustworthy-cacert.patch
* Wed Dec 23 2020 wujiahua <wujiahua3@huawei.com> - 1:1.8.0.272-b10.12
- add 8207160-ClassReader-adjustMethodParams-can-potentially-return-null-if-the-args-list-is-empty.patch
* Wed Dec 23 2020 DataAndOperation <mashoubing1@huawei.com> - 1:1.8.0.272-b10.11
- add 8040327-Eliminate-AnnotatedType-8040319-Clean-up-type-annotation-exception-index.patch
* Tue Dec 22 2020 miaozhuojun <mouzhuojun@huawei.com> - 1:1.8.0.272-b10.10
- add 8015927-Class-reference-duplicates-in-constant-pool.patch
* Tue Dec 22 2020 cruise01 <hexuejin2@huawei.com> - 1:1.8.0.272-b10.9
- add G1-memory-uncommit.patch
* Tue Dec 22 2020 kuenking <wangkun49@huawei.com> - 1:1.8.0.272-b10.8
- add add-appcds-file-lock.patch
* Mon Dec 21 2020 noah <hedongbo@huawei.com> - 1:1.8.0.272-b10.7
- add a license to this repo