diff --git a/Fix-the-ActiveProcessorCount-function-of-the-spark-s.patch b/Fix-the-ActiveProcessorCount-function-of-the-spark-s.patch new file mode 100644 index 0000000000000000000000000000000000000000..b7fedb50e3ddc7d6aa8199dc5aaa84c39f95d4db --- /dev/null +++ b/Fix-the-ActiveProcessorCount-function-of-the-spark-s.patch @@ -0,0 +1,42 @@ +Subject: [PATCH][Huawei] Fix the ActiveProcessorCount function of the spark service + became invalid + +--- + hotspot/src/os/linux/vm/os_linux.cpp | 4 ---- + hotspot/src/share/vm/runtime/os.cpp | 5 +++++ + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp +index 222c81d64..6ee49eedc 100644 +--- a/hotspot/src/os/linux/vm/os_linux.cpp ++++ b/hotspot/src/os/linux/vm/os_linux.cpp +@@ -5576,10 +5576,6 @@ jint os::init_2(void) + Linux::is_floating_stack() ? "floating stack" : "fixed stack"); + } + +-#ifdef AARCH64 +- JavaThread::os_linux_aarch64_options(active_processor_count(), argv_for_execvp); +-#endif +- + if (UseNUMA) { + if (!Linux::libnuma_init()) { + UseNUMA = false; +diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp +index ff35e8b3a..cae1cf477 100644 +--- a/hotspot/src/share/vm/runtime/os.cpp ++++ b/hotspot/src/share/vm/runtime/os.cpp +@@ -366,6 +366,11 @@ static void signal_thread_entry(JavaThread* thread, TRAPS) { + } + + void os::init_before_ergo() { ++#ifdef AARCH64 ++ // global variables ++ extern char** argv_for_execvp; ++ JavaThread::os_linux_aarch64_options(active_processor_count(), argv_for_execvp); ++#endif + initialize_initial_active_processor_count(); + // We need to initialize large page support here because ergonomics takes some + // decisions depending on large page support and the calculated large page size. +-- +2.44.0 + diff --git a/The-fast-serialization-function-of-sun.rmi.transport.patch b/The-fast-serialization-function-of-sun.rmi.transport.patch new file mode 100644 index 0000000000000000000000000000000000000000..b0417a0f49fb414af63a10c010defd38d97f446e --- /dev/null +++ b/The-fast-serialization-function-of-sun.rmi.transport.patch @@ -0,0 +1,88 @@ +Subject: [PATCH][Huawei] The fast serialization function of + sun.rmi.transport.ConnectionOutputStream is disabled by default + +--- + .../classes/java/io/ObjectOutputStream.java | 23 ++++++++++++++++--- + .../sun/rmi/server/MarshalOutputStream.java | 10 ++++++++ + 2 files changed, 30 insertions(+), 3 deletions(-) + +diff --git a/jdk/src/share/classes/java/io/ObjectOutputStream.java b/jdk/src/share/classes/java/io/ObjectOutputStream.java +index 328f47589..78dc3c5b2 100644 +--- a/jdk/src/share/classes/java/io/ObjectOutputStream.java ++++ b/jdk/src/share/classes/java/io/ObjectOutputStream.java +@@ -240,7 +240,7 @@ public class ObjectOutputStream + * Value of "UseFastSerializer" property. The fastSerializer is turned + * on when it is true. + */ +- private final boolean useFastSerializer = UNSAFE.getUseFastSerializer(); ++ private boolean useFastSerializer = UNSAFE.getUseFastSerializer(); + + /** + * value of "printFastSerializer" property, +@@ -254,7 +254,22 @@ public class ObjectOutputStream + * Magic number that is written to the stream header when using fastserilizer. + */ + private static final short STREAM_MAGIC_FAST = (short)0xdeca; ++ ++ /** ++ * The default value is true. If you want to disable the fast serialization function, please set it to false. ++ */ ++ protected boolean enableFastSerializerClass(){ ++ return true; ++ } + ++ /** ++ * Disable fast serialization functionality. ++ */ ++ private void disableFastSerializerStatusByClass() { ++ if ( this.useFastSerializer && !enableFastSerializerClass()){ ++ this.useFastSerializer = false; ++ } ++ } + /** + * Creates an ObjectOutputStream that writes to the specified OutputStream. + * This constructor writes the serialization stream header to the +@@ -279,7 +294,8 @@ public class ObjectOutputStream + * @see ObjectInputStream#ObjectInputStream(InputStream) + */ + public ObjectOutputStream(OutputStream out) throws IOException { +- verifySubclass(); ++ disableFastSerializerStatusByClass(); ++ verifySubclass(); + bout = new BlockDataOutputStream(out); + handles = new HandleTable(10, (float) 3.00); + subs = new ReplaceTable(10, (float) 3.00); +@@ -311,7 +327,8 @@ public class ObjectOutputStream + * @see java.io.SerializablePermission + */ + protected ObjectOutputStream() throws IOException, SecurityException { +- SecurityManager sm = System.getSecurityManager(); ++ disableFastSerializerStatusByClass(); ++ SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION); + } +diff --git a/jdk/src/share/classes/sun/rmi/server/MarshalOutputStream.java b/jdk/src/share/classes/sun/rmi/server/MarshalOutputStream.java +index 699f11072..e113441f8 100644 +--- a/jdk/src/share/classes/sun/rmi/server/MarshalOutputStream.java ++++ b/jdk/src/share/classes/sun/rmi/server/MarshalOutputStream.java +@@ -48,6 +48,16 @@ import sun.rmi.transport.Target; + */ + public class MarshalOutputStream extends ObjectOutputStream + { ++ /** ++ * value of "enableRMIFastSerializerClass" property ++ */ ++ private static final boolean enableRMIFastSerializerClass = java.security.AccessController.doPrivileged( new sun.security.action.GetBooleanAction( "enableRMIFastSerializerClass")).booleanValue(); ++ ++ @Override ++ protected boolean enableFastSerializerClass() { ++ return this.enableRMIFastSerializerClass; ++ } ++ + /** + * Creates a marshal output stream with protocol version 1. + */ +-- +2.44.0 + diff --git a/openjdk-1.8.0.spec b/openjdk-1.8.0.spec index 0c33958fb5f53dce86c8f9280ea4b8caf64bb78f..6367800c939d6636ca2645fde86f0b1af2b52c5f 100644 --- a/openjdk-1.8.0.spec +++ b/openjdk-1.8.0.spec @@ -937,7 +937,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever}.%{buildver} -Release: 0 +Release: 3 # 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 @@ -1334,6 +1334,8 @@ Patch439: Backport-8151845-Comment-in-globals.hpp-for-MetaspaceSize-is-.patch Patch440: Backport-8210706-G1-may-deadlock-when-starting-a-concurrent-c.patch Patch441: Backport-8318889-Backport-Important-Fixed-Issues-in-Later-Ver.patch Patch442: Huawei-Keep-objects-when-remove-unshareable-info.patch +Patch443: The-fast-serialization-function-of-sun.rmi.transport.patch +Patch444: Fix-the-ActiveProcessorCount-function-of-the-spark-s.patch ############################################# # # Upstreamable patches @@ -1989,10 +1991,18 @@ pushd %{top_level_dir_name} %patch440 -p1 %patch441 -p1 %patch442 -p1 +%patch443 -p1 +%patch444 -p1 %endif %ifarch loongarch64 %patch4000 -p1 + +%patch308 -p1 +%patch310 -p1 +%patch311 -p1 +%patch312 -p1 + %endif %ifarch riscv64 @@ -2649,7 +2659,16 @@ cjc.mainProgram(arg) %endif %changelog -* Thu Tue 16 2024 Autistic_boyya -1:1.8.0.422-b05.rolling +* Tue Jul 30 2024 benshuai5D -1:1.8.0.422-b05.3 +- Fix-the-ActiveProcessorCount-function-of-the-spark-s.patch + +* Tue Jul 30 2024 Xiang Gao - 1:1.8.0.422-b05.2 +- Backport 8178498,8193710,8196743,8284330, serviceability tools support containers on loongarch + +* Fri Jul 26 2024 benshuai5D -1:1.8.0.422-b05.1 +- Add The-fast-serialization-function-of-sun.rmi.transport.patch + +* Tue Jul 16 2024 Autistic_boyya -1:1.8.0.422-b05.rolling - modified 8014628-Support-AES-Encryption-with-HMAC-SHA2-for-Ke.patch - modified 8136577_Make_AbortVMOnException_available_in_product_builds.patch - modified Dynamic-CDS-Archive.patch