!371 upgrade master branch to jdk8u352-b08 for openEuler 20.03-LTS-SP2

From: @kuenking111 
Reviewed-by: @stubCode 
Signed-off-by: @stubCode
This commit is contained in:
openeuler-ci-bot 2022-10-24 12:29:56 +00:00 committed by Gitee
commit c5b7c55781
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
29 changed files with 20044 additions and 367 deletions

View File

@ -0,0 +1,485 @@
From 69371858fda3c1793faf8bbf116ec4fe554605ac Mon Sep 17 00:00:00 2001
From: hedongbo <hedongbo@huawei.com>
Date: Fri, 21 Oct 2022 15:16:04 +0800
Subject: 8065895: Synchronous signals during error reporting may
terminate or hang VM process
Bug url: https://bugs.openjdk.java.net/browse/JDK-8065895
---
hotspot/src/os/aix/vm/vmError_aix.cpp | 11 +++--
hotspot/src/os/bsd/vm/vmError_bsd.cpp | 47 +++++++++++-------
hotspot/src/os/linux/vm/vmError_linux.cpp | 48 ++++++++++++-------
hotspot/src/os/solaris/vm/vmError_solaris.cpp | 48 ++++++++++++-------
hotspot/src/share/vm/runtime/globals.hpp | 4 ++
hotspot/src/share/vm/utilities/debug.cpp | 48 ++++++++++++++++---
hotspot/src/share/vm/utilities/debug.hpp | 18 +++++++
hotspot/src/share/vm/utilities/vmError.cpp | 29 +++++++++++
8 files changed, 196 insertions(+), 57 deletions(-)
diff --git a/hotspot/src/os/aix/vm/vmError_aix.cpp b/hotspot/src/os/aix/vm/vmError_aix.cpp
index d99436ebc..34709134a 100644
--- a/hotspot/src/os/aix/vm/vmError_aix.cpp
+++ b/hotspot/src/os/aix/vm/vmError_aix.cpp
@@ -80,7 +80,6 @@ static void save_signal(int idx, int sig) {
}
int VMError::get_resetted_sigflags(int sig) {
- // Handle all program errors.
for (int i = 0; i < NUM_SIGNALS; i++) {
if (SIGNALS[i] == sig) {
return resettedSigflags[i];
@@ -90,7 +89,6 @@ int VMError::get_resetted_sigflags(int sig) {
}
address VMError::get_resetted_sighandler(int sig) {
- // Handle all program errors.
for (int i = 0; i < NUM_SIGNALS; i++) {
if (SIGNALS[i] == sig) {
return resettedSighandler[i];
@@ -100,12 +98,19 @@ address VMError::get_resetted_sighandler(int sig) {
}
static void crash_handler(int sig, siginfo_t* info, void* ucVoid) {
+
// Unmask current signal.
sigset_t newset;
sigemptyset(&newset);
sigaddset(&newset, sig);
+ // and all other synchronous signals too.
+ for (int i = 0; i < NUM_SIGNALS; i++) {
+ sigaddset(&newset, SIGNALS[i]);
+ }
+ sigthreadmask(SIG_UNBLOCK, &newset, NULL);
- Unimplemented();
+ VMError err(NULL, sig, NULL, info, ucVoid);
+ err.report_and_die();
}
void VMError::reset_signal_handlers() {
diff --git a/hotspot/src/os/bsd/vm/vmError_bsd.cpp b/hotspot/src/os/bsd/vm/vmError_bsd.cpp
index 8ec6ca04c..f09e1163f 100644
--- a/hotspot/src/os/bsd/vm/vmError_bsd.cpp
+++ b/hotspot/src/os/bsd/vm/vmError_bsd.cpp
@@ -63,9 +63,15 @@ void VMError::show_message_box(char *buf, int buflen) {
} while (yes);
}
+// handle all synchronous program error signals which may happen during error
+// reporting. They must be unblocked, caught, handled.
+
+static const int SIGNALS[] = { SIGSEGV, SIGBUS, SIGILL, SIGFPE, SIGTRAP }; // add more if needed
+static const int NUM_SIGNALS = sizeof(SIGNALS) / sizeof(int);
+
// Space for our "saved" signal flags and handlers
-static int resettedSigflags[2];
-static address resettedSighandler[2];
+static int resettedSigflags[NUM_SIGNALS];
+static address resettedSighandler[NUM_SIGNALS];
static void save_signal(int idx, int sig)
{
@@ -78,19 +84,19 @@ static void save_signal(int idx, int sig)
}
int VMError::get_resetted_sigflags(int sig) {
- if(SIGSEGV == sig) {
- return resettedSigflags[0];
- } else if(SIGBUS == sig) {
- return resettedSigflags[1];
+ for (int i = 0; i < NUM_SIGNALS; i++) {
+ if (SIGNALS[i] == sig) {
+ return resettedSigflags[i];
+ }
}
return -1;
}
address VMError::get_resetted_sighandler(int sig) {
- if(SIGSEGV == sig) {
- return resettedSighandler[0];
- } else if(SIGBUS == sig) {
- return resettedSighandler[1];
+ for (int i = 0; i < NUM_SIGNALS; i++) {
+ if (SIGNALS[i] == sig) {
+ return resettedSighandler[i];
+ }
}
return NULL;
}
@@ -100,16 +106,25 @@ static void crash_handler(int sig, siginfo_t* info, void* ucVoid) {
sigset_t newset;
sigemptyset(&newset);
sigaddset(&newset, sig);
- sigprocmask(SIG_UNBLOCK, &newset, NULL);
+ // also unmask other synchronous signals
+ for (int i = 0; i < NUM_SIGNALS; i++) {
+ sigaddset(&newset, SIGNALS[i]);
+ }
+ pthread_sigmask(SIG_UNBLOCK, &newset, NULL);
VMError err(NULL, sig, NULL, info, ucVoid);
err.report_and_die();
}
void VMError::reset_signal_handlers() {
- // Save sigflags for resetted signals
- save_signal(0, SIGSEGV);
- save_signal(1, SIGBUS);
- os::signal(SIGSEGV, CAST_FROM_FN_PTR(void *, crash_handler));
- os::signal(SIGBUS, CAST_FROM_FN_PTR(void *, crash_handler));
+ // install signal handlers for all synchronous program error signals
+ sigset_t newset;
+ sigemptyset(&newset);
+
+ for (int i = 0; i < NUM_SIGNALS; i++) {
+ save_signal(i, SIGNALS[i]);
+ os::signal(SIGNALS[i], CAST_FROM_FN_PTR(void *, crash_handler));
+ sigaddset(&newset, SIGNALS[i]);
+ }
+ pthread_sigmask(SIG_UNBLOCK, &newset, NULL);
}
diff --git a/hotspot/src/os/linux/vm/vmError_linux.cpp b/hotspot/src/os/linux/vm/vmError_linux.cpp
index 378c9a6ab..fca239c7e 100644
--- a/hotspot/src/os/linux/vm/vmError_linux.cpp
+++ b/hotspot/src/os/linux/vm/vmError_linux.cpp
@@ -63,9 +63,15 @@ void VMError::show_message_box(char *buf, int buflen) {
} while (yes);
}
+// handle all synchronous program error signals which may happen during error
+// reporting. They must be unblocked, caught, handled.
+
+static const int SIGNALS[] = { SIGSEGV, SIGBUS, SIGILL, SIGFPE, SIGTRAP }; // add more if needed
+static const int NUM_SIGNALS = sizeof(SIGNALS) / sizeof(int);
+
// Space for our "saved" signal flags and handlers
-static int resettedSigflags[2];
-static address resettedSighandler[2];
+static int resettedSigflags[NUM_SIGNALS];
+static address resettedSighandler[NUM_SIGNALS];
static void save_signal(int idx, int sig)
{
@@ -78,19 +84,19 @@ static void save_signal(int idx, int sig)
}
int VMError::get_resetted_sigflags(int sig) {
- if(SIGSEGV == sig) {
- return resettedSigflags[0];
- } else if(SIGBUS == sig) {
- return resettedSigflags[1];
+ for (int i = 0; i < NUM_SIGNALS; i++) {
+ if (SIGNALS[i] == sig) {
+ return resettedSigflags[i];
+ }
}
return -1;
}
address VMError::get_resetted_sighandler(int sig) {
- if(SIGSEGV == sig) {
- return resettedSighandler[0];
- } else if(SIGBUS == sig) {
- return resettedSighandler[1];
+ for (int i = 0; i < NUM_SIGNALS; i++) {
+ if (SIGNALS[i] == sig) {
+ return resettedSighandler[i];
+ }
}
return NULL;
}
@@ -100,16 +106,26 @@ static void crash_handler(int sig, siginfo_t* info, void* ucVoid) {
sigset_t newset;
sigemptyset(&newset);
sigaddset(&newset, sig);
- sigprocmask(SIG_UNBLOCK, &newset, NULL);
+ // also unmask other synchronous signals
+ for (int i = 0; i < NUM_SIGNALS; i++) {
+ sigaddset(&newset, SIGNALS[i]);
+ }
+ pthread_sigmask(SIG_UNBLOCK, &newset, NULL);
VMError err(NULL, sig, NULL, info, ucVoid);
err.report_and_die();
}
void VMError::reset_signal_handlers() {
- // Save sigflags for resetted signals
- save_signal(0, SIGSEGV);
- save_signal(1, SIGBUS);
- os::signal(SIGSEGV, CAST_FROM_FN_PTR(void *, crash_handler));
- os::signal(SIGBUS, CAST_FROM_FN_PTR(void *, crash_handler));
+ // install signal handlers for all synchronous program error signals
+ sigset_t newset;
+ sigemptyset(&newset);
+
+ for (int i = 0; i < NUM_SIGNALS; i++) {
+ save_signal(i, SIGNALS[i]);
+ os::signal(SIGNALS[i], CAST_FROM_FN_PTR(void *, crash_handler));
+ sigaddset(&newset, SIGNALS[i]);
+ }
+ pthread_sigmask(SIG_UNBLOCK, &newset, NULL);
+
}
diff --git a/hotspot/src/os/solaris/vm/vmError_solaris.cpp b/hotspot/src/os/solaris/vm/vmError_solaris.cpp
index 6f3f5b06f..e24e5f6bf 100644
--- a/hotspot/src/os/solaris/vm/vmError_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/vmError_solaris.cpp
@@ -30,6 +30,7 @@
#include <sys/types.h>
#include <sys/wait.h>
+#include <thread.h>
#include <signal.h>
void VMError::show_message_box(char *buf, int buflen) {
@@ -59,9 +60,15 @@ void VMError::show_message_box(char *buf, int buflen) {
} while (yes);
}
+// handle all synchronous program error signals which may happen during error
+// reporting. They must be unblocked, caught, handled.
+
+static const int SIGNALS[] = { SIGSEGV, SIGBUS, SIGILL, SIGFPE, SIGTRAP }; // add more if needed
+static const int NUM_SIGNALS = sizeof(SIGNALS) / sizeof(int);
+
// Space for our "saved" signal flags and handlers
-static int resettedSigflags[2];
-static address resettedSighandler[2];
+static int resettedSigflags[NUM_SIGNALS];
+static address resettedSighandler[NUM_SIGNALS];
static void save_signal(int idx, int sig)
{
@@ -74,19 +81,19 @@ static void save_signal(int idx, int sig)
}
int VMError::get_resetted_sigflags(int sig) {
- if(SIGSEGV == sig) {
- return resettedSigflags[0];
- } else if(SIGBUS == sig) {
- return resettedSigflags[1];
+ for (int i = 0; i < NUM_SIGNALS; i++) {
+ if (SIGNALS[i] == sig) {
+ return resettedSigflags[i];
+ }
}
return -1;
}
address VMError::get_resetted_sighandler(int sig) {
- if(SIGSEGV == sig) {
- return resettedSighandler[0];
- } else if(SIGBUS == sig) {
- return resettedSighandler[1];
+ for (int i = 0; i < NUM_SIGNALS; i++) {
+ if (SIGNALS[i] == sig) {
+ return resettedSighandler[i];
+ }
}
return NULL;
}
@@ -96,16 +103,25 @@ static void crash_handler(int sig, siginfo_t* info, void* ucVoid) {
sigset_t newset;
sigemptyset(&newset);
sigaddset(&newset, sig);
- sigprocmask(SIG_UNBLOCK, &newset, NULL);
+ // also unmask other synchronous signals
+ for (int i = 0; i < NUM_SIGNALS; i++) {
+ sigaddset(&newset, SIGNALS[i]);
+ }
+ thr_sigsetmask(SIG_UNBLOCK, &newset, NULL);
VMError err(NULL, sig, NULL, info, ucVoid);
err.report_and_die();
}
void VMError::reset_signal_handlers() {
- // Save sigflags for resetted signals
- save_signal(0, SIGSEGV);
- save_signal(1, SIGBUS);
- os::signal(SIGSEGV, CAST_FROM_FN_PTR(void *, crash_handler));
- os::signal(SIGBUS, CAST_FROM_FN_PTR(void *, crash_handler));
+ // install signal handlers for all synchronous program error signals
+ sigset_t newset;
+ sigemptyset(&newset);
+
+ for (int i = 0; i < NUM_SIGNALS; i++) {
+ save_signal(i, SIGNALS[i]);
+ os::signal(SIGNALS[i], CAST_FROM_FN_PTR(void *, crash_handler));
+ sigaddset(&newset, SIGNALS[i]);
+ }
+ thr_sigsetmask(SIG_UNBLOCK, &newset, NULL);
}
diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp
index eb13ee0d7..0dab18e1a 100644
--- a/hotspot/src/share/vm/runtime/globals.hpp
+++ b/hotspot/src/share/vm/runtime/globals.hpp
@@ -916,6 +916,10 @@ class CommandLineFlags {
"determines which error to provoke. See test_error_handler() " \
"in debug.cpp.") \
\
+ notproduct(uintx, TestCrashInErrorHandler, 0, \
+ "If > 0, provokes an error inside VM error handler (a secondary " \
+ "crash). see test_error_handler() in debug.cpp.") \
+ \
develop(bool, Verbose, false, \
"Print additional debugging information from other modes") \
\
diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp
index 58a32a2b8..8cea16d32 100644
--- a/hotspot/src/share/vm/utilities/debug.cpp
+++ b/hotspot/src/share/vm/utilities/debug.cpp
@@ -337,13 +337,47 @@ bool is_error_reported() {
#ifndef PRODUCT
#include <signal.h>
+typedef void (*voidfun_t)();
+// Crash with an authentic sigfpe
+static void crash_with_sigfpe() {
+ // generate a native synchronous SIGFPE where possible;
+ // if that did not cause a signal (e.g. on ppc), just
+ // raise the signal.
+ volatile int x = 0;
+ volatile int y = 1/x;
+#ifndef _WIN32
+ raise(SIGFPE);
+#endif
+} // end: crash_with_sigfpe
+
+// crash with sigsegv at non-null address.
+static void crash_with_segfault() {
+
+ char* const crash_addr = (char*) get_segfault_address();
+ *crash_addr = 'X';
+
+} // end: crash_with_segfault
+
+// returns an address which is guaranteed to generate a SIGSEGV on read,
+// for test purposes, which is not NULL and contains bits in every word
+void* get_segfault_address() {
+ return (void*)
+#ifdef _LP64
+ 0xABC0000000000ABCULL;
+#else
+ 0x00000ABC;
+#endif
+}
+
void test_error_handler() {
- uintx test_num = ErrorHandlerTest;
- if (test_num == 0) return;
+ controlled_crash(ErrorHandlerTest);
+}
+
+void controlled_crash(int how) {
+ if (how == 0) return;
// If asserts are disabled, use the corresponding guarantee instead.
- size_t n = test_num;
- NOT_DEBUG(if (n <= 2) n += 2);
+ NOT_DEBUG(if (how <= 2) how += 2);
const char* const str = "hello";
const size_t num = (size_t)os::vm_page_size();
@@ -354,7 +388,7 @@ void test_error_handler() {
const void (*funcPtr)(void) = (const void(*)()) 0xF; // bad function pointer
// Keep this in sync with test/runtime/6888954/vmerrors.sh.
- switch (n) {
+ switch (how) {
case 1: assert(str == NULL, "expected null");
case 2: assert(num == 1023 && *str == 'X',
err_msg("num=" SIZE_FORMAT " str=\"%s\"", num, str));
@@ -379,8 +413,10 @@ void test_error_handler() {
// There's no guarantee the bad function pointer will crash us
// so "break" out to the ShouldNotReachHere().
case 13: (*funcPtr)(); break;
+ case 14: crash_with_segfault(); break;
+ case 15: crash_with_sigfpe(); break;
- default: tty->print_cr("ERROR: %d: unexpected test_num value.", n);
+ default: tty->print_cr("ERROR: %d: unexpected test_num value.", how);
}
ShouldNotReachHere();
}
diff --git a/hotspot/src/share/vm/utilities/debug.hpp b/hotspot/src/share/vm/utilities/debug.hpp
index 3c3f8afe2..7a5e1523b 100644
--- a/hotspot/src/share/vm/utilities/debug.hpp
+++ b/hotspot/src/share/vm/utilities/debug.hpp
@@ -266,6 +266,24 @@ void set_error_reported();
/* Test assert(), fatal(), guarantee(), etc. */
NOT_PRODUCT(void test_error_handler();)
+// crash in a controlled way:
+// how can be one of:
+// 1,2 - asserts
+// 3,4 - guarantee
+// 5-7 - fatal
+// 8 - vm_exit_out_of_memory
+// 9 - ShouldNotCallThis
+// 10 - ShouldNotReachHere
+// 11 - Unimplemented
+// 12,13 - (not guaranteed) crashes
+// 14 - SIGSEGV
+// 15 - SIGFPE
+NOT_PRODUCT(void controlled_crash(int how);)
+
+// returns an address which is guaranteed to generate a SIGSEGV on read,
+// for test purposes, which is not NULL and contains bits in every word
+NOT_PRODUCT(void* get_segfault_address();)
+
void pd_ps(frame f);
void pd_obfuscate_location(char *buf, size_t buflen);
diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp
index aa0b63a80..9b40a3468 100644
--- a/hotspot/src/share/vm/utilities/vmError.cpp
+++ b/hotspot/src/share/vm/utilities/vmError.cpp
@@ -397,6 +397,26 @@ void VMError::report(outputStream* st) {
"Runtime Environment to continue.");
}
+#ifndef PRODUCT
+ // Error handler self tests
+
+ // test secondary error handling. Test it twice, to test that resetting
+ // error handler after a secondary crash works.
+ STEP(13, "(test secondary crash 1)")
+ if (_verbose && TestCrashInErrorHandler != 0) {
+ st->print_cr("Will crash now (TestCrashInErrorHandler=%d)...",
+ TestCrashInErrorHandler);
+ controlled_crash(TestCrashInErrorHandler);
+ }
+
+ STEP(14, "(test secondary crash 2)")
+ if (_verbose && TestCrashInErrorHandler != 0) {
+ st->print_cr("Will crash now (TestCrashInErrorHandler=%d)...",
+ TestCrashInErrorHandler);
+ controlled_crash(TestCrashInErrorHandler);
+ }
+#endif // PRODUCT
+
STEP(15, "(printing type of error)")
switch(static_cast<unsigned int>(_id)) {
@@ -829,6 +849,15 @@ void VMError::report(outputStream* st) {
st->cr();
}
+#ifndef PRODUCT
+ // print a defined marker to show that error handling finished correctly.
+ STEP(290, "(printing end marker)" )
+
+ if (_verbose) {
+ st->print_cr("END.");
+ }
+#endif
+
END
# undef BEGIN
--
2.22.0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,114 @@
From 717ae5f43045b1e2d6f95c52fbd81c54ebf50977 Mon Sep 17 00:00:00 2001
Date: Fri, 16 Sep 2022 01:12:20 +0000
Subject: 8159720: Failure of C2 compilation with tiered prevents some
C1 compilations.
---
hotspot/src/share/vm/opto/compile.cpp | 2 +-
hotspot/src/share/vm/opto/compile.hpp | 10 +++-------
hotspot/src/share/vm/opto/matcher.cpp | 8 ++++----
hotspot/src/share/vm/opto/parse1.cpp | 4 ++--
4 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp
index 5a42422e1..4a32e8a9f 100644
--- a/hotspot/src/share/vm/opto/compile.cpp
+++ b/hotspot/src/share/vm/opto/compile.cpp
@@ -791,7 +791,7 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr
}
if (failing()) return;
if (cg == NULL) {
- record_method_not_compilable_all_tiers("cannot parse method");
+ record_method_not_compilable("cannot parse method");
return;
}
JVMState* jvms = build_start_state(start(), tf());
diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp
index 1150fd549..fb12b6874 100644
--- a/hotspot/src/share/vm/opto/compile.hpp
+++ b/hotspot/src/share/vm/opto/compile.hpp
@@ -742,16 +742,12 @@ class Compile : public Phase {
bool failure_reason_is(const char* r) { return (r==_failure_reason) || (r!=NULL && _failure_reason!=NULL && strcmp(r, _failure_reason)==0); }
void record_failure(const char* reason);
- void record_method_not_compilable(const char* reason, bool all_tiers = false) {
- // All bailouts cover "all_tiers" when TieredCompilation is off.
- if (!TieredCompilation) all_tiers = true;
- env()->record_method_not_compilable(reason, all_tiers);
+ void record_method_not_compilable(const char* reason) {
+ // Bailouts cover "all_tiers" when TieredCompilation is off.
+ env()->record_method_not_compilable(reason, !TieredCompilation);
// Record failure reason.
record_failure(reason);
}
- void record_method_not_compilable_all_tiers(const char* reason) {
- record_method_not_compilable(reason, true);
- }
bool check_node_count(uint margin, const char* reason) {
if (live_nodes() + margin > max_node_limit()) {
record_method_not_compilable(reason);
diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp
index 07b8ee4c6..b26015ce6 100644
--- a/hotspot/src/share/vm/opto/matcher.cpp
+++ b/hotspot/src/share/vm/opto/matcher.cpp
@@ -137,7 +137,7 @@ OptoReg::Name Matcher::warp_incoming_stk_arg( VMReg reg ) {
_in_arg_limit = OptoReg::add(warped, 1); // Bump max stack slot seen
if (!RegMask::can_represent_arg(warped)) {
// the compiler cannot represent this method's calling sequence
- C->record_method_not_compilable_all_tiers("unsupported incoming calling sequence");
+ C->record_method_not_compilable("unsupported incoming calling sequence");
return OptoReg::Bad;
}
return warped;
@@ -1148,7 +1148,7 @@ OptoReg::Name Matcher::warp_outgoing_stk_arg( VMReg reg, OptoReg::Name begin_out
if( warped >= out_arg_limit_per_call )
out_arg_limit_per_call = OptoReg::add(warped,1);
if (!RegMask::can_represent_arg(warped)) {
- C->record_method_not_compilable_all_tiers("unsupported calling sequence");
+ C->record_method_not_compilable("unsupported calling sequence");
return OptoReg::Bad;
}
return warped;
@@ -1327,7 +1327,7 @@ MachNode *Matcher::match_sfpt( SafePointNode *sfpt ) {
uint r_cnt = mcall->tf()->range()->cnt();
MachProjNode *proj = new (C) MachProjNode( mcall, r_cnt+10000, RegMask::Empty, MachProjNode::fat_proj );
if (!RegMask::can_represent_arg(OptoReg::Name(out_arg_limit_per_call-1))) {
- C->record_method_not_compilable_all_tiers("unsupported outgoing calling sequence");
+ C->record_method_not_compilable("unsupported outgoing calling sequence");
} else {
for (int i = begin_out_arg_area; i < out_arg_limit_per_call; i++)
proj->_rout.Insert(OptoReg::Name(i));
@@ -1515,7 +1515,7 @@ Node *Matcher::Label_Root( const Node *n, State *svec, Node *control, const Node
// out of stack space. See bugs 6272980 & 6227033 for more info.
LabelRootDepth++;
if (LabelRootDepth > MaxLabelRootDepth) {
- C->record_method_not_compilable_all_tiers("Out of stack space, increase MaxLabelRootDepth");
+ C->record_method_not_compilable("Out of stack space, increase MaxLabelRootDepth");
return NULL;
}
uint care = 0; // Edges matcher cares about
diff --git a/hotspot/src/share/vm/opto/parse1.cpp b/hotspot/src/share/vm/opto/parse1.cpp
index a9ef4f910..4fcd58cb4 100644
--- a/hotspot/src/share/vm/opto/parse1.cpp
+++ b/hotspot/src/share/vm/opto/parse1.cpp
@@ -415,7 +415,7 @@ Parse::Parse(JVMState* caller, ciMethod* parse_method, float expected_uses)
_iter.reset_to_method(method());
_flow = method()->get_flow_analysis();
if (_flow->failing()) {
- C->record_method_not_compilable_all_tiers(_flow->failure_reason());
+ C->record_method_not_compilable(_flow->failure_reason());
}
#ifndef PRODUCT
@@ -1088,7 +1088,7 @@ SafePointNode* Parse::create_entry_map() {
// Check for really stupid bail-out cases.
uint len = TypeFunc::Parms + method()->max_locals() + method()->max_stack();
if (len >= 32760) {
- C->record_method_not_compilable_all_tiers("too many local variables");
+ C->record_method_not_compilable("too many local variables");
return NULL;
}
--
2.18.0.huawei.25

View File

@ -1,29 +0,0 @@
From 85a351276984f56d817560db8b5b837254ec2994 Mon Sep 17 00:00:00 2001
From: zhangyipeng <zhangyipeng7@huawei.com>
Date: Tue, 7 Jun 2022 20:10:03 +0800
Subject: [PATCH 05/10] 8173339: AArch64: Fix minimum stack size computations
Bug url: https://bugs.openjdk.java.net/browse/JDK-8173339
---
hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp
index 6610cc4fb..7c6b24879 100644
--- a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp
+++ b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp
@@ -56,7 +56,10 @@ define_pd_global(intx, InlineFrequencyCount, 100);
define_pd_global(intx, StackYellowPages, 2);
define_pd_global(intx, StackRedPages, 1);
-define_pd_global(intx, StackShadowPages, 4 DEBUG_ONLY(+5));
+// Java_java_net_SocketOutputStream_socketWrite0() uses a 64k buffer on the
+// stack if compiled for unix and LP64. To pass stack overflow tests we need
+// 20 shadow pages.
+define_pd_global(intx, StackShadowPages, 20 DEBUG_ONLY(+5));
define_pd_global(intx, PreInflateSpin, 10);
--
2.22.0

View File

@ -1,290 +0,0 @@
diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp
index 175c195c6..01e878022 100644
--- a/hotspot/src/share/vm/code/nmethod.cpp
+++ b/hotspot/src/share/vm/code/nmethod.cpp
@@ -1656,24 +1656,28 @@ bool nmethod::can_unload(BoolObjectClosure* is_alive, oop* root, bool unloading_
// Transfer information from compilation to jvmti
void nmethod::post_compiled_method_load_event() {
- Method* moop = method();
+ // This is a bad time for a safepoint. We don't want
+ // this nmethod to get unloaded while we're queueing the event.
+ No_Safepoint_Verifier nsv;
+
+ Method* m = method();
#ifndef USDT2
HS_DTRACE_PROBE8(hotspot, compiled__method__load,
- moop->klass_name()->bytes(),
- moop->klass_name()->utf8_length(),
- moop->name()->bytes(),
- moop->name()->utf8_length(),
- moop->signature()->bytes(),
- moop->signature()->utf8_length(),
+ m->klass_name()->bytes(),
+ m->klass_name()->utf8_length(),
+ m->name()->bytes(),
+ m->name()->utf8_length(),
+ m->signature()->bytes(),
+ m->signature()->utf8_length(),
insts_begin(), insts_size());
#else /* USDT2 */
HOTSPOT_COMPILED_METHOD_LOAD(
- (char *) moop->klass_name()->bytes(),
- moop->klass_name()->utf8_length(),
- (char *) moop->name()->bytes(),
- moop->name()->utf8_length(),
- (char *) moop->signature()->bytes(),
- moop->signature()->utf8_length(),
+ (char *) m->klass_name()->bytes(),
+ m->klass_name()->utf8_length(),
+ (char *) m->name()->bytes(),
+ m->name()->utf8_length(),
+ (char *) m->signature()->bytes(),
+ m->signature()->utf8_length(),
insts_begin(), insts_size());
#endif /* USDT2 */
diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp
index 895fbbf07..367c9a09d 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp
@@ -1786,7 +1786,7 @@ jmethodID InstanceKlass::get_jmethod_id(instanceKlassHandle ik_h, methodHandle m
// we're single threaded or at a safepoint - no locking needed
get_jmethod_id_length_value(jmeths, idnum, &length, &id);
} else {
- MutexLocker ml(JmethodIdCreation_lock);
+ MutexLockerEx ml(JmethodIdCreation_lock, Mutex::_no_safepoint_check_flag);
get_jmethod_id_length_value(jmeths, idnum, &length, &id);
}
}
@@ -1836,7 +1836,7 @@ jmethodID InstanceKlass::get_jmethod_id(instanceKlassHandle ik_h, methodHandle m
id = get_jmethod_id_fetch_or_update(ik_h, idnum, new_id, new_jmeths,
&to_dealloc_id, &to_dealloc_jmeths);
} else {
- MutexLocker ml(JmethodIdCreation_lock);
+ MutexLockerEx ml(JmethodIdCreation_lock, Mutex::_no_safepoint_check_flag);
id = get_jmethod_id_fetch_or_update(ik_h, idnum, new_id, new_jmeths,
&to_dealloc_id, &to_dealloc_jmeths);
}
diff --git a/hotspot/src/share/vm/prims/jvmtiExport.cpp b/hotspot/src/share/vm/prims/jvmtiExport.cpp
index 9b612598f..967ed200d 100644
--- a/hotspot/src/share/vm/prims/jvmtiExport.cpp
+++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp
@@ -1754,7 +1754,7 @@ jvmtiCompiledMethodLoadInlineRecord* create_inline_record(nmethod* nm) {
int stackframe = 0;
for(ScopeDesc* sd = nm->scope_desc_at(p->real_pc(nm));sd != NULL;sd = sd->sender()) {
// sd->method() can be NULL for stubs but not for nmethods. To be completely robust, include an assert that we should never see a null sd->method()
- assert(sd->method() != NULL, "sd->method() cannot be null.");
+ guarantee(sd->method() != NULL, "sd->method() cannot be null.");
record->pcinfo[scope].methods[stackframe] = sd->method()->jmethod_id();
record->pcinfo[scope].bcis[stackframe] = sd->bci();
stackframe++;
diff --git a/hotspot/src/share/vm/prims/jvmtiImpl.cpp b/hotspot/src/share/vm/prims/jvmtiImpl.cpp
index 3c66b1671..3bcd15ed6 100644
--- a/hotspot/src/share/vm/prims/jvmtiImpl.cpp
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.cpp
@@ -897,9 +897,6 @@ JvmtiDeferredEvent JvmtiDeferredEvent::compiled_method_load_event(
nmethod* nm) {
JvmtiDeferredEvent event = JvmtiDeferredEvent(TYPE_COMPILED_METHOD_LOAD);
event._event_data.compiled_method_load = nm;
- // Keep the nmethod alive until the ServiceThread can process
- // this deferred event.
- nmethodLocker::lock_nmethod(nm);
return event;
}
@@ -932,14 +929,12 @@ JvmtiDeferredEvent JvmtiDeferredEvent::dynamic_code_generated_event(
}
void JvmtiDeferredEvent::post() {
- assert(ServiceThread::is_service_thread(Thread::current()),
+ assert(Thread::current()->is_service_thread(),
"Service thread must post enqueued events");
switch(_type) {
case TYPE_COMPILED_METHOD_LOAD: {
nmethod* nm = _event_data.compiled_method_load;
JvmtiExport::post_compiled_method_load(nm);
- // done with the deferred event so unlock the nmethod
- nmethodLocker::unlock_nmethod(nm);
break;
}
case TYPE_COMPILED_METHOD_UNLOAD: {
@@ -969,6 +964,21 @@ void JvmtiDeferredEvent::post() {
}
}
+// Keep the nmethod for compiled_method_load from being unloaded.
+void JvmtiDeferredEvent::oops_do(OopClosure* f, CodeBlobClosure* cf) {
+ if (cf != NULL && _type == TYPE_COMPILED_METHOD_LOAD) {
+ cf->do_code_blob(_event_data.compiled_method_load);
+ }
+}
+
+// The sweeper calls this and marks the nmethods here on the stack so that
+// they cannot be turned into zombies while in the queue.
+void JvmtiDeferredEvent::nmethods_do(CodeBlobClosure* cf) {
+ if (cf != NULL && _type == TYPE_COMPILED_METHOD_LOAD) {
+ cf->do_code_blob(_event_data.compiled_method_load);
+ } // May add UNLOAD event but it doesn't work yet.
+}
+
JvmtiDeferredEventQueue::QueueNode* JvmtiDeferredEventQueue::_queue_tail = NULL;
JvmtiDeferredEventQueue::QueueNode* JvmtiDeferredEventQueue::_queue_head = NULL;
@@ -1084,3 +1094,15 @@ void JvmtiDeferredEventQueue::process_pending_events() {
}
}
}
+
+void JvmtiDeferredEventQueue::oops_do(OopClosure* f, CodeBlobClosure* cf) {
+ for(QueueNode* node = _queue_head; node != NULL; node = node->next()) {
+ node->event().oops_do(f, cf);
+ }
+}
+
+void JvmtiDeferredEventQueue::nmethods_do(CodeBlobClosure* cf) {
+ for(QueueNode* node = _queue_head; node != NULL; node = node->next()) {
+ node->event().nmethods_do(cf);
+ }
+}
diff --git a/hotspot/src/share/vm/prims/jvmtiImpl.hpp b/hotspot/src/share/vm/prims/jvmtiImpl.hpp
index 9f36f28fb..d74789451 100644
--- a/hotspot/src/share/vm/prims/jvmtiImpl.hpp
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.hpp
@@ -492,6 +492,10 @@ class JvmtiDeferredEvent VALUE_OBJ_CLASS_SPEC {
// Actually posts the event.
void post() NOT_JVMTI_RETURN;
+ // Sweeper support to keep nmethods from being zombied while in the queue.
+ void nmethods_do(CodeBlobClosure* cf);
+ // GC support to keep nmethod from being unloaded while in the queue.
+ void oops_do(OopClosure* f, CodeBlobClosure* cf);
};
/**
@@ -511,7 +515,7 @@ class JvmtiDeferredEventQueue : AllStatic {
QueueNode(const JvmtiDeferredEvent& event)
: _event(event), _next(NULL) {}
- const JvmtiDeferredEvent& event() const { return _event; }
+ JvmtiDeferredEvent& event() { return _event; }
QueueNode* next() const { return _next; }
void set_next(QueueNode* next) { _next = next; }
@@ -529,6 +533,10 @@ class JvmtiDeferredEventQueue : AllStatic {
static bool has_events() NOT_JVMTI_RETURN_(false);
static void enqueue(const JvmtiDeferredEvent& event) NOT_JVMTI_RETURN;
static JvmtiDeferredEvent dequeue() NOT_JVMTI_RETURN_(JvmtiDeferredEvent());
+ // Sweeper support to keep nmethods from being zombied while in the queue.
+ static void nmethods_do(CodeBlobClosure* cf);
+ // GC support to keep nmethod from being unloaded while in the queue.
+ static void oops_do(OopClosure* f, CodeBlobClosure* cf);
// Used to enqueue events without using a lock, for times (such as during
// safepoint) when we can't or don't want to lock the Service_lock.
diff --git a/hotspot/src/share/vm/runtime/serviceThread.cpp b/hotspot/src/share/vm/runtime/serviceThread.cpp
index c3a2b88a5..a2a32ad2b 100644
--- a/hotspot/src/share/vm/runtime/serviceThread.cpp
+++ b/hotspot/src/share/vm/runtime/serviceThread.cpp
@@ -34,6 +34,7 @@
#include "services/diagnosticFramework.hpp"
ServiceThread* ServiceThread::_instance = NULL;
+JvmtiDeferredEvent* ServiceThread::_jvmti_event = NULL;
void ServiceThread::initialize() {
EXCEPTION_MARK;
@@ -112,12 +113,15 @@ void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) {
}
if (has_jvmti_events) {
+ // Get the event under the Service_lock
jvmti_event = JvmtiDeferredEventQueue::dequeue();
+ _jvmti_event = &jvmti_event;
}
}
if (has_jvmti_events) {
- jvmti_event.post();
+ _jvmti_event->post();
+ _jvmti_event = NULL; // reset
}
if (sensors_changed) {
@@ -138,6 +142,26 @@ void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) {
}
}
-bool ServiceThread::is_service_thread(Thread* thread) {
- return thread == _instance;
+void ServiceThread::oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf) {
+ JavaThread::oops_do(f, cld_f, cf);
+ // The ServiceThread "owns" the JVMTI Deferred events, scan them here
+ // to keep them alive until they are processed.
+ if (cf != NULL) {
+ if (_jvmti_event != NULL) {
+ _jvmti_event->oops_do(f, cf);
+ }
+ MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
+ JvmtiDeferredEventQueue::oops_do(f, cf);
+ }
+}
+
+void ServiceThread::nmethods_do(CodeBlobClosure* cf) {
+ JavaThread::nmethods_do(cf);
+ if (cf != NULL) {
+ if (_jvmti_event != NULL) {
+ _jvmti_event->nmethods_do(cf);
+ }
+ MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
+ JvmtiDeferredEventQueue::nmethods_do(cf);
+ }
}
diff --git a/hotspot/src/share/vm/runtime/serviceThread.hpp b/hotspot/src/share/vm/runtime/serviceThread.hpp
index 42373e6f7..a9c219580 100644
--- a/hotspot/src/share/vm/runtime/serviceThread.hpp
+++ b/hotspot/src/share/vm/runtime/serviceThread.hpp
@@ -29,11 +29,13 @@
// A JavaThread for low memory detection support and JVMTI
// compiled-method-load events.
+class JvmtiDeferredEvent;
+
class ServiceThread : public JavaThread {
friend class VMStructs;
private:
-
static ServiceThread* _instance;
+ static JvmtiDeferredEvent* _jvmti_event;
static void service_thread_entry(JavaThread* thread, TRAPS);
ServiceThread(ThreadFunction entry_point) : JavaThread(entry_point) {};
@@ -43,9 +45,11 @@ class ServiceThread : public JavaThread {
// Hide this thread from external view.
bool is_hidden_from_external_view() const { return true; }
+ bool is_service_thread() const { return true; }
- // Returns true if the passed thread is the service thread.
- static bool is_service_thread(Thread* thread);
+ // GC support
+ void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf);
+ void nmethods_do(CodeBlobClosure* cf);
};
#endif // SHARE_VM_RUNTIME_SERVICETHREAD_HPP
diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp
index cc976182d..950c1b4fa 100644
--- a/hotspot/src/share/vm/runtime/thread.hpp
+++ b/hotspot/src/share/vm/runtime/thread.hpp
@@ -313,6 +313,7 @@ class Thread: public ThreadShadow {
virtual bool is_VM_thread() const { return false; }
virtual bool is_Java_thread() const { return false; }
virtual bool is_Compiler_thread() const { return false; }
+ virtual bool is_service_thread() const { return false; }
virtual bool is_hidden_from_external_view() const { return false; }
virtual bool is_jvmti_agent_thread() const { return false; }
// True iff the thread can perform GC operations at a safepoint.
--
2.22.0

View File

@ -0,0 +1,68 @@
From 30883daeac796c877a765cedee52f27f51444203 Mon Sep 17 00:00:00 2001
Date: Thu, 8 Sep 2022 10:22:32 +0800
Subject: 8200332: Improve GCM counting
Bug url: https://bugs.openjdk.org/browse/JDK-8200332
---
.../classes/com/sun/crypto/provider/GCTR.java | 31 ++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java b/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java
index 6a394e448..1ab0f63db 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java
@@ -29,6 +29,8 @@
package com.sun.crypto.provider;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
import javax.crypto.IllegalBlockSizeException;
import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE;
@@ -68,6 +70,15 @@ final class GCTR extends CounterMode {
return "GCTR";
}
+ // return the number of blocks until the lower 32 bits roll over
+ private long blocksUntilRollover() {
+ ByteBuffer buf = ByteBuffer.wrap(counter, counter.length - 4, 4);
+ buf.order(ByteOrder.BIG_ENDIAN);
+ long ctr32 = 0xFFFFFFFFL & buf.getInt();
+ long blocksLeft = (1L << 32) - ctr32;
+ return blocksLeft;
+ }
+
// input must be multiples of 128-bit blocks when calling update
int update(byte[] in, int inOfs, int inLen, byte[] out, int outOfs) {
if (inLen - inOfs > in.length) {
@@ -80,7 +91,25 @@ final class GCTR extends CounterMode {
throw new RuntimeException("output buffer too small");
}
- return encrypt(in, inOfs, inLen, out, outOfs);
+ long blocksLeft = blocksUntilRollover();
+ int numOfCompleteBlocks = inLen / AES_BLOCK_SIZE;
+ if (numOfCompleteBlocks >= blocksLeft) {
+ // Counter Mode encryption cannot be used because counter will
+ // roll over incorrectly. Use GCM-specific code instead.
+ byte[] encryptedCntr = new byte[AES_BLOCK_SIZE];
+ for (int i = 0; i < numOfCompleteBlocks; i++) {
+ embeddedCipher.encryptBlock(counter, 0, encryptedCntr, 0);
+ for (int n = 0; n < AES_BLOCK_SIZE; n++) {
+ int index = (i * AES_BLOCK_SIZE + n);
+ out[outOfs + index] =
+ (byte) ((in[inOfs + index] ^ encryptedCntr[n]));
+ }
+ GaloisCounterMode.increment32(counter);
+ }
+ return inLen;
+ } else {
+ return encrypt(in, inOfs, inLen, out, outOfs);
+ }
}
// input can be arbitrary size when calling doFinal
--
2.22.0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,237 @@
From d2d3408154beb52370ee8784767375a7cc8d325d Mon Sep 17 00:00:00 2001
Date: Wed, 21 Sep 2022 10:31:17 +0800
Subject: 8287109: Distrust.java failed with CertificateExpiredException
---
.../Symantec/Distrust.java | 26 +++++-
.../Symantec/appleistca2g1-chain.pem | 80 -------------------
.../Symantec/geotrustglobalca-chain.pem | 66 ---------------
3 files changed, 23 insertions(+), 149 deletions(-)
delete mode 100644 jdk/test/sun/security/ssl/X509TrustManagerImpl/Symantec/appleistca2g1-chain.pem
delete mode 100644 jdk/test/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustglobalca-chain.pem
diff --git a/jdk/test/sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java b/jdk/test/sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java
index d394f417..22266255 100644
--- a/jdk/test/sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java
+++ b/jdk/test/sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java
@@ -51,15 +51,14 @@ public class Distrust {
// Each of the roots have a test certificate chain stored in a file
// named "<root>-chain.pem".
private static String[] rootsToTest = new String[] {
- "geotrustglobalca", "geotrustprimarycag2", "geotrustprimarycag3",
+ "geotrustprimarycag2", "geotrustprimarycag3",
"geotrustuniversalca", "thawteprimaryrootca", "thawteprimaryrootcag2",
"thawteprimaryrootcag3", "verisignclass3g3ca", "verisignclass3g4ca",
"verisignclass3g5ca", "verisignuniversalrootca" };
// Each of the subCAs with a delayed distrust date have a test certificate
// chain stored in a file named "<subCA>-chain.pem".
- private static String[] subCAsToTest = new String[] {
- "appleistca2g1", "appleistca8g1" };
+ private static String[] subCAsToTest = new String[] {"appleistca8g1"};
// A date that is after the restrictions take affect
private static final Date APRIL_17_2019 =
@@ -177,6 +176,11 @@ public class Distrust {
throw new Exception("chain should be invalid");
}
} catch (CertificateException ce) {
+ // expired TLS certificates should not be treated as failure
+ if (expired(ce)) {
+ System.err.println("Test is N/A, chain is expired");
+ return;
+ }
if (valid) {
throw new Exception("Unexpected exception, chain " +
"should be valid", ce);
@@ -184,6 +188,7 @@ public class Distrust {
if (ce instanceof ValidatorException) {
ValidatorException ve = (ValidatorException)ce;
if (ve.getErrorType() != ValidatorException.T_UNTRUSTED_CERT) {
+ ce.printStackTrace(System.err);
throw new Exception("Unexpected exception: " + ce);
}
} else {
@@ -192,6 +197,21 @@ public class Distrust {
}
}
+ // check if a cause of exception is an expired cert
+ private static boolean expired(CertificateException ce) {
+ if (ce instanceof CertificateExpiredException) {
+ return true;
+ }
+ Throwable t = ce.getCause();
+ while (t != null) {
+ if (t instanceof CertificateExpiredException) {
+ return true;
+ }
+ t = t.getCause();
+ }
+ return false;
+ }
+
private static X509Certificate[] loadCertificateChain(String name)
throws Exception {
try (InputStream in = new FileInputStream(TEST_SRC + File.separator +
diff --git a/jdk/test/sun/security/ssl/X509TrustManagerImpl/Symantec/appleistca2g1-chain.pem b/jdk/test/sun/security/ssl/X509TrustManagerImpl/Symantec/appleistca2g1-chain.pem
deleted file mode 100644
index 0235631d..00000000
--- a/jdk/test/sun/security/ssl/X509TrustManagerImpl/Symantec/appleistca2g1-chain.pem
+++ /dev/null
@@ -1,80 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIGGzCCBQOgAwIBAgIITJltLCqcD0gwDQYJKoZIhvcNAQELBQAwYjEcMBoGA1UE
-AxMTQXBwbGUgSVNUIENBIDIgLSBHMTEgMB4GA1UECxMXQ2VydGlmaWNhdG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aszPeE4uwc2hGKceeoW
-MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA
-ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l
-uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn
-Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS
-tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF
-PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un
-hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV
-5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw==
------END CERTIFICATE-----
diff --git a/jdk/test/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustglobalca-chain.pem b/jdk/test/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustglobalca-chain.pem
deleted file mode 100644
index 3249716b..00000000
--- a/jdk/test/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustglobalca-chain.pem
+++ /dev/null
@@ -1,66 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIHBjCCBe6gAwIBAgIQanINWwJAuap0V7lFjnfUwTANBgkqhkiG9w0BAQsFADBE
-MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMU
-R2VvVHJ1c3QgU1NMIENBIC0gRzMwHhcNMTcwNTAzMDAwMDAwWhcNMjAwNTAyMjM1
-OTU5WjCBkTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNV
-BAcMDU1vdW50YWluIFZpZXcxFzAVBgNVB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TAYDVR0gBEUw
-QzBBBgpghkgBhvhFAQc2MDMwMQYIKwYBBQUHAgEWJWh0dHA6Ly93d3cuZ2VvdHJ1
-c3QuY29tL3Jlc291cmNlcy9jcHMwKQYDVR0RBCIwIKQeMBwxGjAYBgNVBAMTEVN5
-bWFudGVjUEtJLTEtNTM5MA0GCSqGSIb3DQEBCwUAA4IBAQCg1Pcs+3QLf2TxzUNq
-n2JTHAJ8mJCi7k9o1CAacxI+d7NQ63K87oi+fxfqd4+DYZVPhKHLMk9sIb7SaZZ9
-Y73cK6gf0BOEcP72NZWJ+aZ3sEbIu7cT9clgadZM/tKO79NgwYCA4ef7i28heUrg
-3Kkbwbf7w0lZXLV3B0TUl/xJAIlvBk4BcBmsLxHA4uYPL4ZLjXvDuacu9PGsFj45
-SVGeF0tPEDpbpaiSb/361gsDTUdWVxnzy2v189bPsPX1oxHSIFMTNDcFLENaY9+N
-QNaFHlHpURceA1bJ8TCt55sRornQMYGbaLHZ6PPmlH7HrhMvh+3QJbBo+d4IWvMp
-zNSS
------END CERTIFICATE-----
--
2.22.0

View File

@ -0,0 +1,145 @@
diff --git a/hotspot/src/share/vm/opto/stringopts.cpp b/hotspot/src/share/vm/opto/stringopts.cpp
index d92a3d7a3..2d11b2257 100644
--- a/hotspot/src/share/vm/opto/stringopts.cpp
+++ b/hotspot/src/share/vm/opto/stringopts.cpp
@@ -968,6 +968,21 @@ bool StringConcat::validate_control_flow() {
fail = true;
break;
} else if (ptr->is_Proj() && ptr->in(0)->is_Initialize()) {
+ // Check for side effect between Initialize and the constructor
+ for (SimpleDUIterator iter(ptr); iter.has_next(); iter.next()) {
+ Node* use = iter.get();
+ if (!use->is_CFG() && !use->is_CheckCastPP() && !use->is_Load()) {
+#ifndef PRODUCT
+ if (PrintOptimizeStringConcat) {
+ tty->print_cr("unexpected control use of Initialize");
+ ptr->in(0)->dump(); // Initialize node
+ use->dump(1);
+ }
+#endif
+ fail = true;
+ break;
+ }
+ }
ptr = ptr->in(0)->in(0);
} else if (ptr->is_Region()) {
Node* copy = ptr->as_Region()->is_copy();
diff --git a/hotspot/test/compiler/stringopts/SideEffectBeforeConstructor.jasm b/hotspot/test/compiler/stringopts/SideEffectBeforeConstructor.jasm
new file mode 100644
index 000000000..cbc6d754b
--- /dev/null
+++ b/hotspot/test/compiler/stringopts/SideEffectBeforeConstructor.jasm
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 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
+ * 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.
+ */
+
+super public class compiler/stringopts/SideEffectBeforeConstructor
+ version 51:0
+{
+ public static Field result:I;
+
+ static Method "<clinit>":"()V"
+ stack 2 locals 0
+ {
+ iconst_0;
+ putstatic Field result:"I";
+ return;
+ }
+ public Method "<init>":"()V"
+ stack 1 locals 1
+ {
+ aload_0;
+ invokespecial Method java/lang/Object."<init>":"()V";
+ return;
+ }
+
+ public static Method test:"(Ljava/lang/String;)V"
+ stack 4 locals 1
+ {
+ new class java/lang/StringBuffer;
+ dup;
+ getstatic Field result:"I";
+ iconst_1;
+ iadd;
+ putstatic Field result:"I";
+ aload_0;
+ invokespecial Method java/lang/StringBuffer."<init>":"(Ljava/lang/String;)V";
+ invokevirtual Method java/lang/StringBuffer.toString:"()Ljava/lang/String;";
+ return;
+ }
+}
diff --git a/hotspot/test/compiler/stringopts/TestSideEffectBeforeConstructor.java b/hotspot/test/compiler/stringopts/TestSideEffectBeforeConstructor.java
new file mode 100644
index 000000000..86c5eca1d
--- /dev/null
+++ b/hotspot/test/compiler/stringopts/TestSideEffectBeforeConstructor.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 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
+ * 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 8290705
+ * @summary Test correctness of the string concatenation optimization with
+ * a store between StringBuffer allocation and constructor invocation.
+ * @compile SideEffectBeforeConstructor.jasm
+ * @run main/othervm -Xbatch compiler.stringopts.TestSideEffectBeforeConstructor
+ */
+
+package compiler.stringopts;
+
+public class TestSideEffectBeforeConstructor {
+
+ public static void main(String[] args) {
+ for (int i = 0; i < 100_000; ++i) {
+ try {
+ SideEffectBeforeConstructor.test(null);
+ } catch (NullPointerException npe) {
+ // Expected
+ }
+ }
+ if (SideEffectBeforeConstructor.result != 100_000) {
+ throw new RuntimeException("Unexpected result: " + SideEffectBeforeConstructor.result);
+ }
+ }
+}

8657
Dynamic-CDS-Archive.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -116,34 +116,6 @@ index c27a534ef..f75501dba 100644
JVM_END
JVM_ENTRY(void, JVM_Yield(JNIEnv *env, jclass threadClass))
diff --git a/hotspot/src/share/vm/prims/jvmtiImpl.hpp b/hotspot/src/share/vm/prims/jvmtiImpl.hpp
index d74789451..ec721ca20 100644
--- a/hotspot/src/share/vm/prims/jvmtiImpl.hpp
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.hpp
@@ -493,9 +493,9 @@ class JvmtiDeferredEvent VALUE_OBJ_CLASS_SPEC {
// Actually posts the event.
void post() NOT_JVMTI_RETURN;
// Sweeper support to keep nmethods from being zombied while in the queue.
- void nmethods_do(CodeBlobClosure* cf);
+ void nmethods_do(CodeBlobClosure* cf) NOT_JVMTI_RETURN;
// GC support to keep nmethod from being unloaded while in the queue.
- void oops_do(OopClosure* f, CodeBlobClosure* cf);
+ void oops_do(OopClosure* f, CodeBlobClosure* cf) NOT_JVMTI_RETURN;
};
/**
@@ -534,9 +534,9 @@ class JvmtiDeferredEventQueue : AllStatic {
static void enqueue(const JvmtiDeferredEvent& event) NOT_JVMTI_RETURN;
static JvmtiDeferredEvent dequeue() NOT_JVMTI_RETURN_(JvmtiDeferredEvent());
// Sweeper support to keep nmethods from being zombied while in the queue.
- static void nmethods_do(CodeBlobClosure* cf);
+ static void nmethods_do(CodeBlobClosure* cf) NOT_JVMTI_RETURN;
// GC support to keep nmethod from being unloaded while in the queue.
- static void oops_do(OopClosure* f, CodeBlobClosure* cf);
+ static void oops_do(OopClosure* f, CodeBlobClosure* cf) NOT_JVMTI_RETURN;
// Used to enqueue events without using a lock, for times (such as during
// safepoint) when we can't or don't want to lock the Service_lock.
diff --git a/hotspot/src/share/vm/runtime/memprofiler.cpp b/hotspot/src/share/vm/runtime/memprofiler.cpp
index ddb22601f..a956c5252 100644
--- a/hotspot/src/share/vm/runtime/memprofiler.cpp

View File

@ -1,5 +1,17 @@
From 4e520a51acbb192a0df844fcca247998d7fb8854 Mon Sep 17 00:00:00 2001
From: wangkun <wangkun49@huawei.com>
Date: Thu, 28 Jul 2022 17:19:32 +0800
Subject: [PATCH 2/3] add
Improve-AlgorithmConstraints-checkAlgorithm-performa.patch
---
.../util/AbstractAlgorithmConstraints.java | 30 +++++++------------
.../util/DisabledAlgorithmConstraints.java | 20 +++++++++----
.../util/LegacyAlgorithmConstraints.java | 12 ++++++--
3 files changed, 35 insertions(+), 27 deletions(-)
diff --git a/jdk/src/share/classes/sun/security/util/AbstractAlgorithmConstraints.java b/jdk/src/share/classes/sun/security/util/AbstractAlgorithmConstraints.java
index 944958de4..5c7602925 100644
index 944958de..5c760292 100644
--- a/jdk/src/share/classes/sun/security/util/AbstractAlgorithmConstraints.java
+++ b/jdk/src/share/classes/sun/security/util/AbstractAlgorithmConstraints.java
@@ -77,34 +77,26 @@ public abstract class AbstractAlgorithmConstraints
@ -49,7 +61,7 @@ index 944958de4..5c7602925 100644
return true;
diff --git a/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java b/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
index 51e625632..6ff26bf2f 100644
index 51e62563..6ff26bf2 100644
--- a/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
+++ b/jdk/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
@@ -96,7 +96,7 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints {
@ -99,7 +111,7 @@ index 51e625632..6ff26bf2f 100644
/*
diff --git a/jdk/src/share/classes/sun/security/util/LegacyAlgorithmConstraints.java b/jdk/src/share/classes/sun/security/util/LegacyAlgorithmConstraints.java
index 4e7502fb5..01d0447ab 100644
index 4e7502fb..01d0447a 100644
--- a/jdk/src/share/classes/sun/security/util/LegacyAlgorithmConstraints.java
+++ b/jdk/src/share/classes/sun/security/util/LegacyAlgorithmConstraints.java
@@ -28,6 +28,7 @@ package sun.security.util;
@ -132,3 +144,6 @@ index 4e7502fb5..01d0447ab 100644
}
@Override
--
2.22.0

View File

@ -0,0 +1,529 @@
From 0a877e963eeb55b98dcd0194ac44b4f010d382eb Mon Sep 17 00:00:00 2001
Date: Wed, 21 Sep 2022 09:54:56 +0800
Subject: The code style is fixed and test cases are added
---
hotspot/src/share/vm/cds/archiveBuilder.hpp | 1 -
hotspot/src/share/vm/cds/archiveUtils.hpp | 1 -
hotspot/src/share/vm/cds/dynamicArchive.hpp | 1 -
.../share/vm/classfile/systemDictionary.cpp | 2 +-
.../vm/classfile/systemDictionaryShared.hpp | 1 +
.../shared/parGCAllocBuffer.cpp | 6 +-
hotspot/src/share/vm/memory/filemap.cpp | 7 +-
hotspot/src/share/vm/memory/filemap.hpp | 2 +-
.../src/share/vm/memory/metaspaceClosure.cpp | 25 +
.../src/share/vm/memory/metaspaceClosure.hpp | 25 +-
hotspot/src/share/vm/oops/cpCache.cpp | 1 -
hotspot/src/share/vm/oops/instanceKlass.cpp | 4 -
hotspot/test/runtime/6929067/Test6929067.sh | 2 +-
.../runtime/InitialThreadOverflow/testme.sh | 2 +-
hotspot/test/runtime/Thread/StopAtExit.java | 119 ++++
jdk/make/profile-rtjar-includes.txt | 7 +-
.../classes/java/io/ObjectInputStream.java | 4 +-
.../classes/java/io/ObjectOutputStream.java | 10 +-
.../classes/sun/awt/FontConfiguration.java | 7 +-
.../security/openssl/kae_cipher_rsa.c | 3 +-
.../security/openssl/kae_keyagreement_dh.c | 4 +-
.../openssl/RSAKeyPairGeneratorBenchmark.java | 2 +-
23 files changed, 194 insertions(+), 668 deletions(-)
create mode 100644 hotspot/test/runtime/Thread/StopAtExit.java
diff --git a/hotspot/src/share/vm/cds/archiveBuilder.hpp b/hotspot/src/share/vm/cds/archiveBuilder.hpp
index f7a5c107..93c0e245 100644
--- a/hotspot/src/share/vm/cds/archiveBuilder.hpp
+++ b/hotspot/src/share/vm/cds/archiveBuilder.hpp
@@ -29,7 +29,6 @@
#include "cds/archiveUtils.hpp"
#include "cds/dumpAllocStats.hpp"
#include "memory/metaspaceClosure.hpp"
-//#include "oops/array.hpp"
#include "oops/klass.hpp"
#include "runtime/os.hpp"
#include "utilities/align.hpp"
diff --git a/hotspot/src/share/vm/cds/archiveUtils.hpp b/hotspot/src/share/vm/cds/archiveUtils.hpp
index 55c2431a..44f03c8e 100644
--- a/hotspot/src/share/vm/cds/archiveUtils.hpp
+++ b/hotspot/src/share/vm/cds/archiveUtils.hpp
@@ -133,7 +133,6 @@ public:
_dump_region->append_intptr_t((intptr_t)tag);
}
- //void do_oop(oop* o);
void do_region(u_char* start, size_t size);
bool reading() const { return false; }
};
diff --git a/hotspot/src/share/vm/cds/dynamicArchive.hpp b/hotspot/src/share/vm/cds/dynamicArchive.hpp
index 1d5b7122..0e068e65 100644
--- a/hotspot/src/share/vm/cds/dynamicArchive.hpp
+++ b/hotspot/src/share/vm/cds/dynamicArchive.hpp
@@ -26,7 +26,6 @@
#ifndef SHARE_VM_CDS_DYNAMICARCHIVE_HPP
#define SHARE_VM_CDS_DYNAMICARCHIVE_HPP
-//#include "classfile/compactHashtable.hpp"
#include "memory/allocation.hpp"
#include "memory/filemap.hpp"
#include "memory/memRegion.hpp"
diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp
index 2eebdbac..0ea2d9b7 100644
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp
@@ -1344,7 +1344,7 @@ instanceKlassHandle SystemDictionary::load_shared_class(
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,
+ // 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,
diff --git a/hotspot/src/share/vm/classfile/systemDictionaryShared.hpp b/hotspot/src/share/vm/classfile/systemDictionaryShared.hpp
index 36423bee..fb9583d4 100644
--- a/hotspot/src/share/vm/classfile/systemDictionaryShared.hpp
+++ b/hotspot/src/share/vm/classfile/systemDictionaryShared.hpp
@@ -194,6 +194,7 @@ public:
}
return true;
}
+
static size_t estimate_size_for_archive();
static void write_to_archive();
static void write_dictionary(RunTimeSharedDictionary* dictionary, bool is_builtin);
diff --git a/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp b/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp
index bddf14b6..0244bf84 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp
@@ -98,9 +98,9 @@ void PLABStats::adjust_desired_plab_sz(uint no_of_gc_workers) {
if (_allocated == 0) {
assert(_unused == 0,
err_msg("Inconsistency in PLAB stats: "
- "_allocated: "SIZE_FORMAT", "
- "_wasted: "SIZE_FORMAT", "
- "_unused: "SIZE_FORMAT", "
+ "_allocated: " SIZE_FORMAT ", "
+ "_wasted: " SIZE_FORMAT ", "
+ "_unused: " SIZE_FORMAT ", "
"_used : "SIZE_FORMAT,
_allocated, _wasted, _unused, _used));
diff --git a/hotspot/src/share/vm/memory/filemap.cpp b/hotspot/src/share/vm/memory/filemap.cpp
index 1891fc80..0682cd67 100644
--- a/hotspot/src/share/vm/memory/filemap.cpp
+++ b/hotspot/src/share/vm/memory/filemap.cpp
@@ -240,12 +240,7 @@ void FileMapInfo::FileMapHeader::populate(FileMapInfo* mapinfo, size_t alignment
_version = current_version();
_alignment = alignment;
_obj_alignment = ObjectAlignmentInBytes;
- /* TODO
- _compressed_oops = UseCompressedOops;
- _compressed_class_ptrs = UseCompressedClassPointers;
- _max_heap_size = MaxHeapSize;
- _narrow_klass_shift = CompressedKlassPointers::shift();
- */
+
if (!DynamicDumpSharedSpaces) {
_classpath_entry_table_size = mapinfo->_classpath_entry_table_size;
_classpath_entry_table = mapinfo->_classpath_entry_table;
diff --git a/hotspot/src/share/vm/memory/filemap.hpp b/hotspot/src/share/vm/memory/filemap.hpp
index 36b27f13..27fff35e 100644
--- a/hotspot/src/share/vm/memory/filemap.hpp
+++ b/hotspot/src/share/vm/memory/filemap.hpp
@@ -232,7 +232,7 @@ public:
char* region_end(int i) { return region_base(i) + used_aligned(i); }
struct FileMapHeader* header() { return _header; }
struct DynamicArchiveHeader* dynamic_header() {
- // assert(!is_static(), "must be");
+
return (struct DynamicArchiveHeader*)header();
}
diff --git a/hotspot/src/share/vm/memory/metaspaceClosure.cpp b/hotspot/src/share/vm/memory/metaspaceClosure.cpp
index 00ec8fce..e19402cb 100644
--- a/hotspot/src/share/vm/memory/metaspaceClosure.cpp
+++ b/hotspot/src/share/vm/memory/metaspaceClosure.cpp
@@ -1,3 +1,28 @@
+/*
+ * Copyright (c) 2019, 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.
+ *
+ * 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.
+ *
+ */
+
#include "precompiled.hpp"
#include "memory/metaspaceClosure.hpp"
diff --git a/hotspot/src/share/vm/memory/metaspaceClosure.hpp b/hotspot/src/share/vm/memory/metaspaceClosure.hpp
index f67d8d6f..5422e2a0 100644
--- a/hotspot/src/share/vm/memory/metaspaceClosure.hpp
+++ b/hotspot/src/share/vm/memory/metaspaceClosure.hpp
@@ -1,4 +1,27 @@
-
+/*
+ * Copyright (c) 2019, 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.
+ *
+ * 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.
+ *
+ */
#ifndef SHARE_VM_MEMORY_METASPACECLOSURE_HPP
#define SHARE_VM_MEMORY_METASPACECLOSURE_HPP
diff --git a/hotspot/src/share/vm/oops/cpCache.cpp b/hotspot/src/share/vm/oops/cpCache.cpp
index 51f5397b..874cef41 100644
--- a/hotspot/src/share/vm/oops/cpCache.cpp
+++ b/hotspot/src/share/vm/oops/cpCache.cpp
@@ -610,7 +610,6 @@ void ConstantPoolCache::metaspace_pointers_do(MetaspaceClosure* it) {
dynamic_cds_log->print_cr("Iter(ConstantPoolCache): %p", this);
}
it->push(&_constant_pool);
- // it->push(&_reference_map);
}
void ConstantPoolCache::remove_unshareable_info() {
diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp
index 9276b895..2a9cd92d 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp
@@ -526,10 +526,6 @@ void InstanceKlass::metaspace_pointers_do(MetaspaceClosure* it) {
}
}
}
-
- // it->push(&_nest_members);
- // it->push(&_permitted_subclasses);
- // it->push(&_record_components);
}
klassVtable* InstanceKlass::vtable() const {
diff --git a/hotspot/test/runtime/6929067/Test6929067.sh b/hotspot/test/runtime/6929067/Test6929067.sh
index 438a287c..c78e1787 100644
--- a/hotspot/test/runtime/6929067/Test6929067.sh
+++ b/hotspot/test/runtime/6929067/Test6929067.sh
@@ -102,7 +102,7 @@ esac
if [ "${VM_CPU}" == "aarch64" ]; then
- COMP_FLAG="-mabi=lp64"
+ COMP_FLAG=""
fi
# VM type: need to know server or client
diff --git a/hotspot/test/runtime/InitialThreadOverflow/testme.sh b/hotspot/test/runtime/InitialThreadOverflow/testme.sh
index ffd7d6e3..cf48c2fe 100644
--- a/hotspot/test/runtime/InitialThreadOverflow/testme.sh
+++ b/hotspot/test/runtime/InitialThreadOverflow/testme.sh
@@ -52,7 +52,7 @@ fi
CFLAGS="-m${VM_BITS}"
if [ "${VM_CPU}" == "aarch64" ]; then
- CFLAGS="-mabi=lp64"
+ CFLAGS=""
fi
LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${VM_CPU}/${VM_TYPE}:/usr/lib:$LD_LIBRARY_PATH
diff --git a/hotspot/test/runtime/Thread/StopAtExit.java b/hotspot/test/runtime/Thread/StopAtExit.java
new file mode 100644
index 00000000..8d6344a6
--- /dev/null
+++ b/hotspot/test/runtime/Thread/StopAtExit.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2017, 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 8167108
+ * @summary Stress test java.lang.Thread.stop() at thread exit.
+ * @run main/othervm StopAtExit
+ */
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+public class StopAtExit extends Thread {
+ final static int N_THREADS = 32;
+ final static int N_LATE_CALLS = 1000;
+
+ public CountDownLatch exitSyncObj = new CountDownLatch(1);
+ public CountDownLatch startSyncObj = new CountDownLatch(1);
+
+ @Override
+ public void run() {
+ try {
+ // Tell main thread we have started.
+ startSyncObj.countDown();
+ try {
+ // Wait for main thread to interrupt us so we
+ // can race to exit.
+ exitSyncObj.await();
+ } catch (InterruptedException e) {
+ // ignore because we expect one
+ }
+ } catch (ThreadDeath td) {
+ // ignore because we're testing Thread.stop() which throws it
+ } catch (NoClassDefFoundError ncdfe) {
+ // ignore because we're testing Thread.stop() which can cause it
+ }
+ }
+
+ public static void main(String[] args) {
+ StopAtExit threads[] = new StopAtExit[N_THREADS];
+
+ for (int i = 0; i < N_THREADS; i++ ) {
+ threads[i] = new StopAtExit();
+ int late_count = 1;
+ threads[i].start();
+ try {
+ // Wait for the worker thread to get going.
+ threads[i].startSyncObj.await();
+
+ // This interrupt() call will break the worker out
+ // of the exitSyncObj.await() call and the stop()
+ // calls will come in during thread exit.
+ threads[i].interrupt();
+ for (; late_count <= N_LATE_CALLS; late_count++) {
+ threads[i].stop();
+
+ if (!threads[i].isAlive()) {
+ // Done with Thread.stop() calls since
+ // thread is not alive.
+ break;
+ }
+ }
+ } catch (InterruptedException e) {
+ throw new Error("Unexpected: " + e);
+ } catch (NoClassDefFoundError ncdfe) {
+ // Ignore because we're testing Thread.stop() which can
+ // cause it. Yes, a NoClassDefFoundError that happens
+ // in a worker thread can subsequently be seen in the
+ // main thread.
+ }
+
+ System.out.println("INFO: thread #" + i + ": made " + late_count +
+ " late calls to java.lang.Thread.stop()");
+ System.out.println("INFO: thread #" + i + ": N_LATE_CALLS==" +
+ N_LATE_CALLS + " value is " +
+ ((late_count >= N_LATE_CALLS) ? "NOT " : "") +
+ "large enough to cause a Thread.stop() " +
+ "call after thread exit.");
+
+ try {
+ threads[i].join();
+ } catch (InterruptedException e) {
+ throw new Error("Unexpected: " + e);
+ }
+ threads[i].stop();
+ if (threads[i].isAlive()) {
+ throw new Error("Expected !Thread.isAlive() after thread #" +
+ i + " has been join()'ed");
+ }
+ }
+
+ String cmd = System.getProperty("sun.java.command");
+ if (cmd != null && !cmd.startsWith("com.sun.javatest.regtest.agent.MainWrapper")) {
+ // Exit with success in a non-JavaTest environment:
+ System.exit(0);
+ }
+ }
+}
diff --git a/jdk/make/profile-rtjar-includes.txt b/jdk/make/profile-rtjar-includes.txt
index f36d1d5c..dd275590 100644
--- a/jdk/make/profile-rtjar-includes.txt
+++ b/jdk/make/profile-rtjar-includes.txt
@@ -73,8 +73,8 @@ PROFILE_1_RTJAR_INCLUDE_PACKAGES := \
PROFILE_1_RTJAR_INCLUDE_TYPES :=
-PROFILE_1_RTJAR_EXCLUDE_TYPES :=
-
+PROFILE_1_RTJAR_EXCLUDE_TYPES := \
+ com/huawei
PROFILE_1_INCLUDE_METAINF_SERVICES :=
@@ -99,7 +99,8 @@ PROFILE_2_RTJAR_INCLUDE_PACKAGES := \
PROFILE_2_RTJAR_INCLUDE_TYPES :=
-PROFILE_2_RTJAR_EXCLUDE_TYPES :=
+PROFILE_2_RTJAR_EXCLUDE_TYPES := \
+ com/huawei
PROFILE_2_INCLUDE_METAINF_SERVICES := \
META-INF/services/sun.util.spi.XmlPropertiesProvider
diff --git a/jdk/src/share/classes/java/io/ObjectInputStream.java b/jdk/src/share/classes/java/io/ObjectInputStream.java
index af6c5dd6..85e3958b 100644
--- a/jdk/src/share/classes/java/io/ObjectInputStream.java
+++ b/jdk/src/share/classes/java/io/ObjectInputStream.java
@@ -768,7 +768,7 @@ public class ObjectInputStream
* Cache the class meta during serialization.
* Only used in FastSerilizer.
*/
- protected static ConcurrentHashMap<String,Class<?>> nameToClass = new ConcurrentHashMap<>();
+ private static ConcurrentHashMap<String,Class<?>> nameToClass = new ConcurrentHashMap<>();
/**
* Load the local class equivalent of the specified stream class
@@ -1013,7 +1013,7 @@ public class ObjectInputStream
if (s0 != STREAM_MAGIC) {
throw new StreamCorruptedException(
- String.format("invalid stream header: %04X%04X, and FastSerializer is activated", s0, s1));
+ String.format("invalid stream header: %04X%04X", s0, s1));
}
if (!fastSerializerEscapeMode) {
diff --git a/jdk/src/share/classes/java/io/ObjectOutputStream.java b/jdk/src/share/classes/java/io/ObjectOutputStream.java
index 840f7fdc..23c1fff5 100644
--- a/jdk/src/share/classes/java/io/ObjectOutputStream.java
+++ b/jdk/src/share/classes/java/io/ObjectOutputStream.java
@@ -234,11 +234,6 @@ public class ObjectOutputStream
new sun.security.action.GetBooleanAction(
"sun.io.serialization.extendedDebugInfo")).booleanValue();
- /**
- * Magic number that is written to the stream header when using fastserilizer.
- */
- private static final short STREAM_MAGIC_FAST = (short)0xdeca;
-
private static final Unsafe UNSAFE = Unsafe.getUnsafe();
/**
@@ -255,6 +250,11 @@ public class ObjectOutputStream
new sun.security.action.GetBooleanAction(
"printFastSerializer")).booleanValue();
+ /**
+ * Magic number that is written to the stream header when using fastserilizer.
+ */
+ private static final short STREAM_MAGIC_FAST = (short)0xdeca;
+
/**
* Creates an ObjectOutputStream that writes to the specified OutputStream.
* This constructor writes the serialization stream header to the
diff --git a/jdk/src/share/classes/sun/awt/FontConfiguration.java b/jdk/src/share/classes/sun/awt/FontConfiguration.java
index 93e38e06..c2e94d15 100644
--- a/jdk/src/share/classes/sun/awt/FontConfiguration.java
+++ b/jdk/src/share/classes/sun/awt/FontConfiguration.java
@@ -300,12 +300,7 @@ public abstract class FontConfiguration {
}
}
foundOsSpecificFile = false;
-
- configFile = findImpl(baseName);
- if (configFile != null) {
- return configFile;
- }
- return null;
+ return (configFile = findImpl(baseName));
}
/* Initialize the internal data tables from binary format font
diff --git a/jdk/src/solaris/native/org/openeuler/security/openssl/kae_cipher_rsa.c b/jdk/src/solaris/native/org/openeuler/security/openssl/kae_cipher_rsa.c
index 73b94cbe..d9b16ab9 100644
--- a/jdk/src/solaris/native/org/openeuler/security/openssl/kae_cipher_rsa.c
+++ b/jdk/src/solaris/native/org/openeuler/security/openssl/kae_cipher_rsa.c
@@ -174,6 +174,7 @@ static int RSACryptOAEPPadding(JNIEnv* env, jlong keyAddress, jint inLen, jbyteA
jbyte* inBytes = NULL;
// outLen type should be size_t
// EVP_PKEY_encrypt takes the outLen address as a parameter, and the parameter type is size_t*
+ // You can refer to the issue #2774 to see more content
size_t outLen = 0;
ENGINE* kaeEngine = GetEngineByAlgorithmIndex(RSA_INDEX);
KAE_TRACE("RSACryptOAEPPadding: kaeEngine => %p", kaeEngine);
@@ -366,7 +367,7 @@ JNIEXPORT jlong JNICALL Java_org_openeuler_security_openssl_KAERSACipher_nativeC
}
// set rsa public key params n and e
- if(RSA_set0_key(rsa, bnN, bnE, NULL) <= 0) {
+ if (RSA_set0_key(rsa, bnN, bnE, NULL) <= 0) {
KAE_ThrowFromOpenssl(env, "RSA_set0_key", KAE_ThrowRuntimeException);
goto cleanup;
}
diff --git a/jdk/src/solaris/native/org/openeuler/security/openssl/kae_keyagreement_dh.c b/jdk/src/solaris/native/org/openeuler/security/openssl/kae_keyagreement_dh.c
index 90b33045..d8d2ee7c 100644
--- a/jdk/src/solaris/native/org/openeuler/security/openssl/kae_keyagreement_dh.c
+++ b/jdk/src/solaris/native/org/openeuler/security/openssl/kae_keyagreement_dh.c
@@ -131,9 +131,9 @@ cleanup:
if (g_bn != NULL)
KAE_ReleaseBigNumFromByteArray(g_bn);
if (secret != NULL)
- free(secret);
+ free(secret);
if (computeKeyRetBn != NULL)
- BN_free(computeKeyRetBn);
+ BN_free(computeKeyRetBn);
return retByteArray;
}
diff --git a/jdk/test/micro/org/openeuler/bench/security/openssl/RSAKeyPairGeneratorBenchmark.java b/jdk/test/micro/org/openeuler/bench/security/openssl/RSAKeyPairGeneratorBenchmark.java
index b1739222..13d3e8cf 100644
--- a/jdk/test/micro/org/openeuler/bench/security/openssl/RSAKeyPairGeneratorBenchmark.java
+++ b/jdk/test/micro/org/openeuler/bench/security/openssl/RSAKeyPairGeneratorBenchmark.java
@@ -54,7 +54,7 @@ public class RSAKeyPairGeneratorBenchmark extends BenchmarkBase {
public KeyPair generateKeyPair() throws Exception {
return keyPairGenerator.generateKeyPair();
}
-
+
private KeyPairGenerator createKeyPairGenerator() throws Exception {
if (prov != null) {
return KeyPairGenerator.getInstance(algorithm, prov);
--
2.22.0

View File

@ -17,7 +17,7 @@ index f20bf3d2b..3ab82c5c4 100644
+ if (DumpSharedSpaces) {
+ tty->print_cr("failed: must not create anonymous classes when dumping.");
+ JVM_Exit(0);
+ JVM_Halt(0);
+ }
+
if (UsePerfData) {

View File

@ -224,7 +224,7 @@ index 17447587..d2095e63 100644
+ 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);
+ JVM_Halt(0);
+ }
+ tty->print_cr("You are using file lock %s in concurrent mode", AppCDSLockFile);
+ }

View File

@ -0,0 +1,111 @@
From 59040a3951dfdf21ba646cc9510739f175751469 Mon Sep 17 00:00:00 2001
Date: Wed, 21 Sep 2022 09:54:04 +0800
Subject: [PATCH 2/5] add configuration option of huawei internal version shown in release file
---
common/autoconf/generated-configure.sh | 17 +++++++++++++++++
common/autoconf/jdk-options.m4 | 11 +++++++++++
common/autoconf/spec.gmk.in | 3 +++
jdk/make/Images.gmk | 1 +
4 files changed, 32 insertions(+)
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 53e6cf18..a6ba1ac9 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -831,6 +831,7 @@ COPYRIGHT_YEAR
VENDOR_URL_VM_BUG
VENDOR_URL_BUG
VENDOR_URL
+INTERNAL_VERSION
COMPANY_NAME
MACOSX_BUNDLE_ID_BASE
MACOSX_BUNDLE_NAME_BASE
@@ -1077,6 +1078,7 @@ with_vendor_url
with_vendor_bug_url
with_vendor_vm_bug_url
with_copyright_year
+with_internal_version
with_boot_jdk
with_boot_jdk_jvmargs
with_add_source_root
@@ -1937,6 +1939,9 @@ Optional Packages:
--with-vendor-vm-bug-url
Sets the bug URL which will be displayed when the VM
crashes [not specified]
+ --with-internal-version
+ Sets the internal version which will be
+ displayed in the release file [not specified]
--with-copyright-year Set copyright year value for build [current year]
--with-boot-jdk path to Boot JDK (used to bootstrap build) [probed]
--with-boot-jdk-jvmargs specify JVM arguments to be passed to all
@@ -20301,6 +20306,18 @@ fi
COPYRIGHT_YEAR=`date +'%Y'`
fi
+# Check whether --with-internal-version was given.
+if test "${with_internal_version+set}" = set; then :
+ withval=$with_internal_version;
+fi
+
+ if test "x$with_internal_version" = xyes; then
+ as_fn_error $? "--with-internal-version must have a value" "$LINENO" 5
+ elif ! [[ $with_internal_version =~ ^[[:print:]]*$ ]] ; then
+ as_fn_error $? "--with-internal-version contains non-printing characters: $with_internal_version" "$LINENO" 5
+ else
+ INTERNAL_VERSION="$with_internal_version"
+ fi
if test "x$JDK_UPDATE_VERSION" != x; then
JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}"
diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4
index c506086d..b9f25175 100644
--- a/common/autoconf/jdk-options.m4
+++ b/common/autoconf/jdk-options.m4
@@ -627,6 +627,17 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
fi
AC_SUBST(COPYRIGHT_YEAR)
+ AC_ARG_WITH(internal-version, [AS_HELP_STRING([--with-internal-version],
+ [Sets the internal version which will be displayed in the release file @<:@not specified@:>@])])
+ if test "x$with_internal_version" = xyes; then
+ AC_MSG_ERROR([--with-internal-version must have a value])
+ elif [ ! [[ $with_internal_version =~ ^[[:print:]]*$ ]] ]; then
+ AC_MSG_ERROR([--with-internal-version contains non-printing characters: $with_internal_version])
+ else
+ INTERNAL_VERSION="$with_internal_version"
+ fi
+ AC_SUBST(INTERNAL_VERSION)
+
if test "x$JDK_UPDATE_VERSION" != x; then
JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}"
else
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index 79248cbf..ca5e2d74 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -162,6 +162,9 @@ VENDOR_URL:=@VENDOR_URL@
VENDOR_URL_BUG:=@VENDOR_URL_BUG@
VENDOR_URL_VM_BUG:=@VENDOR_URL_VM_BUG@
+# Huawei internal version for use in release file.
+INTERNAL_VERSION:=@INTERNAL_VERSION@
+
# Location where build customization files may be found
CUSTOM_MAKE_DIR:=@CUSTOM_MAKE_DIR@
diff --git a/jdk/make/Images.gmk b/jdk/make/Images.gmk
index ac39ad33..233ce703 100644
--- a/jdk/make/Images.gmk
+++ b/jdk/make/Images.gmk
@@ -618,6 +618,7 @@ define create-info-file
$(call info-file-item, "OS_ARCH", "$(OPENJDK_TARGET_CPU_LEGACY)")
if [ -n "$(JDK_ARCH_ABI_PROP_NAME)" ]; then $(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"); fi
$(call info-file-item, "SOURCE", "$(strip $(SOURCE_REVISION))")
+ if [ -n "$(INTERNAL_VERSION)" ]; then $(call info-file-item, "INTERNAL_VERSION", "$(INTERNAL_VERSION)"); fi
endef
SOURCE_REVISION = $(shell \
--
2.22.0

View File

@ -125,7 +125,7 @@ index 00000000..9b614024
--- /dev/null
+++ b/version.txt
@@ -0,0 +1 @@
+8.332.9.0.13
+8.352.8.0.13
--
2.23.0

View File

@ -0,0 +1,30 @@
From fa03b567552ecc1a2a91850c959220ab28f178dd Mon Sep 17 00:00:00 2001
From: yangyudong <yangyudong3@huawei.com>
Date: Fri, 21 Oct 2022 12:02:55 +0800
Subject: cve-2022-37434: Fix a bug when getting a gzip header extra
field with inflate().
Bug url: https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2022-37434
---
jdk/src/share/native/java/util/zip/zlib/inflate.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/jdk/src/share/native/java/util/zip/zlib/inflate.c b/jdk/src/share/native/java/util/zip/zlib/inflate.c
index ca904e744..63decdb19 100644
--- a/jdk/src/share/native/java/util/zip/zlib/inflate.c
+++ b/jdk/src/share/native/java/util/zip/zlib/inflate.c
@@ -783,8 +783,9 @@ int flush;
if (copy > have) copy = have;
if (copy) {
if (state->head != Z_NULL &&
- state->head->extra != Z_NULL) {
- len = state->head->extra_len - state->length;
+ state->head->extra != Z_NULL &&
+ (len = state->head->extra_len - state->length) <
+ state->head->extra_max) {
zmemcpy(state->head->extra + len, next,
len + copy > state->head->extra_max ?
state->head->extra_max - len : copy);
--
2.22.0

View File

@ -0,0 +1,34 @@
From cf12a2fae11baf41773308a48d9cfad9031f5344 Mon Sep 17 00:00:00 2001
Date: Fri, 9 Sep 2022 11:26:22 +0800
Subject: dynamic cds _header and _fd handles are not free.
---
hotspot/src/share/vm/memory/filemap.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hotspot/src/share/vm/memory/filemap.cpp b/hotspot/src/share/vm/memory/filemap.cpp
index adb043f77..6549828e3 100644
--- a/hotspot/src/share/vm/memory/filemap.cpp
+++ b/hotspot/src/share/vm/memory/filemap.cpp
@@ -169,6 +169,18 @@ FileMapInfo::~FileMapInfo() {
assert(_dynamic_archive_info == this, "must be singleton"); // not thread safe
_dynamic_archive_info = NULL;
}
+
+ if (_header != NULL) {
+ delete _header;
+ }
+
+ if (_file_open) {
+ if (::close(_fd) < 0) {
+ fail_stop("Unable to close the shared archive file.");
+ }
+ _file_open = false;
+ _fd = -1;
+ }
}
void FileMapInfo::populate_header(size_t alignment) {
--
2.22.0

View File

@ -33,7 +33,7 @@ index 5858c9355..99b1f58d0 100644
- 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);
- JVM_Halt(0);
+ fail_stop("Failed to create appcds lock file, the lock path is: %s.", _appcds_file_lock_path);
}
tty->print_cr("You are using file lock %s in concurrent mode", AppCDSLockFile);

View File

@ -0,0 +1,113 @@
From 68293d50de005b5982a3cce437fc7af807d7264e Mon Sep 17 00:00:00 2001
Date: Wed, 14 Sep 2022 14:57:25 +0800
Subject: fix dumped heap using jhat parsing to appear failed to
resolve object id warning message
---
hotspot/src/share/vm/services/heapDumper.cpp | 5 --
.../serviceability/dcmd/gc/HeapDumpTest.java | 77 +++++++++++++++++++
2 files changed, 77 insertions(+), 5 deletions(-)
create mode 100644 jdk/test/serviceability/dcmd/gc/HeapDumpTest.java
diff --git a/hotspot/src/share/vm/services/heapDumper.cpp b/hotspot/src/share/vm/services/heapDumper.cpp
index f7aba2a84..b5915c412 100644
--- a/hotspot/src/share/vm/services/heapDumper.cpp
+++ b/hotspot/src/share/vm/services/heapDumper.cpp
@@ -984,11 +984,6 @@ void DumperSupport::dump_class_and_array_classes(DumpWriter* writer, Klass* k) {
return;
}
- // Ignore the class if it hasn't been initialized yet
- if (!ik->is_linked()) {
- return;
- }
-
writer->write_u1(HPROF_GC_CLASS_DUMP);
// class ID
diff --git a/jdk/test/serviceability/dcmd/gc/HeapDumpTest.java b/jdk/test/serviceability/dcmd/gc/HeapDumpTest.java
new file mode 100644
index 000000000..7204c2c37
--- /dev/null
+++ b/jdk/test/serviceability/dcmd/gc/HeapDumpTest.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2015, 2017, 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.
+ */
+import org.testng.annotations.Test;
+import org.testng.Assert;
+import java.io.File;
+import java.nio.file.Files;
+import java.io.IOException;
+import java.util.List;
+import jdk.test.lib.hprof.HprofParser;
+import jdk.test.lib.hprof.model.Snapshot;
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.PidJcmdExecutor;
+/*
+ * @test
+ * @summary Test of diagnostic command GC.heap_dump
+ * @library /lib
+ * @run testng HeapDumpTest
+ */
+public class HeapDumpTest {
+ protected String heapDumpArgs = "";
+
+ public void run(CommandExecutor executor) throws IOException {
+ File dump = new File("jcmd.gc.heap_dump." + System.currentTimeMillis() + ".hprof");
+ if (dump.exists()) {
+ dump.delete();
+ }
+
+ String cmd = "GC.heap_dump " + heapDumpArgs + " " + dump.getAbsolutePath();
+ executor.execute(cmd);
+
+ verifyHeapDump(dump);
+ dump.delete();
+ }
+ private void verifyHeapDump(File dump) {
+ Assert.assertTrue(dump.exists() && dump.isFile(), "Could not create dump file " + dump.getAbsolutePath());
+ try {
+ File out = HprofParser.parse(dump);
+ Assert.assertTrue(out != null && out.exists() && out.isFile(), "Could not find hprof parser output file");
+ List<String> lines = Files.readAllLines(out.toPath());
+ Assert.assertTrue(lines.size() > 0, "hprof parser output file is empty");
+ for (String line : lines) {
+ Assert.assertFalse(line.matches(".*WARNING(?!.*Failed to resolve object.*constantPoolOop.*).*"));
+ }
+ out.delete();
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail("Could not parse dump file " + dump.getAbsolutePath());
+ }
+ }
+ /* GC.heap_dump is not available over JMX, running jcmd pid executor instead */
+ @Test
+ public void pid() throws IOException {
+ run(new PidJcmdExecutor());
+ }
+}
--
2.22.0

View File

@ -38,7 +38,7 @@ index 9cfa0451..170f1fd9 100644
if (match_option(option, "-XX:+UseAppCDS", &tail)) {
+#ifndef __linux__
+ tty->print_cr("failed: must not use AppCDS on non-linux system.");
+ JVM_Exit(0);
+ JVM_Halt(0);
+#endif
if (!process_argument("+UseAppCDS", args->ignoreUnrecognized, origin)) {
return JNI_EINVAL;

View File

@ -0,0 +1,291 @@
diff --git a/jdk/make/CompileDemos.gmk b/jdk/make/CompileDemos.gmk
index 763c968e..6c5eb432 100644
--- a/jdk/make/CompileDemos.gmk
+++ b/jdk/make/CompileDemos.gmk
@@ -250,7 +250,6 @@ define SetupJVMTIDemo
SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
LANG := $$(BUILD_DEMO_JVMTI_$1_LANG), \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CXXFLAGS := $$($1_CXXFLAGS), \
LDFLAGS := $(filter-out -incremental:no -opt:ref, $$(LDFLAGS_JDKLIB)), \
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN), \
diff --git a/jdk/make/CompileLaunchers.gmk b/jdk/make/CompileLaunchers.gmk
index 29211f83..2ac718fc 100644
--- a/jdk/make/CompileLaunchers.gmk
+++ b/jdk/make/CompileLaunchers.gmk
@@ -512,7 +512,6 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \
EXCLUDE_FILES := jni.cpp, \
LANG := $(UNPACKEXE_LANG), \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) \
-DFULL, \
CFLAGS_release := -DPRODUCT, \
diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk
index 71d87c37..9368a9d5 100644
--- a/jdk/make/lib/Awt2dLibraries.gmk
+++ b/jdk/make/lib/Awt2dLibraries.gmk
@@ -52,7 +52,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE, \
EXCLUDE_FILES := awt_ImagingLib.c mlib_c_ImageBlendTable.c, \
LANG := C, \
OPTIMIZATION := HIGHEST, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) \
$(BUILD_LIBMLIB_CFLAGS), \
MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
@@ -471,7 +470,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \
INCLUDE_FILES := $(LIBAWT_FILES), \
LANG := $(LIBAWT_LANG), \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
ASFLAGS := $(LIBAWT_ASFLAGS), \
MAPFILE := $(LIBAWT_MAPFILE), \
@@ -633,7 +631,6 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
INCLUDE_FILES := $(LIBAWT_XAWT_FILES), \
LANG := C, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
$(X_CFLAGS), \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \
@@ -675,7 +672,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \
LANG := C, \
OPTIMIZATION := HIGHEST, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
-DCMS_DONT_USE_FAST_FLOOR \
$(SHARED_LIBRARY_FLAGS) \
@@ -743,7 +739,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJPEG, \
$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
LANG := C, \
OPTIMIZATION := HIGHEST, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) \
$(BUILD_LIBJPEG_CLOSED_INCLUDES) \
-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
@@ -919,7 +914,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
AccelGlyphCache.c, \
LANG := C++, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \
OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
@@ -1211,7 +1205,6 @@ ifndef BUILD_HEADLESS_ONLY
EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
LANG := C, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS), \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
diff --git a/jdk/make/lib/CoreLibraries.gmk b/jdk/make/lib/CoreLibraries.gmk
index b444abf9..e43fc2ed 100644
--- a/jdk/make/lib/CoreLibraries.gmk
+++ b/jdk/make/lib/CoreLibraries.gmk
@@ -113,7 +113,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \
INCLUDE_FILES := $(BUILD_LIBVERIFY_SRC), \
LANG := C, \
OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB), \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libverify/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
@@ -225,7 +224,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
EXCLUDE_FILES := $(LIBJAVA_EXCLUDE_FILES), \
LANG := C, \
OPTIMIZATION := HIGH, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) \
$(LIBJAVA_CFLAGS), \
MAPFILE := $(LIBJAVA_MAPFILE), \
@@ -287,7 +285,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
LANG := C, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
SRC := $(JDK_TOPDIR)/src/share/native/java/util/zip, \
EXCLUDES := $(LIBZIP_EXCLUDES), \
CFLAGS := $(CFLAGS_JDKLIB) \
@@ -329,7 +326,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \
EXCLUDE_FILES := main.cpp, \
LANG := C++, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CXXFLAGS_JDKLIB) \
-DNO_ZLIB -DUNPACK_JNI -DFULL, \
CFLAGS_release := -DPRODUCT, \
@@ -442,7 +438,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \
INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
LANG := C, \
OPTIMIZATION := HIGH, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(LIBJLI_CFLAGS), \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjli/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
@@ -544,7 +539,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBNPT, \
SRC := $(JDK_TOPDIR)/src/share/npt $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \
LANG := C, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) \
-I$(JDK_TOPDIR)/src/share/npt \
-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \
diff --git a/jdk/make/lib/NetworkingLibraries.gmk b/jdk/make/lib/NetworkingLibraries.gmk
index f826c66d..347c3237 100644
--- a/jdk/make/lib/NetworkingLibraries.gmk
+++ b/jdk/make/lib/NetworkingLibraries.gmk
@@ -65,7 +65,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBNET, \
EXCLUDE_FILES := $(LIBNET_EXCLUDE_FILES), \
LANG := C, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) \
$(LIBNET_CFLAGS), \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnet/mapfile-vers, \
diff --git a/jdk/make/lib/NioLibraries.gmk b/jdk/make/lib/NioLibraries.gmk
index 54c9c29e..6c9c46a3 100644
--- a/jdk/make/lib/NioLibraries.gmk
+++ b/jdk/make/lib/NioLibraries.gmk
@@ -181,7 +181,6 @@ ifeq ($(OPENJDK_TARGET_OS_API), posix)
SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch/sctp, \
LANG := C, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) \
-I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \
-I$(JDK_TOPDIR)/src/share/native/sun/nio/ch/sctp \
diff --git a/jdk/make/lib/SecurityLibraries.gmk b/jdk/make/lib/SecurityLibraries.gmk
index 10ab8043..5b9ec17f 100644
--- a/jdk/make/lib/SecurityLibraries.gmk
+++ b/jdk/make/lib/SecurityLibraries.gmk
@@ -196,7 +196,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11/wrapper, \
LANG := C, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) \
-I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \
-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11 \
@@ -242,7 +241,6 @@ ifeq ($(ENABLE_INTREE_EC), yes)
$(JDK_TOPDIR)/src/share/native/sun/security/ec/impl, \
LANG := C++, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CFLAGS_JDKLIB)) \
$(BUILD_LIBSUNEC_FLAGS) \
-DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \
@@ -300,7 +298,6 @@ ifeq ($(ENABLE_KAE), true)
SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/org/openeuler/security/openssl, \
LANG := C, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) \
-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/org/openeuler/security/openssl, \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2kae/mapfile-vers, \
diff --git a/jdk/make/lib/ServiceabilityLibraries.gmk b/jdk/make/lib/ServiceabilityLibraries.gmk
index 2c80ffc0..19c8601d 100644
--- a/jdk/make/lib/ServiceabilityLibraries.gmk
+++ b/jdk/make/lib/ServiceabilityLibraries.gmk
@@ -83,7 +83,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBDT_SOCKET, \
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/socket, \
LANG := C, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) -DUSE_MMAP \
-I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
-I$(JDK_TOPDIR)/src/share/transport/socket \
@@ -149,7 +148,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJDWP, \
SRC := $(JDK_TOPDIR)/src/share/back $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/back, \
LANG := C, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) -DJDWP_LOGGING \
-I$(JDK_TOPDIR)/src/share/transport/export \
-I$(JDK_TOPDIR)/src/share/back/export \
@@ -255,7 +253,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \
INCLUDE_FILES := $(LIBINSTRUMENT_FILES), \
LANG := C, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(LIBINSTRUMENT_CFLAGS) $(CFLAGS_WARNINGS_ARE_ERRORS), \
CFLAGS_debug := -DJPLIS_LOGGING, \
CFLAGS_release := -DNO_JPLIS_LOGGING, \
@@ -379,7 +376,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBHPROF, \
SRC := $(BUILD_LIBHPROF_SRC), \
LANG := C, \
OPTIMIZATION := $(LIBHPROF_OPTIMIZATION), \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \
$(BUILD_LIBHPROF_CFLAGS), \
CFLAGS_debug := -DHPROF_LOGGING, \
@@ -408,7 +404,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA_CRW_DEMO, \
SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo, \
LANG := C, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \
-I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo, \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava_crw_demo/mapfile-vers, \
diff --git a/jdk/make/lib/SoundLibraries.gmk b/jdk/make/lib/SoundLibraries.gmk
index 0ea9ba84..b59a9462 100644
--- a/jdk/make/lib/SoundLibraries.gmk
+++ b/jdk/make/lib/SoundLibraries.gmk
@@ -201,7 +201,6 @@ ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)), )
PLATFORM_API_LinuxOS_ALSA_Ports.c, \
LANG := C, \
OPTIMIZATION := LOW, \
- EXTRA_FILES := $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp, \
CFLAGS := $(CFLAGS_JDKLIB) $(ALSA_CFLAGS) \
$(LIBJSOUND_CFLAGS) \
-DUSE_DAUDIO=TRUE \
diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk
index 2d9bdbee..9586d20e 100644
--- a/make/common/NativeCompilation.gmk
+++ b/make/common/NativeCompilation.gmk
@@ -271,6 +271,7 @@ define SetupNativeCompilation
# Find all files in the source trees. Sort to remove duplicates.
$1_ALL_SRCS := $$(sort $$(call CacheFind,$$($1_SRC)))
+
# Extract the C/C++ files.
$1_EXCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_EXCLUDE_FILES)))
$1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
@@ -281,13 +282,20 @@ define SetupNativeCompilation
ifneq (,$$(strip $$($1_INCLUDE_FILES)))
$1_SRCS := $$(filter $$($1_INCLUDE_FILES),$$($1_SRCS))
endif
+
+ # Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables
+ # for LDFLAGS and LDFLAGS_SUFFIX
+ $1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS))
+ $1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS))
+
ifeq ($(OPENJDK_TARGET_OS), linux) # only on linux
- ifneq ($(OPENJDK_TARGET_CPU_ARCH), aarch64) # not need on the arm arch
- ifneq (,$$(strip $$($1_EXTRA_FILES)))
- $1_SRCS += $$($1_EXTRA_FILES)
+ ifneq ($$(findstring wrap=memcpy, $$($1_LDFLAGS)$$($1_EXTRA_LDFLAGS))$$($1_EXTRA_LDFLAGS_SUFFIX),)
+ ifeq ($$(findstring memcpy.cpp, $$($1_SRCS)),)
+ $1_SRCS += $(HOTSPOT_TOPDIR)/src/os_cpu/linux_x86/vm/memcpy.cpp
endif
endif
endif
+
ifeq (,$$($1_SRCS))
$$(error No sources found for $1 when looking inside the dirs $$($1_SRC))
endif
@@ -432,10 +440,6 @@ define SetupNativeCompilation
endif
endif
- # Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables
- # for LDFLAGS and LDFLAGS_SUFFIX
- $1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS))
- $1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS))
ifneq (,$$($1_REAL_MAPFILE))
$1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
endif

