diff --git a/8253495-CDS-generates-non-deterministic-outpu.patch b/8253495-CDS-generates-non-deterministic-outpu.patch index 714aace824197b7ea8552cf40617bff3e922c3a9..5248a3a6a256b5da41a9e3d389ea117d9c788bea 100644 --- a/8253495-CDS-generates-non-deterministic-outpu.patch +++ b/8253495-CDS-generates-non-deterministic-outpu.patch @@ -3,8 +3,6 @@ Date: Wed, 4 Jan 2023 20:41:20 +0800 Subject: 8253495: CDS generates non-deterministic output --- - make/GenerateLinkOptData.gmk | 7 +- - .../build/tools/classlist/SortClasslist.java | 79 +++++++++++++++++++ make/scripts/compare.sh | 8 +- src/hotspot/share/cds/archiveBuilder.cpp | 5 +- src/hotspot/share/cds/archiveUtils.hpp | 5 +- @@ -18,129 +16,13 @@ Subject: 8253495: CDS generates non-deterministic output .../cds/appcds/javaldr/LockDuringDump.java | 4 +- .../appcds/javaldr/LockDuringDumpAgent.java | 16 +++- test/lib/jdk/test/lib/cds/CDSOptions.java | 33 ++++++-- - 15 files changed, 191 insertions(+), 35 deletions(-) + 13 files changed, 103 insertions(+), 33 deletions(-) create mode 100644 make/jdk/src/classes/build/tools/classlist/SortClasslist.java -diff --git a/make/GenerateLinkOptData.gmk b/make/GenerateLinkOptData.gmk -index 0de28d643..5dd766c8c 100644 ---- a/make/GenerateLinkOptData.gmk -+++ b/make/GenerateLinkOptData.gmk -@@ -1,5 +1,5 @@ - # --# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. -+# Copyright (c) 2016, 2021, 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 -@@ -88,7 +88,10 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST - $(CAT) $(LINK_OPT_DIR)/stderr $(JLI_TRACE_FILE) ; \ - exit $$exitcode \ - ) -- $(GREP) -v HelloClasslist $@.raw.2 > $@ -+ $(GREP) -v HelloClasslist $@.raw.2 > $@.raw.3 -+ $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java \ -+ -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \ -+ build.tools.classlist.SortClasslist $@.raw.3 > $@ - - # The jli trace is created by the same recipe as classlist. By declaring these - # dependencies, make will correctly rebuild both jli trace and classlist -diff --git a/make/jdk/src/classes/build/tools/classlist/SortClasslist.java b/make/jdk/src/classes/build/tools/classlist/SortClasslist.java -new file mode 100644 -index 000000000..cf9e55a7b ---- /dev/null -+++ b/make/jdk/src/classes/build/tools/classlist/SortClasslist.java -@@ -0,0 +1,79 @@ -+/* -+ * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2022, 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 -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. Oracle designates this -+ * particular file as subject to the "Classpath" exception as provided -+ * by Oracle in the LICENSE file that accompanied this code. -+ * -+ * 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. -+ */ -+ -+/** -+ * This application is meant to be run to create a classlist file representing -+ * common use. -+ * -+ * The classlist is produced by adding -XX:DumpLoadedClassList=classlist -+ */ -+package build.tools.classlist; -+ -+import java.io.FileInputStream; -+import java.io.FileNotFoundException; -+import java.util.ArrayList; -+import java.util.Collections; -+import java.util.regex.Pattern; -+import java.util.regex.Matcher; -+import java.util.Scanner; -+ -+/** -+ * The classlist generated by build.tools.classlist.HelloClasslist -+ * may have non-deterministic contents, affected by Java thread execution order. -+ * SortClasslist sorts the file to make the JDK image's contents more deterministic. -+ */ -+public class SortClasslist { -+ public static void main(String args[]) throws FileNotFoundException { -+ ArrayList classes = new ArrayList<>(); -+ ArrayList lambdas = new ArrayList<>(); -+ -+ FileInputStream fis = new FileInputStream(args[0]); -+ Scanner scanner = new Scanner(fis); -+ while (scanner.hasNextLine()) { -+ String line = scanner.nextLine(); -+ if (line.startsWith("#")) { -+ // Comments -- print them first without sorting. These appear only at the top -+ // of the file. -+ System.out.println(line); -+ } else if (line.startsWith("@")) { -+ // @lambda-form-invoker, @lambda-proxy, etc. -+ lambdas.add(line); -+ } else { -+ classes.add(line); -+ } -+ } -+ -+ Collections.sort(classes); -+ Collections.sort(lambdas); -+ -+ for (String s : classes) { -+ System.out.println(s); -+ } -+ for (String s : lambdas) { -+ System.out.println(s); -+ } -+ } -+} diff --git a/make/scripts/compare.sh b/make/scripts/compare.sh -index b33c80c78..324529d70 100644 +index 76c3a0684..023299771 100644 --- a/make/scripts/compare.sh +++ b/make/scripts/compare.sh -@@ -1,6 +1,6 @@ - #!/bin/bash - # --# Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved. -+# Copyright (c) 2012, 2022, 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 @@ -325,7 +325,7 @@ compare_general_files() { ! -name "*.cpl" ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \ ! -name "*.lib" ! -name "*.jmod" ! -name "*.exe" \ @@ -150,17 +32,6 @@ index b33c80c78..324529d70 100644 ! -name "*.map" \ | $GREP -v "./bin/" | $SORT | $FILTER) -@@ -357,8 +357,8 @@ compare_general_files() { - " - $CAT $OTHER_DIR/$f | eval "$SVG_FILTER" > $OTHER_FILE - $CAT $THIS_DIR/$f | eval "$SVG_FILTER" > $THIS_FILE -- elif [[ "$f" = *"/lib/classlist" ]] || [ "$SUFFIX" = "jar_contents" ]; then -- # The classlist files may have some lines in random order -+ elif [ "$SUFFIX" = "jar_contents" ]; then -+ # The jar_contents files may have some lines in random order - OTHER_FILE=$WORK_DIR/$f.other - THIS_FILE=$WORK_DIR/$f.this - $MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE) diff --git a/src/hotspot/share/cds/archiveBuilder.cpp b/src/hotspot/share/cds/archiveBuilder.cpp index 699926fcf..8e12cdabb 100644 --- a/src/hotspot/share/cds/archiveBuilder.cpp diff --git a/add-8267185-Add-string-deduplication-support-to.patch b/add-8267185-Add-string-deduplication-support-to.patch index 9b222f3d569ec32e9d94489ba9647b42e5028383..7a4102facf8de78df57aef2298266ed4ee1e8694 100644 --- a/add-8267185-Add-string-deduplication-support-to.patch +++ b/add-8267185-Add-string-deduplication-support-to.patch @@ -357,13 +357,14 @@ index 7e5bb9ae5..83a652a8e 100644 * @test TestStringDeduplicationFullGC * @summary Test string deduplication during full GC diff --git a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java -index 072f10e10..145adb946 100644 +index a5720b88e..a39419f0a 100644 --- a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java +++ b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java -@@ -36,6 +36,19 @@ package gc.stringdedup; - * @run driver gc.stringdedup.TestStringDeduplicationInterned G1 +@@ -48,6 +48,20 @@ package gc.stringdedup; + * java.management + * @run driver gc.stringdedup.TestStringDeduplicationInterned Shenandoah */ - ++ +/* + * @test TestStringDeduplicationInterned + * @summary Test string deduplication of interned strings diff --git a/add-version-txt.patch b/add-version-txt.patch index 4209b9883bc6476f3389622d6f331a3e70431b03..f9480989ee77cacd00878a41183b9253b21b37f6 100644 --- a/add-version-txt.patch +++ b/add-version-txt.patch @@ -13,7 +13,7 @@ index 000000000..b717bafbe --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ -+17.0.8.0.13 ++17.0.9.0.13 -- 2.19.0 diff --git a/jdk-updates-jdk17u-jdk-17.0.8+7.tar.gz b/jdk-updates-jdk17u-jdk-17.0.9+8.tar.gz similarity index 82% rename from jdk-updates-jdk17u-jdk-17.0.8+7.tar.gz rename to jdk-updates-jdk17u-jdk-17.0.9+8.tar.gz index 560d75d2f907dd5201c6f5664dff0fa621211238..371c05eba9a987ba349277c643eaa07ca1a095cf 100644 Binary files a/jdk-updates-jdk17u-jdk-17.0.8+7.tar.gz and b/jdk-updates-jdk17u-jdk-17.0.9+8.tar.gz differ diff --git a/openjdk-17.spec b/openjdk-17.spec index e479d9b8feb5b68536bc42cbd1d63e691d0d88e5..699425677182c9f4fba081a680331b712b982be2 100644 --- a/openjdk-17.spec +++ b/openjdk-17.spec @@ -161,7 +161,7 @@ # Used via new version scheme. JDK 17 was # GA'ed in March 2021 => 21.9 %global vendor_version_string 21.9 -%global securityver 8 +%global securityver 9 # buildjdkver is usually same as %%{majorver}, # but in time of bootstrap of next jdk, it is majorver-1, # and this it is better to change it here, on single place @@ -181,7 +181,7 @@ %global origin_nice OpenJDK %global top_level_dir_name %{origin} %global minorver 0 -%global buildver 7 +%global buildver 8 # priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit %if %is_system_jdk %global priority %( printf '%02d%02d%02d%02d' %{majorver} %{minorver} %{securityver} %{buildver} ) @@ -891,7 +891,7 @@ Provides: java-src%{?1} = %{epoch}:%{version}-%{release} Name: java-%{javaver}-%{origin} Version: %{newjavaver}.%{buildver} -Release: 2 +Release: 0 # 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 @@ -1821,6 +1821,11 @@ cjc.mainProgram(arg) %changelog +* Tue Oct 17 2023 kuenking111 - 1:17.0.9.8-0.rolling +- fix 8253495-CDS-generates-non-deterministic-outpu.patch +- fix add-8267185-Add-string-deduplication-support-to.patch +- fix add-version-txt.patch + * Mon Sep 25 2023 kuenking111 - 1:17.0.8.7-2 - add add-Parallel-Full-gc-mark-stack-draining-should.patch - add add-8271579-G1-Move-copy-before-CAS-in-do_copy.patch