From 1fca2aecd2ffe31817e679c1821a51aded177279 Mon Sep 17 00:00:00 2001 From: DXwangg Date: Thu, 17 Jul 2025 17:30:06 +0800 Subject: [PATCH] sync patch --- ...finite-loop-in-ZipOutputStream.close.patch | 166 ------------------ Fix-tests-for-OS-with-64k-page-size.patch | 35 ++++ ...4-runtime-thread-signal-transfer-bug.patch | 7 +- openjdk-1.8.0.spec | 13 +- 4 files changed, 51 insertions(+), 170 deletions(-) delete mode 100644 8193682-Infinite-loop-in-ZipOutputStream.close.patch create mode 100644 Fix-tests-for-OS-with-64k-page-size.patch diff --git a/8193682-Infinite-loop-in-ZipOutputStream.close.patch b/8193682-Infinite-loop-in-ZipOutputStream.close.patch deleted file mode 100644 index 8234cfd..0000000 --- a/8193682-Infinite-loop-in-ZipOutputStream.close.patch +++ /dev/null @@ -1,166 +0,0 @@ -From ba4213c7350e7a145a142d0cbe54718a8c92b93c Mon Sep 17 00:00:00 2001 -Subject: 8193682: Infinite loop in ZipOutputStream.close() ---- - .../java/util/zip/DeflaterOutputStream.java | 9 +- - .../java/util/zip/GZIPOutputStream.java | 38 +++-- - .../java/util/zip/ZipOutputStream.java | 96 ++++++------ - jdk/test/java/util/zip/CloseDeflaterTest.java | 147 ++++++++++++++++++ - 4 files changed, 226 insertions(+), 64 deletions(-) - create mode 100644 jdk/test/java/util/zip/CloseDeflaterTest.java - -diff --git a/jdk/test/java/util/zip/CloseDeflaterTest.java b/jdk/test/java/util/zip/CloseDeflaterTest.java -new file mode 100644 -index 000000000..8aa4960f5 ---- /dev/null -+++ b/jdk/test/java/util/zip/CloseDeflaterTest.java -@@ -0,0 +1,147 @@ -+/* -+ * Copyright (c) 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 -+ * 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 8193682 -+ * @summary Test Infinite loop while writing on closed GZipOutputStream , ZipOutputStream and JarOutputStream. -+ * @run testng CloseDeflaterTest -+ */ -+import java.io.*; -+import java.util.Random; -+import java.util.jar.JarOutputStream; -+import java.util.zip.GZIPOutputStream; -+import java.util.zip.ZipOutputStream; -+import java.util.zip.ZipEntry; -+ -+import org.testng.annotations.BeforeTest; -+import org.testng.annotations.DataProvider; -+import org.testng.annotations.Test; -+import static org.testng.Assert.fail; -+ -+ -+public class CloseDeflaterTest { -+ -+ //number of bytes to write -+ private static final int INPUT_LENGTH= 512; -+ //OutputStream that will throw an exception during a write operation -+ private static OutputStream outStream = new OutputStream() { -+ @Override -+ public void write(byte[] b, int off, int len) throws IOException { -+ //throw exception during write -+ throw new IOException(); -+ } -+ @Override -+ public void write(byte b[]) throws IOException {} -+ @Override -+ public void write(int b) throws IOException {} -+ }; -+ private static byte[] inputBytes = new byte[INPUT_LENGTH]; -+ private static Random rand = new Random(); -+ -+ @DataProvider(name = "testgzipinput") -+ public Object[][] testGZipInput() { -+ //testGZip will close the GZipOutputStream using close() method when the boolean -+ //useCloseMethod is set to true and finish() method if the value is set to false -+ return new Object[][] { -+ { GZIPOutputStream.class, true }, -+ { GZIPOutputStream.class, false }, -+ }; -+ } -+ -+ @DataProvider(name = "testzipjarinput") -+ public Object[][] testZipAndJarInput() { -+ //testZipAndJarInput will perfrom write/closeEntry operations on JarOutputStream when the boolean -+ //useJar is set to true and on ZipOutputStream if the value is set to false -+ return new Object[][] { -+ { JarOutputStream.class, true }, -+ { ZipOutputStream.class, false }, -+ }; -+ } -+ -+ @BeforeTest -+ public void before_test() -+ { -+ //add inputBytes array with random bytes to write into Zip -+ rand.nextBytes(inputBytes); -+ } -+ -+ //Test for infinite loop by writing bytes to closed GZIPOutputStream -+ @Test(dataProvider = "testgzipinput") -+ public void testGZip(Class type, boolean useCloseMethod) throws IOException { -+ GZIPOutputStream zip = new GZIPOutputStream(outStream); -+ try { -+ zip.write(inputBytes, 0, INPUT_LENGTH); -+ //close zip -+ if(useCloseMethod) { -+ zip.close(); -+ } else { -+ zip.finish(); -+ } -+ } catch (IOException e) { -+ //expected -+ } -+ for (int i = 0; i < 3; i++) { -+ try { -+ //write on a closed GZIPOutputStream -+ zip.write(inputBytes, 0, INPUT_LENGTH); -+ fail("Deflater closed exception not thrown"); -+ } catch (NullPointerException e) { -+ //expected , Deflater has been closed exception -+ } -+ } -+ } -+ -+ //Test for infinite loop by writing bytes to closed ZipOutputStream/JarOutputStream -+ @Test(dataProvider = "testzipjarinput") -+ public void testZipCloseEntry(Class type,boolean useJar) throws IOException { -+ ZipOutputStream zip = null; -+ if(useJar) { -+ zip = new JarOutputStream(outStream); -+ } else { -+ zip = new ZipOutputStream(outStream); -+ } -+ try { -+ zip.putNextEntry(new ZipEntry("")); -+ } catch (IOException e) { -+ //expected to throw IOException since putNextEntry calls write method -+ } -+ try { -+ zip.write(inputBytes, 0, INPUT_LENGTH); -+ //close zip entry -+ zip.closeEntry(); -+ } catch (IOException e) { -+ //expected -+ } -+ for (int i = 0; i < 3; i++) { -+ try { -+ //write on a closed ZipOutputStream -+ zip.write(inputBytes, 0, INPUT_LENGTH); -+ fail("Deflater closed exception not thrown"); -+ } catch (NullPointerException e) { -+ //expected , Deflater has been closed exception -+ } -+ } -+ } -+ -+} --- -2.22.0 - diff --git a/Fix-tests-for-OS-with-64k-page-size.patch b/Fix-tests-for-OS-with-64k-page-size.patch new file mode 100644 index 0000000..0be6b91 --- /dev/null +++ b/Fix-tests-for-OS-with-64k-page-size.patch @@ -0,0 +1,35 @@ +--- + hotspot/test/runtime/6929067/invoke.c | 2 +- + hotspot/test/runtime/InitialThreadOverflow/invoke.cxx | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/hotspot/test/runtime/6929067/invoke.c b/hotspot/test/runtime/6929067/invoke.c +index 8dde2cd67..cf8014be3 100644 +--- a/hotspot/test/runtime/6929067/invoke.c ++++ b/hotspot/test/runtime/6929067/invoke.c +@@ -68,7 +68,7 @@ floobydust (void *p) + int + main (int argc, const char** argv) + { +- options[0].optionString = "-Xss320k"; ++ options[0].optionString = "-Xss512k"; + + vm_args.version = JNI_VERSION_1_2; + vm_args.ignoreUnrecognized = JNI_TRUE; +diff --git a/hotspot/test/runtime/InitialThreadOverflow/invoke.cxx b/hotspot/test/runtime/InitialThreadOverflow/invoke.cxx +index 55213c0f3..2bca88f15 100644 +--- a/hotspot/test/runtime/InitialThreadOverflow/invoke.cxx ++++ b/hotspot/test/runtime/InitialThreadOverflow/invoke.cxx +@@ -48,7 +48,7 @@ floobydust (void *p) { + int + main (int argc, const char** argv) { + JavaVMOption options[1]; +- options[0].optionString = (char*) "-Xss320k"; ++ options[0].optionString = (char*) "-Xss512k"; + + JavaVMInitArgs vm_args; + vm_args.version = JNI_VERSION_1_2; +-- +2.31.1 + + diff --git a/add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch b/add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch index 9149329..840dfff 100644 --- a/add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch +++ b/add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch @@ -220,7 +220,7 @@ diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/ index 028b55cf..a486ade2 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp -@@ -658,6 +658,11 @@ void VM_Version::get_processor_features() { +@@ -658,6 +658,16 @@ void VM_Version::get_processor_features() { FLAG_SET_DEFAULT(UseF2jBLASIntrinsics, false); } @@ -228,6 +228,11 @@ index 028b55cf..a486ade2 100644 + warning("hbase.util instructions are not available on this CPU"); + FLAG_SET_DEFAULT(UseHBaseUtilIntrinsics, false); + } ++ ++ if (NUMANodesRandom != 0) { ++ warning("NUMANodesRandom is not supported in this VM."); ++ FLAG_SET_DEFAULT(NUMANodesRandom, 0); ++ } + // Adjust RTM (Restricted Transactional Memory) flags if (!supports_rtm() && UseRTMLocking) { diff --git a/openjdk-1.8.0.spec b/openjdk-1.8.0.spec index 41320f0..d1deb57 100644 --- a/openjdk-1.8.0.spec +++ b/openjdk-1.8.0.spec @@ -953,7 +953,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever}.%{buildver} -Release: 0 +Release: 1 # 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 @@ -1308,7 +1308,6 @@ Patch399: 8294906-Memory-leak-in-PKCS11-NSS-TLS-server.patch Patch400: 8314236-Overflow-in-Collections.rotate.patch Patch401: 8313626-C2-crash-due-to-unexpected-exception-control.patch Patch402: 8312200-Fix-Parse-catch_call_exceptions-memory-leak.patch -Patch403: 8193682-Infinite-loop-in-ZipOutputStream.close.patch Patch404: 8285516-clearPassword-should-be-called-in-a-finally-.patch Patch405: 8148470-Metadata-print-routines-should-not-print-to-.patch Patch406: 8293344-JDK-8242181-broke-stack-printing-for-non-att.patch @@ -1381,6 +1380,9 @@ Patch468: 8151920-Region-liveness-printing-is-broken.patch Patch469: huawei-AArch64-Incorrect-matching-rule.patch Patch470: Backport-8296924-C2-assert-is_valid_AArch64_address-dest.targ.patch +#462 +Patch471: Fix-tests-for-OS-with-64k-page-size.patch + ############################################# # # Upstreamable patches @@ -2004,7 +2006,6 @@ pushd %{top_level_dir_name} %patch400 -p1 %patch401 -p1 %patch402 -p1 -%patch403 -p1 %patch404 -p1 %patch405 -p1 %patch406 -p1 @@ -2066,6 +2067,7 @@ pushd %{top_level_dir_name} %patch468 -p1 %patch469 -p1 %patch470 -p1 +%patch471 -p1 %endif %ifarch loongarch64 @@ -3051,6 +3053,11 @@ cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect %endif %changelog +* Thu July 17 2025 DXwangg -1:1.8.0.462.b08-1 +- deleted 8193682-Infinite-loop-in-ZipOutputStream.close.patch +- modified add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch +- add Fix-tests-for-OS-with-64k-page-size.patch + * Wed July 16 2025 DXwangg -1:1.8.0.462.b08-0 - update to 8u462 - deleted 8026976-ECParameters-Point-does-not-match-field-size.patch -- Gitee