View File

@ -289,8 +289,8 @@ index c5ec637a1..125983179 100644
+ // Search path: <home>/jre/lib/<arch>/<vm>/libopenblas.so
+ if (jvm_offset >= 0) {
+ if (jvm_offset + strlen(library_name) + strlen(os::dll_file_extension()) < JVM_MAXPATHLEN) {
+ strncpy(&path[jvm_offset], library_name, strlen(library_name));
+ strncat(&path[jvm_offset], os::dll_file_extension(), strlen(os::dll_file_extension()));
+ strncpy(&path[jvm_offset], library_name, JVM_MAXPATHLEN - jvm_offset);
+ strncat(path, os::dll_file_extension(), strlen(os::dll_file_extension()));
+ library = (address)os::dll_load(path, err_buf, sizeof(err_buf));
+ }
+ }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
From 9d32c786ff6886bcd4b76e0a80eb19ce602dbe42 Mon Sep 17 00:00:00 2001
From: wangkun <wangkun49@huawei.com>
Date: Thu, 28 Jul 2022 17:24:52 +0800
Subject: [PATCH 3/3] fix xx
---
.../classes/org/openeuler/security/openssl/KAEDigest.java | 6 +++---
.../classes/org/openeuler/security/openssl/KAEProvider.java | 2 --
jdk/src/solaris/native/java/io/path_util.c | 1 -
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/jdk/src/solaris/classes/org/openeuler/security/openssl/KAEDigest.java b/jdk/src/solaris/classes/org/openeuler/security/openssl/KAEDigest.java
index bb5c8681..6ff03241 100644
--- a/jdk/src/solaris/classes/org/openeuler/security/openssl/KAEDigest.java
+++ b/jdk/src/solaris/classes/org/openeuler/security/openssl/KAEDigest.java
@@ -88,9 +88,9 @@ abstract class KAEDigest extends MessageDigestSpi implements Cloneable {
private static class DigestContextRef extends PhantomReference<KAEDigest>
implements Comparable<DigestContextRef> {
- private static ReferenceQueue<KAEDigest> referenceQueue = new ReferenceQueue<>();
- private static Set<DigestContextRef> referenceList = new ConcurrentSkipListSet<>();
- private static boolean disableKaeDispose = Boolean.getBoolean("kae.disableKaeDispose");
+ private static final ReferenceQueue<KAEDigest> referenceQueue = new ReferenceQueue<>();
+ private static final Set<DigestContextRef> referenceList = new ConcurrentSkipListSet<>();
+ private static final boolean disableKaeDispose = Boolean.getBoolean("kae.disableKaeDispose");
private final long ctxAddress;
diff --git a/jdk/src/solaris/classes/org/openeuler/security/openssl/KAEProvider.java b/jdk/src/solaris/classes/org/openeuler/security/openssl/KAEProvider.java
index 8ba70200..83ed8649 100644
--- a/jdk/src/solaris/classes/org/openeuler/security/openssl/KAEProvider.java
+++ b/jdk/src/solaris/classes/org/openeuler/security/openssl/KAEProvider.java
@@ -104,8 +104,6 @@ public class KAEProvider extends Provider {
if (needLog && "true".equalsIgnoreCase(props.getProperty("kae.log"))) {
logStart(excp);
needLog = false; // Log only once
- } else {
- KAEProvider.excp = null; // Ignore exception.
}
if (!"false".equalsIgnoreCase(props.getProperty("kae.md5"))) {
putMD5();
diff --git a/jdk/src/solaris/native/java/io/path_util.c b/jdk/src/solaris/native/java/io/path_util.c
index 8a533f81..4b978206 100644
--- a/jdk/src/solaris/native/java/io/path_util.c
+++ b/jdk/src/solaris/native/java/io/path_util.c
@@ -116,7 +116,6 @@ collapse(char *path)
int nc;
char **ix;
int i, j;
- char *p, *q;
nc = collapsible(names);
if (nc < 2) return; /* Nothing to do */
--
2.22.0

View File

@ -146,13 +146,13 @@
%global origin_nice OpenJDK
%global top_level_dir_name %{origin}
%global repo jdk8u
%global revision jdk8u342-b07
%global revision jdk8u352-b08
%global full_revision %{repo}-%{revision}
# Define IcedTea version used for SystemTap tapsets and desktop files
%global icedteaver 3.15.0
%global updatever 342
%global buildver b07
%global updatever 352
%global buildver b08
# priority must be 7 digits in total. The expression is workarounding tip
%global priority 1800%{updatever}
@ -583,7 +583,7 @@ exit 0
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libnpt.so
%ifarch %{aarch64}
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libj2kae.so
%{_jvmdir}/%{jredir -- %{?1}}/lib/ext/kaeprovider.conf
%{_jvmdir}/%{jredir -- %{?1}}/lib/kaeprovider.conf
%endif
%ifarch %{sa_arches}
%{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libsaproc.so
@ -916,7 +916,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
@ -1079,7 +1079,6 @@ Patch185: update-cacerts-and-VerifyCACerts.java-test.patch
Patch186: update-to-keep-same-with-master.patch
Patch188: 8247691_incorrect_handling_of_VM_exceptions_in_C1_deopt_stub.patch
Patch192: add_kae_implementation_add_default_conf_file.patch
Patch193: improve_algorithmConstraints_checkAlgorithm_performance.patch
Patch194: modify_the_default_iteration_time_and_forks_in_the_JMH_of_KAEProvider.patch
Patch195: support_CMS_parallel_inspection.patch
Patch196: g1gc-numa-aware-Implementation.patch
@ -1116,7 +1115,6 @@ Patch229: downgrade-the-symver-of-fcntl64.patch
# 8u322
Patch230: add-system-property-swing.JComboBox.useLegacyMode.patch
Patch232: 8173361-various-crashes-in-JvmtiExport-post_compiled.patch
Patch233: fix-TestUseCompressedOopsErgo-run-failed.patch
Patch235: fix-testme-Test6929067-run-faild.patch
Patch236: penetration_testing_vulnerability_fix.patch
@ -1131,10 +1129,29 @@ Patch243: Fix-compile-and-runtime-failures-for-minimal1-versio.patch
Patch244: fix_X509TrustManagerImpl_symantec_distrust.patch
Patch245: change-sa-jdi.jar-make-file-for-BEP.PATCH
Patch246: 7092821-java.security.Provider.getService-is-synchro.patch
Patch247: 8173339-AArch64-Fix-minimum-stack-size-computations.patch
Patch248: 8067941-TESTBUG-Fix-tests-for-OS-with-64K-page-size.patch
# 8u342
Patch249: Improve_AlgorithmConstraints_checkAlgorithm_performance.patch
Patch250: modify_coding_style_and_describe_error.patch
Patch251: fix_wrap_memcpy_undefined_gcc10_3.patch
Patch252: 8290705_fix_StringConcat_validate_mem_flow_asserts_with_unexpected_userStoreI.patch
Patch253: 8143925-enhancing-CounterMode.crypt-for-AESCrypt.patch
Patch254: kae-usability-enhancement.patch
Patch255: Dynamic-CDS-Archive.patch
Patch256: 8202951-Support-default-jsa.patch
Patch257: 8200332-Improve-GCM-counting.patch
Patch258: dynamic-cds-_header-and-_fd-handles-are-not-free.patch
Patch259: fix-dumped-heap-using-jhat-parsing-to-appear-failed-to-resolve-object-id-warning-message.patch
Patch260: 8159720-Failure-of-C2-compilation-with-tiered-preven.patch
Patch261: revert-fPIC-and-security-compilation-flag-on.patch
Patch262: add-configuration-option-of-huawei-internal-version-shown-in-release-file.patch
Patch263: The-code-style-is-fixed-and-test-cases-are-added.patch
Patch264: 8287109-Distrust-failed-with-CertificateExpired.patch
# 8u352
Patch265: cve-2022-37434-Fix-a-bug-when-getting-a-gzip-header-extra-field-with-inflate.patch
Patch266: 8065895-Synchronous-signals-during-error-reporting-may-terminate-or-hang-vm-process.patch
#############################################
#
@ -1196,6 +1213,7 @@ BuildRequires: cups-devel
BuildRequires: desktop-file-utils
# elfutils only are OK for build without AOT
BuildRequires: elfutils-devel
#BuildRequires: elfutils-extra
BuildRequires: fontconfig-devel
BuildRequires: freetype-devel
BuildRequires: giflib-devel
@ -1595,7 +1613,6 @@ pushd %{top_level_dir_name}
%patch228 -p1
%patch229 -p1
%patch230 -p1
%patch232 -p1
%patch233 -p1
%patch235 -p1
%patch236 -p1
@ -1608,8 +1625,25 @@ pushd %{top_level_dir_name}
%patch244 -p1
%patch245 -p1
%patch246 -p1
%patch247 -p1
%patch248 -p1
%patch249 -p1
%patch250 -p1
%patch251 -p1
%patch252 -p1
%patch253 -p1
%patch254 -p1
%patch255 -p1
%patch256 -p1
%patch257 -p1
%patch258 -p1
%patch259 -p1
%patch260 -p1
%patch261 -p1
%patch262 -p1
%patch263 -p1
%patch264 -p1
%patch265 -p1
%patch266 -p1
popd
# System library fixes
@ -2227,6 +2261,79 @@ require "copy_jdk_configs.lua"
%endif
%changelog
* Mon Oct 24 2022 kuenking111<wangkun49@huawei.com> - 1:1.8.0.352-b08.3
- add 8065895-Synchronous-signals-during-error-reporting-may-terminate-or-hang-vm-process.patch
* Mon Oct 24 2022 kuenking111<wangkun49@huawei.com> - 1:1.8.0.352-b08.2
- add cve-2022-37434-Fix-a-bug-when-getting-a-gzip-header-extra-field-with-inflate.patch
* Mon Oct 24 2022 kuenking111<wangkun49@huawei.com> - 1:1.8.0.352-b08.1
- remove gitattributes gitignore jcheck files
* Wed Oct 19 2022 kuenking111<wangkun49@huawei.com> - 1:1.8.0.352-b08.0
- modified add-missing-test-case.patch
- upgrade to jdk8u352-b08
* Thu Sep 29 2022 DXwangg<wangjiawei80@huawei.com> - 1:1.8.0.352-b07.0
- upgrade to jdk8u352-b07
- deleted Improve_AlgorithmConstraints_checkAlgorithm_performance.patch
- deleted 8173361-various-crashes-in-JvmtiExport-post_compiled.patch
- modified Fix-compile-and-runtime-failures-for-minimal1-versio.patch
- deleted 8173339-AArch64-Fix-minimum-stack-size-computations.patch
- modified add-appcds-file-lock.patch
- modified add-DumpSharedSpace-guarantee-when-create-anonymous-classes.patch
- modified fix-appcds-s-option-AppCDSLockFile.patch
- modified fix-windows-compile-fail.patch
* Sat Sep 24 2022 kuenking111<wangkun49@huawei.com> - 1:1.8.0.342-b07.15
- add 8287109-Distrust-failed-with-CertificateExpired.patch
* Fri Sep 23 2022 kuenking111<wangkun49@huawei.com> - 1:1.8.0.342-b07.14
- add The-code-style-is-fixed-and-test-cases-are-added.patch
* Thu Sep 22 2022 kuenking111<wangkun49@huawei.com> - 1:1.8.0.342-b07.13
- add add-configuration-option-of-huawei-internal-version-shown-in-release-file.patch
* Wed Sep 21 2022 kuenking111<wangkun49@huawei.com> - 1:1.8.0.342-b07.12
- add revert-fPIC-and-security-compilation-flag-on.patch
* Mon Sep 19 2022 zhoulei<zhoulei103@huawei.com> - 1:1.8.0.342-b07.11
- add 8159720-Failure-of-C2-compilation-with-tiered-preven.patch
* Fri Sep 16 2022 kuenking111 <wangkun49@huawei.com> - 1:1.8.0.342-b07.10
- add fix-dumped-heap-using-jhat-parsing-to-appear-failed-to-resolve-object-id-warning-message.patch
* Fri Sep 16 2022 kuenking111 <wangkun49@huawei.com> - 1:1.8.0.342-b07.9
- add dynamic-cds-_header-and-_fd-handles-are-not-free.patch
* Fri Sep 16 2022 kuenking111 <wangkun49@huawei.com> - 1:1.8.0.342-b07.8
- add 8200332-Improve-GCM-counting.patch
* Fri Sep 16 2022 kuenking111 <wangkun49@huawei.com> - 1:1.8.0.342-b07.7
- add 8202951-Support-default-jsa.patch
* Thu Sep 15 2022 kuenking111 <wangkun49@huawei.com> - 1:1.8.0.342-b07.6
- add Dynamic-CDS-Archive.patch
* Thu Sep 15 2022 kuenking111 <wangkun49@huawei.com> - 1:1.8.0.342-b07.5
- add kae-usability-enhancement.patch
* Thu Sep 15 2022 kuenking111 <wangkun49@huawei.com> - 1:1.8.0.342-b07.4
- add 8143925-enhancing-CounterMode.crypt-for-AESCrypt.patch
* Fri Aug 5 2022 kuenking111 <wangkun49@huawei.com> - 1:1.8.0.342-b07.3
- add 8290705_fix_StringConcat_validate_mem_flow_asserts_with_unexpected_userStoreI.patch
- modified version.txt
* Thu Jul 28 2022 kuenking111 <wangkun49@huawei.com> - 1:1.8.0.342-b07.2
- add modify_coding_style_and_describe_error.patch
- add Improve_AlgorithmConstraints_checkAlgorithm_performance.patch
- add fix_wrap_memcpy_undefined_gcc10_3.patch
- modified implementation_of_Blas_hotspot_function_in_Intrinsics.patch
* Thu Jul 28 2022 kuenking111 <wangkun49@huawei.com> - 1:1.8.0.342-b07.1
- del hg git files
* Fri Jul 22 2022 kuenking111 <wangkun49@huawei.com> - 1:1.8.0.342-b07.0
- del 8168926.patch
- del 8194154.patch

View File

@ -0,0 +1,60 @@
From 9ffc530e0d34086e68c87306ca0410e5847812d6 Mon Sep 17 00:00:00 2001
Date: Wed, 21 Sep 2022 09:53:14 +0800
Subject: revert fPIC and security compilation flag on
---
common/autoconf/flags.m4 | 6 +-----
common/autoconf/generated-configure.sh | 6 +-----
hotspot/make/pic.make | 2 +-
3 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4
index 69bea78d..71703a15 100644
--- a/common/autoconf/flags.m4
+++ b/common/autoconf/flags.m4
@@ -807,11 +807,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
fi
if test "x$TOOLCHAIN_TYPE" = xgcc; then
- # Enabling pie on 32 bit builds prevents the JVM from allocating a continuous
- # java heap.
- if test "x$OPENJDK_TARGET_CPU_BITS" != "x32"; then
- LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -pie"
- fi
+ LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -pie"
fi
fi
AC_SUBST(LDFLAGS_JDKLIB)
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index f0e49f50..53e6cf18 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -43068,11 +43068,7 @@ $as_echo "$supports" >&6; }
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
fi
if test "x$TOOLCHAIN_TYPE" = xgcc; then
- # Enabling pie on 32 bit builds prevents the JVM from allocating a continuous
- # java heap.
- if test "x$OPENJDK_TARGET_CPU_BITS" != "x32"; then
- LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -pie"
- fi
+ LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -pie"
fi
fi
diff --git a/hotspot/make/pic.make b/hotspot/make/pic.make
index 0e61ad93..3d85546c 100644
--- a/hotspot/make/pic.make
+++ b/hotspot/make/pic.make
@@ -30,7 +30,7 @@ include $(GAMMADIR)/make/scm.make
ifneq ($(OSNAME), windows)
ifndef LP64
- PARTIAL_NONPIC=1
+ PARTIAL_NONPIC=0
endif
PIC_ARCH = ppc arm
ifneq ("$(filter $(PIC_ARCH),$(BUILDARCH))","")
--
2.22.0