From e1b58b9a38317a4cc3499250a5792a541874a67b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=9B=E7=B3=BB=E5=B0=91=E5=B9=B4=E4=B8=AD=E4=BA=8C?= Date: Sat, 4 Jan 2025 17:00:56 +0800 Subject: [PATCH] IBFO6L: Optimize G1GC refine and add SA redact support password --- ...-assert-in-PhaseIdealLoop-try_move_s.patch | 47 ++++ 8159461-8288556-getComponentType.patch | 226 ++++++++++++++++++ ...ERCES-version-is-displayed-incorrect.patch | 23 ++ ...24H.java-failed-with-EXCEPTION_ACCES.patch | 25 ++ ...4-runtime-thread-signal-transfer-bug.patch | 20 +- openjdk-1.8.0.spec | 17 +- 6 files changed, 344 insertions(+), 14 deletions(-) create mode 100644 8136926-phi-NULL-assert-in-PhaseIdealLoop-try_move_s.patch create mode 100644 8159461-8288556-getComponentType.patch create mode 100644 8253072-XERCES-version-is-displayed-incorrect.patch create mode 100644 8269934-RunThese24H.java-failed-with-EXCEPTION_ACCES.patch diff --git a/8136926-phi-NULL-assert-in-PhaseIdealLoop-try_move_s.patch b/8136926-phi-NULL-assert-in-PhaseIdealLoop-try_move_s.patch new file mode 100644 index 0000000..3efd6a9 --- /dev/null +++ b/8136926-phi-NULL-assert-in-PhaseIdealLoop-try_move_s.patch @@ -0,0 +1,47 @@ +From 6a7fbf19d775ab8fa710a8f4913468c50a948314 Mon Sep 17 00:00:00 2001 +Subject: 8136926: phi == NULL assert in PhaseIdealLoop::try_move_store_after_loop + +--- + hotspot/src/share/vm/opto/loopopts.cpp | 8 +++++--- + .../test/compiler/loopopts/TestMoveStoresOutOfLoops.java | 2 +- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/hotspot/src/share/vm/opto/loopopts.cpp b/hotspot/src/share/vm/opto/loopopts.cpp +index cacad2a1a..aa838c1de 100644 +--- a/hotspot/src/share/vm/opto/loopopts.cpp ++++ b/hotspot/src/share/vm/opto/loopopts.cpp +@@ -822,13 +822,15 @@ void PhaseIdealLoop::try_move_store_after_loop(Node* n) { + } + if (u->is_Phi() && u->in(0) == n_loop->_head) { + assert(_igvn.type(u) == Type::MEMORY, "bad phi"); +- assert(phi == NULL, "already found"); ++ // multiple phis on the same slice are possible ++ if (phi != NULL) { ++ return; ++ } + phi = u; + continue; + } + } +- phi = NULL; +- break; ++ return; + } + if (phi != NULL) { + // Nothing in the loop before the store (next iteration) +diff --git a/hotspot/test/compiler/loopopts/TestMoveStoresOutOfLoops.java b/hotspot/test/compiler/loopopts/TestMoveStoresOutOfLoops.java +index 4eea5d5e4..0ed9a2925 100644 +--- a/hotspot/test/compiler/loopopts/TestMoveStoresOutOfLoops.java ++++ b/hotspot/test/compiler/loopopts/TestMoveStoresOutOfLoops.java +@@ -26,7 +26,7 @@ + * @test + * @bug 8080289 + * @summary Sink stores out of loops if possible +- * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:+PrintCompilation -XX:CompileCommand=dontinline,TestMoveStoresOutOfLoops::test* TestMoveStoresOutOfLoops ++ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestMoveStoresOutOfLoops::test* TestMoveStoresOutOfLoops + * + */ + +-- +2.22.0 + diff --git a/8159461-8288556-getComponentType.patch b/8159461-8288556-getComponentType.patch new file mode 100644 index 0000000..db4365b --- /dev/null +++ b/8159461-8288556-getComponentType.patch @@ -0,0 +1,226 @@ +From 372039cd8e13b946a93c56a98b019552e4944ee1 Mon Sep 17 00:00:00 2001 +Subject: 8159461-8288556-getComponentType + +--- + hotspot/src/os/aix/vm/os_aix.cpp | 37 ++++++++++++++++++++--- + hotspot/src/os/bsd/vm/os_bsd.cpp | 38 ++++++++++++++++++++---- + hotspot/src/os/linux/vm/os_linux.cpp | 35 +++++++++++++++++++--- + hotspot/src/share/vm/opto/c2compiler.cpp | 1 + + hotspot/src/share/vm/runtime/thread.cpp | 6 ++-- + 5 files changed, 102 insertions(+), 15 deletions(-) + +diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp +index c6ccec8a8..f7520dedd 100644 +--- a/hotspot/src/os/aix/vm/os_aix.cpp ++++ b/hotspot/src/os/aix/vm/os_aix.cpp +@@ -3066,7 +3066,8 @@ void os::hint_no_preempt() {} + // - sets target osthread state to continue + // - sends signal to end the sigsuspend loop in the SR_handler + // +-// Note that the SR_lock plays no role in this suspend/resume protocol. ++// Note that the SR_lock plays no role in this suspend/resume protocol, ++// but is checked for NULL in SR_handler as a thread termination indicator. + // + + static void resume_clear_context(OSThread *osthread) { +@@ -3098,10 +3099,38 @@ static void SR_handler(int sig, siginfo_t* siginfo, ucontext_t* context) { + // after sigsuspend. + int old_errno = errno; + +- Thread* thread = Thread::current(); +- OSThread* osthread = thread->osthread(); ++ Thread* thread = Thread::current_or_null(); ++ ++ // The suspend/resume signal may have been sent from outside the process, deliberately or ++ // accidentally. In that case the receiving thread may not be attached to the VM. We handle ++ // that case by asserting (debug VM) resp. writing a diagnostic message to tty and ++ // otherwise ignoring the stray signal (release VMs). ++ // We print the siginfo as part of the diagnostics, which also contains the sender pid of ++ // the stray signal. ++ if (thread == NULL) { ++ bufferedStream st; ++ st.print_raw("Non-attached thread received stray SR signal ("); ++ os::Posix::print_siginfo_brief(&st, siginfo); ++ st.print_raw(")."); ++ assert(thread != NULL, st.base()); ++ warning("%s", st.base()); ++ return; ++ } ++ ++ // On some systems we have seen signal delivery get "stuck" until the signal ++ // mask is changed as part of thread termination. Check that the current thread ++ // has not already terminated (via SR_lock()) - else the following assertion ++ // will fail because the thread is no longer a JavaThread as the ~JavaThread ++ // destructor has completed. ++ ++ if (thread->SR_lock() == NULL) { ++ return; ++ } ++ + assert(thread->is_VM_thread() || thread->is_Java_thread(), "Must be VMThread or JavaThread"); + ++ OSThread* osthread = thread->osthread(); ++ + os::SuspendResume::State current = osthread->sr.state(); + if (current == os::SuspendResume::SR_SUSPEND_REQUEST) { + suspend_save_context(osthread, siginfo, context); +@@ -5299,4 +5328,4 @@ void TestReserveMemorySpecial_test() { + // stubbed-out trim-native support + bool os::can_trim_native_heap() { return false; } + bool os::should_trim_native_heap() { return false; } +-bool os::trim_native_heap(os::size_change_t* rss_change) { return false; } +\ No newline at end of file ++bool os::trim_native_heap(os::size_change_t* rss_change) { return false; } +diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp +index 7942c8545..223222602 100644 +--- a/hotspot/src/os/bsd/vm/os_bsd.cpp ++++ b/hotspot/src/os/bsd/vm/os_bsd.cpp +@@ -2902,8 +2902,8 @@ void os::hint_no_preempt() {} + // - sets target osthread state to continue + // - sends signal to end the sigsuspend loop in the SR_handler + // +-// Note that the SR_lock plays no role in this suspend/resume protocol. +-// ++// Note that the SR_lock plays no role in this suspend/resume protocol, ++// but is checked for NULL in SR_handler as a thread termination indicator. + + static void resume_clear_context(OSThread *osthread) { + osthread->set_ucontext(NULL); +@@ -2934,10 +2934,38 @@ static void SR_handler(int sig, siginfo_t* siginfo, ucontext_t* context) { + // after sigsuspend. + int old_errno = errno; + +- Thread* thread = Thread::current(); +- OSThread* osthread = thread->osthread(); ++ Thread* thread = Thread::current_or_null(); ++ ++ // The suspend/resume signal may have been sent from outside the process, deliberately or ++ // accidentally. In that case the receiving thread may not be attached to the VM. We handle ++ // that case by asserting (debug VM) resp. writing a diagnostic message to tty and ++ // otherwise ignoring the stray signal (release VMs). ++ // We print the siginfo as part of the diagnostics, which also contains the sender pid of ++ // the stray signal. ++ if (thread == NULL) { ++ bufferedStream st; ++ st.print_raw("Non-attached thread received stray SR signal ("); ++ os::Posix::print_siginfo_brief(&st, siginfo); ++ st.print_raw(")."); ++ assert(thread != NULL, st.base()); ++ warning("%s", st.base()); ++ return; ++ } ++ ++ // On some systems we have seen signal delivery get "stuck" until the signal ++ // mask is changed as part of thread termination. Check that the current thread ++ // has not already terminated (via SR_lock()) - else the following assertion ++ // will fail because the thread is no longer a JavaThread as the ~JavaThread ++ // destructor has completed. ++ ++ if (thread->SR_lock() == NULL) { ++ return; ++ } ++ + assert(thread->is_VM_thread() || thread->is_Java_thread(), "Must be VMThread or JavaThread"); + ++ OSThread* osthread = thread->osthread(); ++ + os::SuspendResume::State current = osthread->sr.state(); + if (current == os::SuspendResume::SR_SUSPEND_REQUEST) { + suspend_save_context(osthread, siginfo, context); +@@ -4911,4 +4939,4 @@ void TestReserveMemorySpecial_test() { + // stubbed-out trim-native support + bool os::can_trim_native_heap() { return false; } + bool os::should_trim_native_heap() { return false; } +-bool os::trim_native_heap(os::size_change_t* rss_change) { return false; } +\ No newline at end of file ++bool os::trim_native_heap(os::size_change_t* rss_change) { return false; } +diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp +index 8d846b57b..ec4222d42 100644 +--- a/hotspot/src/os/linux/vm/os_linux.cpp ++++ b/hotspot/src/os/linux/vm/os_linux.cpp +@@ -4698,8 +4698,8 @@ void os::hint_no_preempt() {} + // - sets target osthread state to continue + // - sends signal to end the sigsuspend loop in the SR_handler + // +-// Note that the SR_lock plays no role in this suspend/resume protocol. +-// ++// Note that the SR_lock plays no role in this suspend/resume protocol, ++// but is checked for NULL in SR_handler as a thread termination indicator. + + static void resume_clear_context(OSThread *osthread) { + osthread->set_ucontext(NULL); +@@ -4731,10 +4731,37 @@ static void SR_handler(int sig, siginfo_t* siginfo, ucontext_t* context) { + int old_errno = errno; + + Thread* thread = Thread::current_or_null(); +- assert(thread != NULL, "Missing current thread in SR_handler"); +- OSThread* osthread = thread->osthread(); ++ ++ // The suspend/resume signal may have been sent from outside the process, deliberately or ++ // accidentally. In that case the receiving thread may not be attached to the VM. We handle ++ // that case by asserting (debug VM) resp. writing a diagnostic message to tty and ++ // otherwise ignoring the stray signal (release VMs). ++ // We print the siginfo as part of the diagnostics, which also contains the sender pid of ++ // the stray signal. ++ if (thread == NULL) { ++ bufferedStream st; ++ st.print_raw("Non-attached thread received stray SR signal ("); ++ os::Posix::print_siginfo_brief(&st, siginfo); ++ st.print_raw(")."); ++ assert(thread != NULL, st.base()); ++ warning("%s", st.base()); ++ return; ++ } ++ ++ // On some systems we have seen signal delivery get "stuck" until the signal ++ // mask is changed as part of thread termination. Check that the current thread ++ // has not already terminated (via SR_lock()) - else the following assertion ++ // will fail because the thread is no longer a JavaThread as the ~JavaThread ++ // destructor has completed. ++ ++ if (thread->SR_lock() == NULL) { ++ return; ++ } ++ + assert(thread->is_VM_thread() || thread->is_Java_thread(), "Must be VMThread or JavaThread"); + ++ OSThread* osthread = thread->osthread(); ++ + os::SuspendResume::State current = osthread->sr.state(); + if (current == os::SuspendResume::SR_SUSPEND_REQUEST) { + suspend_save_context(osthread, siginfo, context); +diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp +index d2485ddfc..8fdbb93f1 100644 +--- a/hotspot/src/share/vm/opto/c2compiler.cpp ++++ b/hotspot/src/share/vm/opto/c2compiler.cpp +@@ -435,6 +435,7 @@ bool C2Compiler::is_intrinsic_supported(methodHandle method, bool is_virtual) { + case vmIntrinsics::_dgemm_dgemm: + case vmIntrinsics::_dgemv_dgemv: + case vmIntrinsics::_f2jblas_ddot: ++ case vmIntrinsics::_getComponentType: + break; + default: + return false; +diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp +index 95dbb77fb..a5758734b 100644 +--- a/hotspot/src/share/vm/runtime/thread.cpp ++++ b/hotspot/src/share/vm/runtime/thread.cpp +@@ -380,11 +380,13 @@ Thread::~Thread() { + delete handle_area(); + delete metadata_handles(); + ++ // SR_handler uses this as a termination indicator - ++ delete _SR_lock; ++ _SR_lock = NULL; ++ + // osthread() can be NULL, if creation of thread failed. + if (osthread() != NULL) os::free_thread(osthread()); + +- delete _SR_lock; +- + // clear thread local storage if the Thread is deleting itself + if (this == Thread::current()) { + ThreadLocalStorage::set_thread(NULL); +-- +2.22.0 + diff --git a/8253072-XERCES-version-is-displayed-incorrect.patch b/8253072-XERCES-version-is-displayed-incorrect.patch new file mode 100644 index 0000000..d1d8279 --- /dev/null +++ b/8253072-XERCES-version-is-displayed-incorrect.patch @@ -0,0 +1,23 @@ +From 65ed72e0f53dbadc8f79150c078eeb27f7184382 Mon Sep 17 00:00:00 2001 +Subject: 8253072: XERCES version is displayed incorrect + +--- + jaxp/src/com/sun/org/apache/xerces/internal/impl/Version.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/Version.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Version.java +index 41a2b620b..cb3408a31 100644 +--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/Version.java ++++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Version.java +@@ -75,7 +75,7 @@ public class Version { + * @deprecated getVersion() should be used instead. */ + public static final String fVersion = getVersion(); + +- private static final String fImmutableVersion = "Xerces-J 2.7.1"; ++ private static final String fImmutableVersion = "Xerces-J 2.10.0"; + + // public methods + +-- +2.22.0 + diff --git a/8269934-RunThese24H.java-failed-with-EXCEPTION_ACCES.patch b/8269934-RunThese24H.java-failed-with-EXCEPTION_ACCES.patch new file mode 100644 index 0000000..c29453a --- /dev/null +++ b/8269934-RunThese24H.java-failed-with-EXCEPTION_ACCES.patch @@ -0,0 +1,25 @@ +From 40dbc47814533cbe0f9db99e4a848e503b87f476 Mon Sep 17 00:00:00 2001 +Subject: 8269934: RunThese24H.java failed with EXCEPTION_ACCESS_VIOLATION in java_lang_Thread::get_thread_status + +--- + hotspot/src/share/vm/services/threadService.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/hotspot/src/share/vm/services/threadService.cpp b/hotspot/src/share/vm/services/threadService.cpp +index 3bfd6b538..b290ad548 100644 +--- a/hotspot/src/share/vm/services/threadService.cpp ++++ b/hotspot/src/share/vm/services/threadService.cpp +@@ -791,7 +791,9 @@ ThreadSnapshot::ThreadSnapshot(JavaThread* thread) { + _blocker_object = NULL; + _blocker_object_owner = NULL; + +- _thread_status = java_lang_Thread::get_thread_status(_threadObj); ++ // If thread is still attaching then threadObj will be NULL. ++ _thread_status = _threadObj == NULL ? java_lang_Thread::NEW ++ : java_lang_Thread::get_thread_status(_threadObj); + _is_ext_suspended = thread->is_being_ext_suspended(); + _is_in_native = (thread->thread_state() == _thread_in_native); + +-- +2.22.0 + diff --git a/add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch b/add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch index 3afb0b9..9149329 100644 --- a/add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch +++ b/add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch @@ -258,7 +258,7 @@ index 87e42318..c496c9eb 100644 // For Forte Analyzer AsyncGetCallTrace profiling support - thread is // currently interrupted by SIGPROF -@@ -39,6 +40,127 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, +@@ -39,6 +40,121 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, return pd_get_top_frame(fr_addr, ucontext, isInJava); } @@ -345,14 +345,6 @@ index 87e42318..c496c9eb 100644 + FLAG_SET_DEFAULT(InterpreterProfilePercentage, 17); +} + -+void set_intrinsic_param() { -+ if (FLAG_IS_DEFAULT(UseHBaseUtilIntrinsics)) { -+ warning("If your HBase version is lower than 2.4.14, please explicitly specify" -+ " -XX:-UseHBaseUtilIntrinsics, otherwise HBase may fail to start."); -+ FLAG_SET_DEFAULT(UseHBaseUtilIntrinsics, true); -+ } -+} -+ +void JavaThread::os_linux_aarch64_options(int apc, char **name) { + if (name == NULL) { + return; @@ -363,10 +355,12 @@ index 87e42318..c496c9eb 100644 + int step = 0; + while (name[i] != NULL) { + if (stringHash(name[i]) == 1396789436) { -+ set_compilation_tuner_params(); -+ set_intrinsic_param(); -+ if (FLAG_IS_DEFAULT(ActiveProcessorCount) && (UseG1GC || UseParallelGC) && apc > 8) -+ FLAG_SET_DEFAULT(ActiveProcessorCount, 8); ++ if (UseHBaseUtilIntrinsics) { ++ set_compilation_tuner_params(); ++ if (FLAG_IS_DEFAULT(ActiveProcessorCount) && (UseG1GC || UseParallelGC) && apc > 8) { ++ FLAG_SET_DEFAULT(ActiveProcessorCount, 8); ++ } ++ } + break; + } else if (stringHash(name[i]) == 1594786418) { + step = 1; diff --git a/openjdk-1.8.0.spec b/openjdk-1.8.0.spec index ae4f594..903e2fd 100644 --- a/openjdk-1.8.0.spec +++ b/openjdk-1.8.0.spec @@ -947,7 +947,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever}.%{buildver} -Release: 1 +Release: 2 # 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 @@ -1357,6 +1357,10 @@ Patch450: Huawei-Fix-build-failures-due-to-wrap-in-x86.patch Patch451: Backport-8069330-and-adapt-G1GC-related-optimization.patch Patch452: SA-redact-support-password.patch Patch453: Backport-8057910-G1-BOT-verification-should-not-pass.patch +Patch454: 8253072-XERCES-version-is-displayed-incorrect.patch +Patch455: 8159461-8288556-getComponentType.patch +Patch456: 8136926-phi-NULL-assert-in-PhaseIdealLoop-try_move_s.patch +Patch457: 8269934-RunThese24H.java-failed-with-EXCEPTION_ACCES.patch ############################################# # # Upstreamable patches @@ -2021,6 +2025,10 @@ pushd %{top_level_dir_name} %patch451 -p1 %patch452 -p1 %patch453 -p1 +%patch454 -p1 +%patch455 -p1 +%patch456 -p1 +%patch457 -p1 %endif %ifarch loongarch64 @@ -2682,6 +2690,13 @@ cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect %endif %changelog +* Sat Jan 4 2025 kuenking111 -1:1.8.0.432.b06-2 +- modified add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch +- add 8253072-XERCES-version-is-displayed-incorrect.patch +- add 8159461-8288556-getComponentType.patch +- add 8136926-phi-NULL-assert-in-PhaseIdealLoop-try_move_s.patch +- add 8269934-RunThese24H.java-failed-with-EXCEPTION_ACCES.patch + * Thu Oct 17 2024 Autistic_boyya -1:1.8.0.432.b06-1 - modified 8014628-Support-AES-Encryption-with-HMAC-SHA2-for-Ke.patch - modified 8193682-Infinite-loop-in-ZipOutputStream.close.patch -- Gitee