!620 upgrade to jdk8u432-ga
From: @kuenking111 Reviewed-by: @douyiwang Signed-off-by: @douyiwang
This commit is contained in:
commit
019b9eecbb
@ -38,13 +38,6 @@ diff --git a/jdk/src/share/classes/javax/security/auth/kerberos/KeyImpl.java b/j
|
||||
index 9d36d1e9e..571387e0c 100644
|
||||
--- a/jdk/src/share/classes/javax/security/auth/kerberos/KeyImpl.java
|
||||
+++ b/jdk/src/share/classes/javax/security/auth/kerberos/KeyImpl.java
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
+ * Copyright (c) 2000, 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
|
||||
@@ -138,6 +138,12 @@ class KeyImpl implements SecretKey, Destroyable, Serializable {
|
||||
case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96:
|
||||
return "aes256-cts-hmac-sha1-96";
|
||||
|
||||
@ -1,64 +0,0 @@
|
||||
From 6456acbb0412f0a0f3e7374b27e66a504ece36ff Mon Sep 17 00:00:00 2001
|
||||
From: c00229008 <chenshanyao@huawei.com>
|
||||
Date: Wed, 4 Aug 2021 09:43:49 +0800
|
||||
Subject: [PATCH 01/23] 8167014: jdeps failed with "Missing message:
|
||||
warn.skipped.entry"
|
||||
|
||||
Summary: <langtools>: jdeps failed with "Missing message: warn.skipped.entry"
|
||||
LLT: tomcat-websocket-10.0.8.jar
|
||||
Patch Type: backport
|
||||
Bug url: https://bugs.openjdk.java.net/browse/JDK-8167014
|
||||
---
|
||||
.../share/classes/com/sun/tools/jdeps/ClassFileReader.java | 5 ++++-
|
||||
.../src/share/classes/com/sun/tools/jdeps/JdepsTask.java | 6 ++++--
|
||||
.../classes/com/sun/tools/jdeps/resources/jdeps.properties | 1 +
|
||||
3 files changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/langtools/src/share/classes/com/sun/tools/jdeps/ClassFileReader.java b/langtools/src/share/classes/com/sun/tools/jdeps/ClassFileReader.java
|
||||
index f41f2d0ba..07da40357 100644
|
||||
--- a/langtools/src/share/classes/com/sun/tools/jdeps/ClassFileReader.java
|
||||
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/ClassFileReader.java
|
||||
@@ -337,7 +337,10 @@ public class ClassFileReader {
|
||||
cf = reader.readClassFile(jf, nextEntry);
|
||||
return true;
|
||||
} catch (ClassFileError | IOException ex) {
|
||||
- skippedEntries.add(nextEntry.getName());
|
||||
+ skippedEntries.add(String.format("%s: %s (%s)",
|
||||
+ ex.getMessage(),
|
||||
+ nextEntry.getName(),
|
||||
+ jf.getName()));
|
||||
}
|
||||
nextEntry = nextEntry();
|
||||
}
|
||||
diff --git a/langtools/src/share/classes/com/sun/tools/jdeps/JdepsTask.java b/langtools/src/share/classes/com/sun/tools/jdeps/JdepsTask.java
|
||||
index 91002d319..97dba138e 100644
|
||||
--- a/langtools/src/share/classes/com/sun/tools/jdeps/JdepsTask.java
|
||||
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/JdepsTask.java
|
||||
@@ -559,8 +559,10 @@ class JdepsTask {
|
||||
a.addClass(d.getOrigin());
|
||||
}
|
||||
}
|
||||
- for (String name : a.reader().skippedEntries()) {
|
||||
- warning("warn.skipped.entry", name, a.getPathName());
|
||||
+ if (!options.nowarning) {
|
||||
+ for (String name : a.reader().skippedEntries()) {
|
||||
+ warning("warn.skipped.entry", name, a.getPathName());
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/langtools/src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties b/langtools/src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties
|
||||
index 51d11b88a..501c4d6cd 100644
|
||||
--- a/langtools/src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties
|
||||
+++ b/langtools/src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties
|
||||
@@ -92,6 +92,7 @@ err.option.unsupported={0} not supported: {1}
|
||||
err.profiles.msg=No profile information
|
||||
err.invalid.path=invalid path: {0}
|
||||
warn.invalid.arg=Invalid classname or pathname not exist: {0}
|
||||
+warn.skipped.entry={0}
|
||||
warn.split.package=package {0} defined in {1} {2}
|
||||
warn.replace.useJDKInternals=\
|
||||
JDK internal APIs are unsupported and private to JDK implementation that are\n\
|
||||
--
|
||||
2.22.0
|
||||
|
||||
@ -1,53 +0,0 @@
|
||||
From da7a2005a2c181737b163f60dd705acc00002463 Mon Sep 17 00:00:00 2001
|
||||
From: hedongbo <hedongbo@huawei.com>
|
||||
Date: Thu, 5 Jan 2023 10:22:15 +0000
|
||||
Subject: 8185736: missing default exception handler in calls to
|
||||
rethrow_Stub
|
||||
|
||||
---
|
||||
hotspot/src/share/vm/opto/doCall.cpp | 9 +++++++++
|
||||
hotspot/src/share/vm/opto/output.cpp | 1 +
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp
|
||||
index 366769356..1b2b77c71 100644
|
||||
--- a/hotspot/src/share/vm/opto/doCall.cpp
|
||||
+++ b/hotspot/src/share/vm/opto/doCall.cpp
|
||||
@@ -702,6 +702,7 @@ void Parse::catch_call_exceptions(ciExceptionHandlerStream& handlers) {
|
||||
GrowableArray<const Type*>* extypes = new (C->node_arena()) GrowableArray<const Type*>(C->node_arena(), 8, 0, NULL);
|
||||
GrowableArray<int>* saw_unloaded = new (C->node_arena()) GrowableArray<int>(C->node_arena(), 8, 0, 0);
|
||||
|
||||
+ bool default_handler = false;
|
||||
for (; !handlers.is_done(); handlers.next()) {
|
||||
ciExceptionHandler* h = handlers.handler();
|
||||
int h_bci = h->handler_bci();
|
||||
@@ -724,6 +725,14 @@ void Parse::catch_call_exceptions(ciExceptionHandlerStream& handlers) {
|
||||
// Note: It's OK if the BCIs repeat themselves.
|
||||
bcis->append(h_bci);
|
||||
extypes->append(h_extype);
|
||||
+ if (h_bci == -1) {
|
||||
+ default_handler = true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!default_handler) {
|
||||
+ bcis->append(-1);
|
||||
+ extypes->append(TypeOopPtr::make_from_klass(env()->Throwable_klass())->is_instptr());
|
||||
}
|
||||
|
||||
int len = bcis->length();
|
||||
diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp
|
||||
index 5c9566e1e..6032b72a9 100644
|
||||
--- a/hotspot/src/share/vm/opto/output.cpp
|
||||
+++ b/hotspot/src/share/vm/opto/output.cpp
|
||||
@@ -1761,6 +1761,7 @@ void Compile::FillExceptionTables(uint cnt, uint *call_returns, uint *inct_start
|
||||
}
|
||||
|
||||
// Set the offset of the return from the call
|
||||
+ assert(handler_bcis.find(-1) != -1, "must have default handler");
|
||||
_handler_table.add_subtable(call_return, &handler_bcis, NULL, &handler_pcos);
|
||||
continue;
|
||||
}
|
||||
--
|
||||
2.12.3
|
||||
|
||||
@ -8,192 +8,6 @@ Subject: 8193682: Infinite loop in ZipOutputStream.close()
|
||||
4 files changed, 226 insertions(+), 64 deletions(-)
|
||||
create mode 100644 jdk/test/java/util/zip/CloseDeflaterTest.java
|
||||
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java b/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java
|
||||
index a1f768cae..f4cf79693 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java
|
||||
@@ -235,9 +235,12 @@ class DeflaterOutputStream extends FilterOutputStream {
|
||||
*/
|
||||
public void close() throws IOException {
|
||||
if (!closed) {
|
||||
- finish();
|
||||
- if (usesDefaultDeflater)
|
||||
- def.end();
|
||||
+ try {
|
||||
+ finish();
|
||||
+ } finally {
|
||||
+ if (usesDefaultDeflater)
|
||||
+ def.end();
|
||||
+ }
|
||||
out.close();
|
||||
closed = true;
|
||||
}
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java b/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java
|
||||
index 2c1cd409b..1c3f8592e 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java
|
||||
@@ -154,24 +154,30 @@ class GZIPOutputStream extends DeflaterOutputStream {
|
||||
*/
|
||||
public void finish() throws IOException {
|
||||
if (!def.finished()) {
|
||||
- def.finish();
|
||||
- while (!def.finished()) {
|
||||
- int len = def.deflate(buf, 0, buf.length);
|
||||
- if (def.finished() && len <= buf.length - TRAILER_SIZE) {
|
||||
- // last deflater buffer. Fit trailer at the end
|
||||
- writeTrailer(buf, len);
|
||||
- len = len + TRAILER_SIZE;
|
||||
- out.write(buf, 0, len);
|
||||
- return;
|
||||
+ try {
|
||||
+ def.finish();
|
||||
+ while (!def.finished()) {
|
||||
+ int len = def.deflate(buf, 0, buf.length);
|
||||
+ if (def.finished() && len <= buf.length - TRAILER_SIZE) {
|
||||
+ // last deflater buffer. Fit trailer at the end
|
||||
+ writeTrailer(buf, len);
|
||||
+ len = len + TRAILER_SIZE;
|
||||
+ out.write(buf, 0, len);
|
||||
+ return;
|
||||
+ }
|
||||
+ if (len > 0)
|
||||
+ out.write(buf, 0, len);
|
||||
}
|
||||
- if (len > 0)
|
||||
- out.write(buf, 0, len);
|
||||
+ // if we can't fit the trailer at the end of the last
|
||||
+ // deflater buffer, we write it separately
|
||||
+ byte[] trailer = new byte[TRAILER_SIZE];
|
||||
+ writeTrailer(trailer, 0);
|
||||
+ out.write(trailer);
|
||||
+ } catch (IOException e) {
|
||||
+ if (usesDefaultDeflater)
|
||||
+ def.end();
|
||||
+ throw e;
|
||||
}
|
||||
- // if we can't fit the trailer at the end of the last
|
||||
- // deflater buffer, we write it separately
|
||||
- byte[] trailer = new byte[TRAILER_SIZE];
|
||||
- writeTrailer(trailer, 0);
|
||||
- out.write(trailer);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/ZipOutputStream.java b/jdk/src/share/classes/java/util/zip/ZipOutputStream.java
|
||||
index 6b480aa1d..f001ddf00 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/ZipOutputStream.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/ZipOutputStream.java
|
||||
@@ -247,59 +247,65 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
|
||||
public void closeEntry() throws IOException {
|
||||
ensureOpen();
|
||||
if (current != null) {
|
||||
- ZipEntry e = current.entry;
|
||||
- switch (e.method) {
|
||||
- case DEFLATED:
|
||||
- def.finish();
|
||||
- while (!def.finished()) {
|
||||
- deflate();
|
||||
- }
|
||||
- if ((e.flag & 8) == 0) {
|
||||
- // verify size, compressed size, and crc-32 settings
|
||||
- if (e.size != def.getBytesRead()) {
|
||||
- throw new ZipException(
|
||||
- "invalid entry size (expected " + e.size +
|
||||
- " but got " + def.getBytesRead() + " bytes)");
|
||||
+ try {
|
||||
+ ZipEntry e = current.entry;
|
||||
+ switch (e.method) {
|
||||
+ case DEFLATED:
|
||||
+ def.finish();
|
||||
+ while (!def.finished()) {
|
||||
+ deflate();
|
||||
}
|
||||
- if (e.csize != def.getBytesWritten()) {
|
||||
+ if ((e.flag & 8) == 0) {
|
||||
+ // verify size, compressed size, and crc-32 settings
|
||||
+ if (e.size != def.getBytesRead()) {
|
||||
+ throw new ZipException(
|
||||
+ "invalid entry size (expected " + e.size +
|
||||
+ " but got " + def.getBytesRead() + " bytes)");
|
||||
+ }
|
||||
+ if (e.csize != def.getBytesWritten()) {
|
||||
+ throw new ZipException(
|
||||
+ "invalid entry compressed size (expected " +
|
||||
+ e.csize + " but got " + def.getBytesWritten() + " bytes)");
|
||||
+ }
|
||||
+ if (e.crc != crc.getValue()) {
|
||||
+ throw new ZipException(
|
||||
+ "invalid entry CRC-32 (expected 0x" +
|
||||
+ Long.toHexString(e.crc) + " but got 0x" +
|
||||
+ Long.toHexString(crc.getValue()) + ")");
|
||||
+ }
|
||||
+ } else {
|
||||
+ e.size = def.getBytesRead();
|
||||
+ e.csize = def.getBytesWritten();
|
||||
+ e.crc = crc.getValue();
|
||||
+ writeEXT(e);
|
||||
+ }
|
||||
+ def.reset();
|
||||
+ written += e.csize;
|
||||
+ break;
|
||||
+ case STORED:
|
||||
+ // we already know that both e.size and e.csize are the same
|
||||
+ if (e.size != written - locoff) {
|
||||
throw new ZipException(
|
||||
- "invalid entry compressed size (expected " +
|
||||
- e.csize + " but got " + def.getBytesWritten() + " bytes)");
|
||||
+ "invalid entry size (expected " + e.size +
|
||||
+ " but got " + (written - locoff) + " bytes)");
|
||||
}
|
||||
if (e.crc != crc.getValue()) {
|
||||
throw new ZipException(
|
||||
- "invalid entry CRC-32 (expected 0x" +
|
||||
- Long.toHexString(e.crc) + " but got 0x" +
|
||||
- Long.toHexString(crc.getValue()) + ")");
|
||||
+ "invalid entry crc-32 (expected 0x" +
|
||||
+ Long.toHexString(e.crc) + " but got 0x" +
|
||||
+ Long.toHexString(crc.getValue()) + ")");
|
||||
}
|
||||
- } else {
|
||||
- e.size = def.getBytesRead();
|
||||
- e.csize = def.getBytesWritten();
|
||||
- e.crc = crc.getValue();
|
||||
- writeEXT(e);
|
||||
+ break;
|
||||
+ default:
|
||||
+ throw new ZipException("invalid compression method");
|
||||
}
|
||||
- def.reset();
|
||||
- written += e.csize;
|
||||
- break;
|
||||
- case STORED:
|
||||
- // we already know that both e.size and e.csize are the same
|
||||
- if (e.size != written - locoff) {
|
||||
- throw new ZipException(
|
||||
- "invalid entry size (expected " + e.size +
|
||||
- " but got " + (written - locoff) + " bytes)");
|
||||
- }
|
||||
- if (e.crc != crc.getValue()) {
|
||||
- throw new ZipException(
|
||||
- "invalid entry crc-32 (expected 0x" +
|
||||
- Long.toHexString(e.crc) + " but got 0x" +
|
||||
- Long.toHexString(crc.getValue()) + ")");
|
||||
- }
|
||||
- break;
|
||||
- default:
|
||||
- throw new ZipException("invalid compression method");
|
||||
+ crc.reset();
|
||||
+ current = null;
|
||||
+ } catch (IOException e) {
|
||||
+ if (usesDefaultDeflater && !(e instanceof ZipException))
|
||||
+ def.end();
|
||||
+ throw e;
|
||||
}
|
||||
- crc.reset();
|
||||
- current = null;
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/jdk/test/java/util/zip/CloseDeflaterTest.java b/jdk/test/java/util/zip/CloseDeflaterTest.java
|
||||
new file mode 100644
|
||||
index 000000000..8aa4960f5
|
||||
|
||||
@ -831,15 +831,7 @@ index bc06cac..67ef963 100644
|
||||
int _n_threads;
|
||||
TaskQueueSetSuper* _queue_set;
|
||||
char _pad_before[DEFAULT_CACHE_LINE_SIZE];
|
||||
@@ -634,14 +659,14 @@ public:
|
||||
// else is. If returns "true", all threads are terminated. If returns
|
||||
// "false", available work has been observed in one of the task queues,
|
||||
// so the global task is not complete.
|
||||
- bool offer_termination() {
|
||||
+ virtual bool offer_termination() {
|
||||
return offer_termination(NULL);
|
||||
}
|
||||
|
||||
@@ -641,7 +666,7 @@ public:
|
||||
// As above, but it also terminates if the should_exit_termination()
|
||||
// method of the terminator parameter returns true. If terminator is
|
||||
// NULL, then it is ignored.
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
diff --git a/jdk/src/share/instrument/InvocationAdapter.c b/jdk/src/share/instrument/InvocationAdapter.c
|
||||
index 5aa189b0..b06cf5cb 100644
|
||||
--- a/jdk/src/share/instrument/InvocationAdapter.c
|
||||
+++ b/jdk/src/share/instrument/InvocationAdapter.c
|
||||
@@ -829,6 +829,7 @@ appendBootClassPath( JPLISAgent* agent,
|
||||
|
||||
resolved = resolve(parent, path);
|
||||
jvmtierr = (*jvmtienv)->AddToBootstrapClassLoaderSearch(jvmtienv, resolved);
|
||||
+ free(resolved);
|
||||
}
|
||||
|
||||
/* print warning if boot class path not updated */
|
||||
@ -1,238 +0,0 @@
|
||||
From e5bf7f105c0066f770f5cdc65f94410d45d11f0f Mon Sep 17 00:00:00 2001
|
||||
Subject: 8278794: Infinite loop in DeflaterOutputStream.finish()
|
||||
|
||||
---
|
||||
.../share/classes/java/util/zip/Deflater.java | 10 ++
|
||||
.../java/util/zip/DeflaterOutputStream.java | 14 +-
|
||||
.../java/util/zip/ZipOutputStream.java | 4 +-
|
||||
jdk/test/java/util/zip/CloseDeflaterTest.java | 147 ------------------
|
||||
4 files changed, 22 insertions(+), 153 deletions(-)
|
||||
delete mode 100644 jdk/test/java/util/zip/CloseDeflaterTest.java
|
||||
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/Deflater.java b/jdk/src/share/classes/java/util/zip/Deflater.java
|
||||
index 3bb5f9901..bffa397d9 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/Deflater.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/Deflater.java
|
||||
@@ -559,6 +559,16 @@ class Deflater {
|
||||
throw new NullPointerException("Deflater has been closed");
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Returns the value of 'finish' flag.
|
||||
+ * 'finish' will be set to true if def.finish() method is called.
|
||||
+ */
|
||||
+ boolean shouldFinish() {
|
||||
+ synchronized (zsRef) {
|
||||
+ return finish;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
private static native void initIDs();
|
||||
private native static long init(int level, int strategy, boolean nowrap);
|
||||
private native static void setDictionary(long addr, byte[] b, int off, int len);
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java b/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java
|
||||
index f4cf79693..c698a0147 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
+ * Copyright (c) 1996, 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
|
||||
@@ -221,9 +221,15 @@ class DeflaterOutputStream extends FilterOutputStream {
|
||||
*/
|
||||
public void finish() throws IOException {
|
||||
if (!def.finished()) {
|
||||
- def.finish();
|
||||
- while (!def.finished()) {
|
||||
- deflate();
|
||||
+ try{
|
||||
+ def.finish();
|
||||
+ while (!def.finished()) {
|
||||
+ deflate();
|
||||
+ }
|
||||
+ } catch(IOException e) {
|
||||
+ if (usesDefaultDeflater)
|
||||
+ def.end();
|
||||
+ throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/ZipOutputStream.java b/jdk/src/share/classes/java/util/zip/ZipOutputStream.java
|
||||
index f001ddf00..cd9194276 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/ZipOutputStream.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/ZipOutputStream.java
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
+ * Copyright (c) 1996, 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
|
||||
@@ -302,7 +302,7 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
|
||||
crc.reset();
|
||||
current = null;
|
||||
} catch (IOException e) {
|
||||
- if (usesDefaultDeflater && !(e instanceof ZipException))
|
||||
+ if (def.shouldFinish() && usesDefaultDeflater && !(e instanceof ZipException))
|
||||
def.end();
|
||||
throw e;
|
||||
}
|
||||
diff --git a/jdk/test/java/util/zip/CloseDeflaterTest.java b/jdk/test/java/util/zip/CloseDeflaterTest.java
|
||||
deleted file mode 100644
|
||||
index 8aa4960f5..000000000
|
||||
--- a/jdk/test/java/util/zip/CloseDeflaterTest.java
|
||||
+++ /dev/null
|
||||
@@ -1,147 +0,0 @@
|
||||
-/*
|
||||
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
- *
|
||||
- * This code is free software; you can redistribute it and/or modify it
|
||||
- * under the terms of the GNU General Public License version 2 only, as
|
||||
- * published by the Free Software Foundation.
|
||||
- *
|
||||
- * This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
- * version 2 for more details (a copy is included in the LICENSE file that
|
||||
- * accompanied this code).
|
||||
- *
|
||||
- * You should have received a copy of the GNU General Public License version
|
||||
- * 2 along with this work; if not, write to the Free Software Foundation,
|
||||
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
- *
|
||||
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
- * or visit www.oracle.com if you need additional information or have any
|
||||
- * questions.
|
||||
- */
|
||||
-
|
||||
-/**
|
||||
- * @test
|
||||
- * @bug 8193682
|
||||
- * @summary Test Infinite loop while writing on closed GZipOutputStream , ZipOutputStream and JarOutputStream.
|
||||
- * @run testng CloseDeflaterTest
|
||||
- */
|
||||
-import java.io.*;
|
||||
-import java.util.Random;
|
||||
-import java.util.jar.JarOutputStream;
|
||||
-import java.util.zip.GZIPOutputStream;
|
||||
-import java.util.zip.ZipOutputStream;
|
||||
-import java.util.zip.ZipEntry;
|
||||
-
|
||||
-import org.testng.annotations.BeforeTest;
|
||||
-import org.testng.annotations.DataProvider;
|
||||
-import org.testng.annotations.Test;
|
||||
-import static org.testng.Assert.fail;
|
||||
-
|
||||
-
|
||||
-public class CloseDeflaterTest {
|
||||
-
|
||||
- //number of bytes to write
|
||||
- private static final int INPUT_LENGTH= 512;
|
||||
- //OutputStream that will throw an exception during a write operation
|
||||
- private static OutputStream outStream = new OutputStream() {
|
||||
- @Override
|
||||
- public void write(byte[] b, int off, int len) throws IOException {
|
||||
- //throw exception during write
|
||||
- throw new IOException();
|
||||
- }
|
||||
- @Override
|
||||
- public void write(byte b[]) throws IOException {}
|
||||
- @Override
|
||||
- public void write(int b) throws IOException {}
|
||||
- };
|
||||
- private static byte[] inputBytes = new byte[INPUT_LENGTH];
|
||||
- private static Random rand = new Random();
|
||||
-
|
||||
- @DataProvider(name = "testgzipinput")
|
||||
- public Object[][] testGZipInput() {
|
||||
- //testGZip will close the GZipOutputStream using close() method when the boolean
|
||||
- //useCloseMethod is set to true and finish() method if the value is set to false
|
||||
- return new Object[][] {
|
||||
- { GZIPOutputStream.class, true },
|
||||
- { GZIPOutputStream.class, false },
|
||||
- };
|
||||
- }
|
||||
-
|
||||
- @DataProvider(name = "testzipjarinput")
|
||||
- public Object[][] testZipAndJarInput() {
|
||||
- //testZipAndJarInput will perfrom write/closeEntry operations on JarOutputStream when the boolean
|
||||
- //useJar is set to true and on ZipOutputStream if the value is set to false
|
||||
- return new Object[][] {
|
||||
- { JarOutputStream.class, true },
|
||||
- { ZipOutputStream.class, false },
|
||||
- };
|
||||
- }
|
||||
-
|
||||
- @BeforeTest
|
||||
- public void before_test()
|
||||
- {
|
||||
- //add inputBytes array with random bytes to write into Zip
|
||||
- rand.nextBytes(inputBytes);
|
||||
- }
|
||||
-
|
||||
- //Test for infinite loop by writing bytes to closed GZIPOutputStream
|
||||
- @Test(dataProvider = "testgzipinput")
|
||||
- public void testGZip(Class<?> type, boolean useCloseMethod) throws IOException {
|
||||
- GZIPOutputStream zip = new GZIPOutputStream(outStream);
|
||||
- try {
|
||||
- zip.write(inputBytes, 0, INPUT_LENGTH);
|
||||
- //close zip
|
||||
- if(useCloseMethod) {
|
||||
- zip.close();
|
||||
- } else {
|
||||
- zip.finish();
|
||||
- }
|
||||
- } catch (IOException e) {
|
||||
- //expected
|
||||
- }
|
||||
- for (int i = 0; i < 3; i++) {
|
||||
- try {
|
||||
- //write on a closed GZIPOutputStream
|
||||
- zip.write(inputBytes, 0, INPUT_LENGTH);
|
||||
- fail("Deflater closed exception not thrown");
|
||||
- } catch (NullPointerException e) {
|
||||
- //expected , Deflater has been closed exception
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- //Test for infinite loop by writing bytes to closed ZipOutputStream/JarOutputStream
|
||||
- @Test(dataProvider = "testzipjarinput")
|
||||
- public void testZipCloseEntry(Class<?> type,boolean useJar) throws IOException {
|
||||
- ZipOutputStream zip = null;
|
||||
- if(useJar) {
|
||||
- zip = new JarOutputStream(outStream);
|
||||
- } else {
|
||||
- zip = new ZipOutputStream(outStream);
|
||||
- }
|
||||
- try {
|
||||
- zip.putNextEntry(new ZipEntry(""));
|
||||
- } catch (IOException e) {
|
||||
- //expected to throw IOException since putNextEntry calls write method
|
||||
- }
|
||||
- try {
|
||||
- zip.write(inputBytes, 0, INPUT_LENGTH);
|
||||
- //close zip entry
|
||||
- zip.closeEntry();
|
||||
- } catch (IOException e) {
|
||||
- //expected
|
||||
- }
|
||||
- for (int i = 0; i < 3; i++) {
|
||||
- try {
|
||||
- //write on a closed ZipOutputStream
|
||||
- zip.write(inputBytes, 0, INPUT_LENGTH);
|
||||
- fail("Deflater closed exception not thrown");
|
||||
- } catch (NullPointerException e) {
|
||||
- //expected , Deflater has been closed exception
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
-}
|
||||
--
|
||||
2.22.0
|
||||
|
||||
@ -9,28 +9,6 @@ Subject: 8313626: C2 crash due to unexpected exception control flow
|
||||
create mode 100644 jdk/test/jdk/jfr/event/compiler/MissingSafepointOnTryCatch.jasm
|
||||
create mode 100644 jdk/test/jdk/jfr/event/compiler/TestMissingSafepointOnTryCatch.java
|
||||
|
||||
diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp
|
||||
index 1b2b77c71..7a7aba359 100644
|
||||
--- a/hotspot/src/share/vm/opto/doCall.cpp
|
||||
+++ b/hotspot/src/share/vm/opto/doCall.cpp
|
||||
@@ -892,6 +892,8 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) {
|
||||
tty->print_cr(" Catching every inline exception bci:%d -> handler_bci:%d", bci(), handler_bci);
|
||||
}
|
||||
#endif
|
||||
+ // If this is a backwards branch in the bytecodes, add safepoint
|
||||
+ maybe_add_safepoint(handler_bci);
|
||||
merge_exception(handler_bci); // jump to handler
|
||||
return; // No more handling to be done here!
|
||||
}
|
||||
@@ -925,6 +927,8 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) {
|
||||
tty->cr();
|
||||
}
|
||||
#endif
|
||||
+ // If this is a backwards branch in the bytecodes, add safepoint
|
||||
+ maybe_add_safepoint(handler_bci);
|
||||
merge_exception(handler_bci);
|
||||
}
|
||||
set_control(not_subtype_ctrl);
|
||||
diff --git a/jdk/test/jdk/jfr/event/compiler/MissingSafepointOnTryCatch.jasm b/jdk/test/jdk/jfr/event/compiler/MissingSafepointOnTryCatch.jasm
|
||||
new file mode 100644
|
||||
index 000000000..413736e59
|
||||
|
||||
26
Backport-8057910-G1-BOT-verification-should-not-pass.patch
Normal file
26
Backport-8057910-G1-BOT-verification-should-not-pass.patch
Normal file
@ -0,0 +1,26 @@
|
||||
From 07dabe012b6e9cddd9fef59551bc3d6f6962bbf7 Mon Sep 17 00:00:00 2001
|
||||
Subject: Backport-8057910: G1: BOT verification should not pass
|
||||
top
|
||||
|
||||
---
|
||||
.../src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
|
||||
index b908e8faf..b0b891d85 100644
|
||||
--- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
|
||||
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
|
||||
@@ -371,8 +371,9 @@ void G1BlockOffsetArray::alloc_block_work2(HeapWord** threshold_, size_t* index_
|
||||
}
|
||||
|
||||
void G1BlockOffsetArray::verify() const {
|
||||
+ assert(gsp()->bottom() < gsp()->top(), "Only non-empty regions should be verified.");
|
||||
size_t start_card = _array->index_for(gsp()->bottom());
|
||||
- size_t end_card = _array->index_for(gsp()->top());
|
||||
+ size_t end_card = _array->index_for(gsp()->top() - 1);
|
||||
|
||||
for (size_t current_card = start_card; current_card < end_card; current_card++) {
|
||||
u_char entry = _array->offset_array(current_card);
|
||||
--
|
||||
2.22.0
|
||||
|
||||
8916
Backport-8069330-and-adapt-G1GC-related-optimization.patch
Normal file
8916
Backport-8069330-and-adapt-G1GC-related-optimization.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -340,185 +340,6 @@ index ff59c5ecc..8b0c08909 100644
|
||||
while (length-- > 0)
|
||||
h = 31*h + *s++;
|
||||
return h;
|
||||
diff --git a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
|
||||
index 7e1d8c99d..1cd9e8bdb 100644
|
||||
--- a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
|
||||
+++ b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
|
||||
@@ -1131,6 +1131,10 @@ imageio_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
|
||||
return;
|
||||
}
|
||||
num_bytes += sb->remaining_skip;
|
||||
+ // Check for overflow if remaining_skip value is too large
|
||||
+ if (num_bytes < 0) {
|
||||
+ return;
|
||||
+ }
|
||||
sb->remaining_skip = 0;
|
||||
|
||||
/* First the easy case where we are skipping <= the current contents. */
|
||||
diff --git a/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c b/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c
|
||||
index cea158e17..2f64d33cc 100644
|
||||
--- a/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c
|
||||
+++ b/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c
|
||||
@@ -406,6 +406,10 @@ sun_jpeg_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
|
||||
return;
|
||||
}
|
||||
num_bytes += src->remaining_skip;
|
||||
+ // Check for overflow if remaining_skip value is too large
|
||||
+ if (num_bytes < 0) {
|
||||
+ return;
|
||||
+ }
|
||||
src->remaining_skip = 0;
|
||||
ret = (int)src->pub.bytes_in_buffer; /* this conversion is safe, because capacity of the buffer is limited by jnit */
|
||||
if (ret >= num_bytes) {
|
||||
diff --git a/jdk/test/javax/sound/midi/File/SMFInterruptedRunningStatus.java b/jdk/test/javax/sound/midi/File/SMFInterruptedRunningStatus.java
|
||||
new file mode 100644
|
||||
index 000000000..1b82e2f73
|
||||
--- /dev/null
|
||||
+++ b/jdk/test/javax/sound/midi/File/SMFInterruptedRunningStatus.java
|
||||
@@ -0,0 +1,143 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2023, 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 java.io.ByteArrayInputStream;
|
||||
+
|
||||
+import javax.sound.midi.MidiSystem;
|
||||
+import javax.sound.midi.Sequence;
|
||||
+import javax.sound.midi.Track;
|
||||
+
|
||||
+/**
|
||||
+ * @test
|
||||
+ * @bug 8319598
|
||||
+ * @summary SMFParser bug with running status, interrupted by Meta or SysEx messages
|
||||
+ */
|
||||
+public class SMFInterruptedRunningStatus {
|
||||
+
|
||||
+ public static void main(String[] args) throws Exception {
|
||||
+
|
||||
+ byte[][] files = new byte[][] {SMF_1, SMF_2, SMF_3};
|
||||
+ for (int i = 0; i < files.length; i++) {
|
||||
+ Sequence seq = MidiSystem.getSequence(
|
||||
+ new ByteArrayInputStream(files[i]));
|
||||
+ testSequence(seq, i + 1);
|
||||
+ }
|
||||
+
|
||||
+ // no exception thrown, all files have been parsed correctly
|
||||
+ System.out.println("Test passed");
|
||||
+ }
|
||||
+
|
||||
+ private static void testSequence(Sequence seq, int fileNumber) {
|
||||
+
|
||||
+ // check number of tracks and number of events
|
||||
+ Track[] tracks = seq.getTracks();
|
||||
+ if (1 != tracks.length) {
|
||||
+ throw new RuntimeException("file number "
|
||||
+ + fileNumber + " fails (incorrect number of tracks: "
|
||||
+ + tracks.length + ")");
|
||||
+ }
|
||||
+ Track track = tracks[0];
|
||||
+ if (7 != track.size()) {
|
||||
+ throw new RuntimeException("file number " + fileNumber
|
||||
+ + " fails (incorrect number of events: "
|
||||
+ + track.size() + ")");
|
||||
+ }
|
||||
+
|
||||
+ // check status byte of each message
|
||||
+ int[] expectedStatusBytes = new int[] {
|
||||
+ 0x90, 0xFF, 0x90, 0x90, 0x90, 0xFF, 0xFF};
|
||||
+ for (int i = 0; i < expectedStatusBytes.length; i++) {
|
||||
+ int expected = expectedStatusBytes[i];
|
||||
+ if (expected != track.get(i).getMessage().getStatus()) {
|
||||
+ throw new RuntimeException("file number " + fileNumber
|
||||
+ + " fails (wrong status byte in event " + i + ")");
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // MIDI file without running status - should work equally before
|
||||
+ // and after the bugfix
|
||||
+ private static final byte[] SMF_1 = {
|
||||
+ 0x4D, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, // file header (start)
|
||||
+ 0x00, 0x01, 0x00, 0x01, 0x00, (byte) 0x80, // file header (end)
|
||||
+ 0x4D, 0x54, 0x72, 0x6B, 0x00, 0x00, 0x00, 0x24, // track header
|
||||
+ 0x00, // delta time
|
||||
+ (byte) 0x90, 0x3C, 0x7F, // Note-ON (C)
|
||||
+ 0x40, // delta time
|
||||
+ (byte) 0xFF, 0x01, 0x04, 0x54, 0x65, 0x73, 0x74, // META (text)
|
||||
+ 0x20, // delta time
|
||||
+ (byte) 0x90, 0x3C, 0x00, // Note-OFF (C)
|
||||
+ 0x20, // delta time
|
||||
+ (byte) 0x90, 0x3E, 0x7F, // Note-ON (D)
|
||||
+ 0x60, // delta time
|
||||
+ (byte) 0x90, 0x3E, 0x00, // Note-OFF (D)
|
||||
+ 0x20, // delta time
|
||||
+ (byte) 0xFF, 0x01, 0x04, 0x54, 0x65, 0x73, 0x74, // META (text)
|
||||
+ 0x00, // delta time
|
||||
+ (byte) 0xFF, 0x2F, 0x00 // META (end of track)
|
||||
+ };
|
||||
+
|
||||
+ // MIDI file with running status, interrupted by a META message
|
||||
+ // - failed before the bugfix
|
||||
+ private static final byte[] SMF_2 = {
|
||||
+ 0x4D, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, // file header (start)
|
||||
+ 0x00, 0x01, 0x00, 0x01, 0x00, (byte) 0x80, // file header (end)
|
||||
+ 0x4D, 0x54, 0x72, 0x6B, 0x00, 0x00, 0x00, 0x21, // track header
|
||||
+ 0x00, // delta time
|
||||
+ (byte) 0x90, 0x3C, 0x7F, // Note-ON (C)
|
||||
+ 0x40, // delta time
|
||||
+ (byte) 0xFF, 0x01, 0x04, 0x54, 0x65, 0x73, 0x74, // META (interruptor)
|
||||
+ 0x20, // delta time
|
||||
+ 0x3C, 0x00, // Note-OFF (C) - running status
|
||||
+ 0x20, // delta time
|
||||
+ 0x3E, 0x7F, // Note-ON (D) - running status
|
||||
+ 0x60, // delta time
|
||||
+ 0x3E, 0x00, // Note-OFF (D) - running status
|
||||
+ 0x20, // delta time
|
||||
+ (byte) 0xFF, 0x01, 0x04, 0x54, 0x65, 0x73, 0x74, // META (text)
|
||||
+ 0x00, // delta time
|
||||
+ (byte) 0xFF, 0x2F, 0x00 // META (end of track)
|
||||
+ };
|
||||
+
|
||||
+ // MIDI file with running status, interrupted by a META message
|
||||
+ // - succeeded before the bugfix but with wrong interpretation of the data
|
||||
+ private static final byte[] SMF_3 = {
|
||||
+ 0x4D, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, // file header (start)
|
||||
+ 0x00, 0x01, 0x00, 0x01, 0x00, (byte) 0x80, // file header (end)
|
||||
+ 0x4D, 0x54, 0x72, 0x6B, 0x00, 0x00, 0x00, 0x21, // track header
|
||||
+ 0x00, // delta time
|
||||
+ (byte) 0x90, 0x3C, 0x7F, // Note-ON (C)
|
||||
+ 0x40, // delta time
|
||||
+ (byte) 0xFF, 0x01, 0x04, 0x54, 0x65, 0x73, 0x74, // META (interruptor)
|
||||
+ 0x20, // delta time
|
||||
+ 0x3C, 0x00, // Note-OFF (C) - running status
|
||||
+ 0x0D, // delta time
|
||||
+ 0x3E, 0x7F, // Note-ON (D) - running status
|
||||
+ 0x60, // delta time
|
||||
+ 0x3E, 0x00, // Note-OFF (D) - running status
|
||||
+ 0x20, // delta time
|
||||
+ (byte) 0xFF, 0x01, 0x04, 0x54, 0x65, 0x73, 0x74, // META (text)
|
||||
+ 0x00, // delta time
|
||||
+ (byte) 0xFF, 0x2F, 0x00 // META (end of track)
|
||||
+ };
|
||||
+}
|
||||
--
|
||||
2.23.0
|
||||
|
||||
|
||||
@ -13,8 +13,8 @@ index 7dde7f096..d122f0eae 100644
|
||||
WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
|
||||
endif
|
||||
|
||||
-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type
|
||||
+WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Wno-stringop-overflow
|
||||
-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Woverloaded-virtual
|
||||
+WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Woverloaded-virtual -Wno-stringop-overflow
|
||||
|
||||
ifeq ($(USE_CLANG),)
|
||||
# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
|
||||
|
||||
40
Huawei-Fix-build-failures-due-to-wrap-in-x86.patch
Normal file
40
Huawei-Fix-build-failures-due-to-wrap-in-x86.patch
Normal file
@ -0,0 +1,40 @@
|
||||
Subject: Fix build failures due to wrap in x86
|
||||
|
||||
---
|
||||
hotspot/make/linux/makefiles/adlc.make | 20 +++++++++++++++++++-
|
||||
1 file changed, 19 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/hotspot/make/linux/makefiles/adlc.make b/hotspot/make/linux/makefiles/adlc.make
|
||||
index a01aa1aaa..92728fbe7 100644
|
||||
--- a/hotspot/make/linux/makefiles/adlc.make
|
||||
+++ b/hotspot/make/linux/makefiles/adlc.make
|
||||
@@ -70,8 +70,26 @@ CFLAGS_WARN = $(WARNINGS_ARE_ERRORS)
|
||||
CFLAGS += $(CFLAGS_WARN)
|
||||
|
||||
# Extra flags from gnumake's invocation or environment
|
||||
+# Adapt wrap for JDK-8281096:Flags introduced by configure script are not passed to ADLC build
|
||||
+WRAP_STR := -Wl,--wrap
|
||||
+WRAP_MEM := ,--wrap=memcpy
|
||||
+WRAP_NULL :=
|
||||
+WRAP_LIBPTHREAD := libpthread.so.0
|
||||
+WRAP_LIBDL := libdl.so.2
|
||||
+WRAP_LM := -lm
|
||||
+HOST_LDFLAGS_ADOPT_WRAP := $(HOST_LDFLAGS)
|
||||
+
|
||||
+ifeq ($(findstring --wrap=,$(HOST_LDFLAGS)),--wrap=)
|
||||
+ HOST_LDFLAGS_ADOPT_WRAP := $(subst $(WRAP_MEM),$(WRAP_NULL),$(HOST_LDFLAGS_ADOPT_WRAP))
|
||||
+ HOST_LDFLAGS_ADOPT_WRAP := $(subst $(WRAP_LIBPTHREAD),$(WRAP_NULL),$(HOST_LDFLAGS_ADOPT_WRAP))
|
||||
+ HOST_LDFLAGS_ADOPT_WRAP := $(subst $(WRAP_LIBDL),$(WRAP_NULL),$(HOST_LDFLAGS_ADOPT_WRAP))
|
||||
+ HOST_LDFLAGS_ADOPT_WRAP := $(subst $(WRAP_LM),$(WRAP_NULL),$(HOST_LDFLAGS_ADOPT_WRAP))
|
||||
+ FILTERED_WRAP := $(filter $(WRAP_STR)%,$(HOST_LDFLAGS_ADOPT_WRAP))
|
||||
+ HOST_LDFLAGS_ADOPT_WRAP := $(patsubst %$(FILTERED_WRAP),$(WRAP_NULL),$(HOST_LDFLAGS_ADOPT_WRAP))
|
||||
+endif
|
||||
+
|
||||
CFLAGS += $(HOST_CFLAGS)
|
||||
-LFLAGS += $(HOST_CFLAGS) $(HOST_LDFLAGS)
|
||||
+LFLAGS += $(HOST_CFLAGS) $(HOST_LDFLAGS_ADOPT_WRAP)
|
||||
ASFLAGS += $(HOST_ASFLAGS)
|
||||
|
||||
OBJECTNAMES = \
|
||||
--
|
||||
2.37.7
|
||||
524
SA-redact-support-password.patch
Normal file
524
SA-redact-support-password.patch
Normal file
@ -0,0 +1,524 @@
|
||||
From 1ff9622f74d77baed3dc477b43759472b950d630 Mon Sep 17 00:00:00 2001
|
||||
Date: Sat, 9 Nov 2024 16:25:10 +0800
|
||||
Subject: SA redact support password
|
||||
|
||||
---
|
||||
.../sun/jvm/hotspot/tools/HeapDumper.java | 18 ++-
|
||||
.../jvm/hotspot/utilities/HeapRedactor.java | 14 +-
|
||||
hotspot/src/share/vm/runtime/arguments.cpp | 15 +-
|
||||
hotspot/src/share/vm/runtime/arguments.hpp | 4 -
|
||||
hotspot/src/share/vm/runtime/globals.hpp | 4 +-
|
||||
.../src/share/vm/services/heapRedactor.cpp | 8 +-
|
||||
.../src/share/vm/services/heapRedactor.hpp | 1 +
|
||||
.../share/classes/sun/tools/jmap/JMap.java | 150 +++++++++++++-----
|
||||
8 files changed, 150 insertions(+), 64 deletions(-)
|
||||
|
||||
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java
|
||||
index be503fe06..32c91d300 100644
|
||||
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java
|
||||
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java
|
||||
@@ -40,6 +40,9 @@ public class HeapDumper extends Tool {
|
||||
|
||||
private static String DEFAULT_DUMP_FILE = "heap.bin";
|
||||
|
||||
+ // encrypt
|
||||
+ private static int SALT_MIN_LENGTH = 8;
|
||||
+
|
||||
private String dumpFile;
|
||||
|
||||
private HeapRedactor redactor;
|
||||
@@ -78,8 +81,19 @@ public class HeapDumper extends Tool {
|
||||
public void run() {
|
||||
System.out.println("Dumping heap to " + dumpFile + " ...");
|
||||
try {
|
||||
+ String redactAuth = getVMRedactParameter("RedactPassword");
|
||||
+ boolean redactAuthFlag = true;
|
||||
+ if(redactAuth != null) {
|
||||
+ String[] auths = redactAuth.split(",");
|
||||
+ if(auths.length == 2) {
|
||||
+ byte[] saltBytes = auths[1].getBytes("UTF-8");
|
||||
+ if(saltBytes.length >= SALT_MIN_LENGTH) {
|
||||
+ redactAuthFlag = (this.redactor != null && auths[0].equals(this.redactor.getRedactPassword()));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
HeapHprofBinWriter writer = new HeapHprofBinWriter();
|
||||
- if(this.redactor != null){
|
||||
+ if(this.redactor != null && redactAuthFlag) {
|
||||
writer.setHeapRedactor(this.redactor);
|
||||
if(writer.getHeapDumpRedactLevel() != HeapRedactor.HeapDumpRedactLevel.REDACT_UNKNOWN){
|
||||
System.out.println("HeapDump Redact Level = " + this.redactor.getRedactLevelString());
|
||||
@@ -133,7 +147,7 @@ public class HeapDumper extends Tool {
|
||||
}
|
||||
}
|
||||
|
||||
- HeapDumper dumper = heapRedactor == null? new HeapDumper(file):new HeapDumper(file, heapRedactor);
|
||||
+ HeapDumper dumper = heapRedactor == null? new HeapDumper(file) : new HeapDumper(file, heapRedactor);
|
||||
dumper.execute(args);
|
||||
}
|
||||
|
||||
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapRedactor.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapRedactor.java
|
||||
index 26782b879..c71340255 100644
|
||||
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapRedactor.java
|
||||
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapRedactor.java
|
||||
@@ -51,7 +51,8 @@ public class HeapRedactor {
|
||||
private HeapDumpRedactLevel redactLevel;
|
||||
private Map<String, String> redactNameTable;
|
||||
private Map<String, Map<String, String>> redactClassTable;
|
||||
- private String redactClassFullName = null;
|
||||
+ private String redactClassFullName = null;
|
||||
+ private String redactPassword = null;
|
||||
private Map<Long, String> redactValueTable;
|
||||
private RedactVectorNode headerNode;
|
||||
private RedactVectorNode currentNode;
|
||||
@@ -62,6 +63,7 @@ public class HeapRedactor {
|
||||
public static final String REDACT_MAP_PREFIX = "RedactMap=";
|
||||
public static final String REDACT_MAP_FILE_PREFIX = "RedactMapFile=";
|
||||
public static final String REDACT_CLASS_PATH_PREFIX = "RedactClassPath=";
|
||||
+ public static final String REDACT_PASSWORD_PREFIX = "RedactPassword=";
|
||||
|
||||
public static final String REDACT_UNKNOWN_STR = "UNKNOWN";
|
||||
public static final String REDACT_OFF_STR = "OFF";
|
||||
@@ -170,6 +172,10 @@ public class HeapRedactor {
|
||||
return redactParams.getRedactClassPath();
|
||||
}
|
||||
|
||||
+ public String getRedactPassword(){
|
||||
+ return redactPassword;
|
||||
+ }
|
||||
+
|
||||
public Optional<Map<String, String>> getRedactRulesTable(String key) {
|
||||
return Optional.<Map<String, String>>ofNullable(redactClassTable == null ? null: redactClassTable.get(key));
|
||||
}
|
||||
@@ -231,9 +237,11 @@ public class HeapRedactor {
|
||||
params.setRedactMap(option.substring(REDACT_MAP_PREFIX.length()));
|
||||
} else if (option.startsWith(REDACT_MAP_FILE_PREFIX)) {
|
||||
params.setRedactMapFile(option.substring(REDACT_MAP_FILE_PREFIX.length()));
|
||||
- } else if (option.startsWith(REDACT_CLASS_PATH_PREFIX)) {
|
||||
+ } else if (option.startsWith(REDACT_CLASS_PATH_PREFIX)) {
|
||||
params.setRedactClassPath(option.substring(REDACT_CLASS_PATH_PREFIX.length()));
|
||||
- }else{
|
||||
+ } else if (option.startsWith(REDACT_PASSWORD_PREFIX)) {
|
||||
+ redactPassword = option.substring(REDACT_PASSWORD_PREFIX.length());
|
||||
+ } else{
|
||||
// None matches
|
||||
}
|
||||
}
|
||||
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
|
||||
index 360a87159..a50aa1866 100644
|
||||
--- a/hotspot/src/share/vm/runtime/arguments.cpp
|
||||
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
|
||||
@@ -152,8 +152,6 @@ char* Arguments::_meta_index_dir = NULL;
|
||||
|
||||
bool Arguments::_transletEnhance = false;
|
||||
|
||||
-char* Arguments::_heap_dump_redact_auth = NULL;
|
||||
-
|
||||
// Check if head of 'option' matches 'name', and sets 'tail' remaining part of option string
|
||||
|
||||
static bool match_option(const JavaVMOption *option, const char* name,
|
||||
@@ -4183,14 +4181,13 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
|
||||
if(match_option(option, "-XX:RedactPassword=", &tail)) {
|
||||
if(tail == NULL || strlen(tail) == 0) {
|
||||
VerifyRedactPassword = false;
|
||||
- jio_fprintf(defaultStream::output_stream(), "redact password is null, disable verify heap dump authority.\n");
|
||||
} else {
|
||||
- VerifyRedactPassword = true;
|
||||
- size_t redact_password_len = strlen(tail);
|
||||
- _heap_dump_redact_auth = NEW_C_HEAP_ARRAY(char, redact_password_len+1, mtInternal);
|
||||
- memcpy(_heap_dump_redact_auth, tail, redact_password_len);
|
||||
- _heap_dump_redact_auth[redact_password_len] = '\0';
|
||||
- memset((void*)tail, '0', redact_password_len);
|
||||
+ char* split_char = strstr(const_cast<char*>(tail), ",");
|
||||
+ VerifyRedactPassword = !(split_char == NULL || strlen(split_char) < SALT_LEN);
|
||||
+ }
|
||||
+
|
||||
+ if(!VerifyRedactPassword) {
|
||||
+ jio_fprintf(defaultStream::output_stream(), "redact auth is null or with incorrect format, disable verify heap dump authority.\n");
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp
|
||||
index 945f487e1..fdd1d14b0 100644
|
||||
--- a/hotspot/src/share/vm/runtime/arguments.hpp
|
||||
+++ b/hotspot/src/share/vm/runtime/arguments.hpp
|
||||
@@ -449,8 +449,6 @@ class Arguments : AllStatic {
|
||||
|
||||
static char* SharedDynamicArchivePath;
|
||||
|
||||
- static char* _heap_dump_redact_auth;
|
||||
-
|
||||
public:
|
||||
// Parses the arguments, first phase
|
||||
static jint parse(const JavaVMInitArgs* args);
|
||||
@@ -564,8 +562,6 @@ class Arguments : AllStatic {
|
||||
|
||||
static const char* GetSharedDynamicArchivePath() { return SharedDynamicArchivePath; }
|
||||
|
||||
- static const char* get_heap_dump_redact_auth() { return _heap_dump_redact_auth; }
|
||||
-
|
||||
static bool init_shared_archive_paths();
|
||||
|
||||
static void extract_shared_archive_paths(const char* archive_path,
|
||||
diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp
|
||||
index 28bdd336f..b3c2f5af6 100644
|
||||
--- a/hotspot/src/share/vm/runtime/globals.hpp
|
||||
+++ b/hotspot/src/share/vm/runtime/globals.hpp
|
||||
@@ -1007,8 +1007,8 @@ class CommandLineFlags {
|
||||
product(bool, VerifyRedactPassword, false, \
|
||||
"verify authority for operating heapDump redact feature") \
|
||||
\
|
||||
- product(ccstr, RedactPassword, "", \
|
||||
- "authority for operating heapDump redact feature") \
|
||||
+ product(ccstr, RedactPassword, NULL, \
|
||||
+ "authority for operating heapDump redact feature, format {password,salt}, salt length >= 8") \
|
||||
\
|
||||
develop(uintx, SegmentedHeapDumpThreshold, 2*G, \
|
||||
"Generate a segmented heap dump (JAVA PROFILE 1.0.2 format) " \
|
||||
diff --git a/hotspot/src/share/vm/services/heapRedactor.cpp b/hotspot/src/share/vm/services/heapRedactor.cpp
|
||||
index 6120e9458..8d620431e 100644
|
||||
--- a/hotspot/src/share/vm/services/heapRedactor.cpp
|
||||
+++ b/hotspot/src/share/vm/services/heapRedactor.cpp
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "../runtime/globals.hpp"
|
||||
#include "../runtime/os.hpp"
|
||||
-#include "../runtime/arguments.hpp"
|
||||
#include "../utilities/ostream.hpp"
|
||||
#include "../memory/allocation.hpp"
|
||||
#include "../memory/allocation.inline.hpp"
|
||||
@@ -182,12 +181,15 @@ void HeapRedactor::init(outputStream* out) {
|
||||
* if HeapDumpRedact is NULL , jmap operation can not open redact feature without password
|
||||
* if HeapDumpRedact is not NULL, jmap operation can not change redact level without password
|
||||
**/
|
||||
- if(Arguments::get_heap_dump_redact_auth() == NULL) {
|
||||
+ char* split_char = NULL;
|
||||
+ if(RedactPassword == NULL || (split_char = strstr(const_cast<char*>(RedactPassword), ",")) == NULL || strlen(split_char) < SALT_LEN) {
|
||||
VerifyRedactPassword = false;
|
||||
}
|
||||
if(VerifyRedactPassword && !_use_sys_params) {
|
||||
+ size_t auth_len = strlen(RedactPassword);
|
||||
+ size_t suffix_len = strlen(split_char);
|
||||
if(_redact_params.redact_password == NULL ||
|
||||
- strcmp(_redact_params.redact_password, Arguments::get_heap_dump_redact_auth()) ) {
|
||||
+ strncmp(_redact_params.redact_password, RedactPassword, auth_len-suffix_len) ) {
|
||||
// no password or wrong password;
|
||||
_use_sys_params = true;
|
||||
if(out != NULL) {
|
||||
diff --git a/hotspot/src/share/vm/services/heapRedactor.hpp b/hotspot/src/share/vm/services/heapRedactor.hpp
|
||||
index 06ffcc830..ed53d7a03 100644
|
||||
--- a/hotspot/src/share/vm/services/heapRedactor.hpp
|
||||
+++ b/hotspot/src/share/vm/services/heapRedactor.hpp
|
||||
@@ -32,6 +32,7 @@
|
||||
#endif
|
||||
|
||||
#define MAX_MAP_FILE_LENGTH 1024
|
||||
+#define SALT_LEN 9
|
||||
|
||||
enum HeapDumpRedactLevel {
|
||||
REDACT_UNKNOWN,
|
||||
diff --git a/jdk/src/share/classes/sun/tools/jmap/JMap.java b/jdk/src/share/classes/sun/tools/jmap/JMap.java
|
||||
index b184beb74..319f577bd 100644
|
||||
--- a/jdk/src/share/classes/sun/tools/jmap/JMap.java
|
||||
+++ b/jdk/src/share/classes/sun/tools/jmap/JMap.java
|
||||
@@ -31,14 +31,19 @@ import java.lang.reflect.Method;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
-import java.nio.charset.StandardCharsets;
|
||||
-import java.security.MessageDigest;
|
||||
+import java.security.NoSuchAlgorithmException;
|
||||
+import java.security.spec.InvalidKeySpecException;
|
||||
+import java.security.spec.KeySpec;
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.sun.tools.attach.VirtualMachine;
|
||||
import com.sun.tools.attach.AttachNotSupportedException;
|
||||
import sun.tools.attach.HotSpotVirtualMachine;
|
||||
|
||||
+import javax.crypto.SecretKey;
|
||||
+import javax.crypto.SecretKeyFactory;
|
||||
+import javax.crypto.spec.PBEKeySpec;
|
||||
+
|
||||
/*
|
||||
* This class is the main class for the JMap utility. It parses its arguments
|
||||
* and decides if the command should be satisfied using the VM attach mechanism
|
||||
@@ -64,6 +69,11 @@ public class JMap {
|
||||
// Default option (if nothing provided)
|
||||
private static String DEFAULT_OPTION = "-pmap";
|
||||
|
||||
+ // encrypt
|
||||
+ private static int SALT_MIN_LENGTH = 8;
|
||||
+ private static int HASH_BIT_SIZE = 256;
|
||||
+ private static int HASH_ITERATIONS_COUNT = 10000;
|
||||
+
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (args.length == 0) {
|
||||
usage(1); // no arguments
|
||||
@@ -169,7 +179,8 @@ public class JMap {
|
||||
if (option.startsWith(DUMP_OPTION_PREFIX)) {
|
||||
// first check that the option can be parsed
|
||||
RedactParams redactParams = new RedactParams();
|
||||
- String fn = parseDumpOptions(option, redactParams);
|
||||
+ String pid = args.length == 1 ? args[0] : null;
|
||||
+ String fn = parseDumpOptions(option, redactParams, pid);
|
||||
if (fn == null) {
|
||||
usage(1);
|
||||
}
|
||||
@@ -258,16 +269,10 @@ public class JMap {
|
||||
private static void dump(String pid, String options) throws IOException {
|
||||
RedactParams redactParams = new RedactParams();
|
||||
// parse the options to get the dump filename
|
||||
- String filename = parseDumpOptions(options,redactParams);
|
||||
+ String filename = parseDumpOptions(options, redactParams, pid);
|
||||
if (filename == null) {
|
||||
usage(1); // invalid options or no filename
|
||||
}
|
||||
-
|
||||
- String redactPassword = ",RedactPassword=";
|
||||
- if (options.contains("RedactPassword,") || options.contains(",RedactPassword")) {
|
||||
- // heap dump may need a password
|
||||
- redactPassword = getRedactPassword();
|
||||
- }
|
||||
// get the canonical path - important to avoid just passing
|
||||
// a "heap.bin" and having the dump created in the target VM
|
||||
// working directory rather than the directory where jmap
|
||||
@@ -282,12 +287,12 @@ public class JMap {
|
||||
InputStream in = ((HotSpotVirtualMachine)vm).
|
||||
dumpHeap((Object)filename,
|
||||
(live ? LIVE_OBJECTS_OPTION : ALL_OBJECTS_OPTION),
|
||||
- redactParams.isEnableRedact() ? redactParams.toDumpArgString() + redactPassword : "");
|
||||
+ redactParams.isEnableRedact() ? redactParams.toDumpArgString() : "");
|
||||
drain(vm, in);
|
||||
}
|
||||
|
||||
- private static String getRedactPassword() {
|
||||
- String redactPassword = ",RedactPassword=";
|
||||
+ private static String getRedactPassword(String pid) {
|
||||
+ String redactPassword = "";
|
||||
Console console = System.console();
|
||||
char[] passwords = null;
|
||||
if (console == null) {
|
||||
@@ -305,53 +310,97 @@ public class JMap {
|
||||
String password = new String(passwords);
|
||||
Arrays.fill(passwords, '0');
|
||||
String passwordPattern = "^[0-9a-zA-Z!@#$]{1,9}$";
|
||||
- if(!password.matches(passwordPattern)) {
|
||||
- return redactPassword;
|
||||
- }
|
||||
|
||||
String digestStr = null;
|
||||
- byte[] passwordBytes = null;
|
||||
char[] passwordValue = null;
|
||||
try {
|
||||
Field valueField = password.getClass().getDeclaredField("value");
|
||||
valueField.setAccessible(true);
|
||||
passwordValue = (char[])valueField.get(password);
|
||||
|
||||
- passwordBytes= password.getBytes(StandardCharsets.UTF_8);
|
||||
- StringBuilder digestStrBuilder = new StringBuilder();
|
||||
- MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
|
||||
- byte[] digestBytes = messageDigest.digest(passwordBytes);
|
||||
- for(byte b : digestBytes) {
|
||||
- String hex = Integer.toHexString(0xff & b);
|
||||
- if(hex.length() == 1) {
|
||||
- digestStrBuilder.append('0');
|
||||
- }
|
||||
- digestStrBuilder.append(hex);
|
||||
+ if(!password.matches(passwordPattern)) {
|
||||
+ return redactPassword;
|
||||
+ }
|
||||
+
|
||||
+ String salt = getSalt(pid);
|
||||
+ if(salt == null) {
|
||||
+ return redactPassword;
|
||||
+ }
|
||||
+ byte[] saltBytes = salt.getBytes("UTF-8");
|
||||
+ if(saltBytes.length < SALT_MIN_LENGTH) {
|
||||
+ return redactPassword;
|
||||
}
|
||||
- digestStr = digestStrBuilder.toString();
|
||||
+
|
||||
+ digestStr = getEncryptValue(passwordValue, saltBytes);
|
||||
} catch (Exception e) {
|
||||
}finally {
|
||||
// clear all password
|
||||
- if(passwordBytes != null) {
|
||||
- Arrays.fill(passwordBytes, (byte) 0);
|
||||
- }
|
||||
if(passwordValue != null) {
|
||||
Arrays.fill(passwordValue, '0');
|
||||
}
|
||||
}
|
||||
|
||||
- redactPassword += (digestStr == null ? "" : digestStr);
|
||||
+ redactPassword = (digestStr == null ? "" : digestStr);
|
||||
return redactPassword;
|
||||
}
|
||||
|
||||
+ private static String getSalt(String pid) throws Exception {
|
||||
+ String salt = null;
|
||||
+ StringBuilder redactAuth = new StringBuilder();
|
||||
+
|
||||
+ VirtualMachine vm = VirtualMachine.attach(pid);
|
||||
+ HotSpotVirtualMachine hvm = (HotSpotVirtualMachine) vm;
|
||||
+ String flag = "RedactPassword";
|
||||
+ try (InputStream in = hvm.printFlag(flag)) {
|
||||
+ byte b[] = new byte[256];
|
||||
+ int n;
|
||||
+ do {
|
||||
+ n = in.read(b);
|
||||
+ if (n > 0) {
|
||||
+ redactAuth.append(new String(b, 0, n, "UTF-8"));
|
||||
+ }
|
||||
+ } while (n > 0);
|
||||
+ }
|
||||
+ vm.detach();
|
||||
+
|
||||
+ if(redactAuth.length() > 0) {
|
||||
+ String[] auths = redactAuth.toString().split(",");
|
||||
+ if(auths.length != 2) {
|
||||
+ return salt;
|
||||
+ }
|
||||
+ return auths[1].trim();
|
||||
+ }
|
||||
+
|
||||
+ return salt;
|
||||
+ }
|
||||
+
|
||||
+ private static String getEncryptValue(char[] passwordValue, byte[] saltBytes) throws InvalidKeySpecException, NoSuchAlgorithmException {
|
||||
+ StringBuilder digestStrBuilder = new StringBuilder();
|
||||
+
|
||||
+ KeySpec spec = new PBEKeySpec(passwordValue, saltBytes, HASH_ITERATIONS_COUNT, HASH_BIT_SIZE);
|
||||
+ SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
|
||||
+ SecretKey secretKey = secretKeyFactory.generateSecret(spec);
|
||||
+ byte[] digestBytes = secretKey.getEncoded();
|
||||
+ for (byte b : digestBytes) {
|
||||
+ String hex = Integer.toHexString(0xff & b);
|
||||
+ if (hex.length() == 1) {
|
||||
+ digestStrBuilder.append('0');
|
||||
+ }
|
||||
+ digestStrBuilder.append(hex);
|
||||
+ }
|
||||
+ String digestStr = digestStrBuilder.toString();
|
||||
+
|
||||
+ return digestStr;
|
||||
+ }
|
||||
+
|
||||
// Parse the options to the -dump option. Valid options are format=b and
|
||||
// file=<file>. Returns <file> if provided. Returns null if <file> not
|
||||
// provided, or invalid option.
|
||||
private static String parseDumpOptions(String arg){
|
||||
- return parseDumpOptions(arg, null);
|
||||
+ return parseDumpOptions(arg, null, null);
|
||||
}
|
||||
|
||||
- private static String parseDumpOptions(String arg, RedactParams redactParams) {
|
||||
+ private static String parseDumpOptions(String arg, RedactParams redactParams, String pid) {
|
||||
assert arg.startsWith(DUMP_OPTION_PREFIX);
|
||||
|
||||
String filename = null;
|
||||
@@ -366,8 +415,6 @@ public class JMap {
|
||||
// ignore format (not needed at this time)
|
||||
} else if (option.equals("live")) {
|
||||
// a valid suboption
|
||||
- } else if (option.equals("RedactPassword")) {
|
||||
- // ignore this option, just suit the parse rule
|
||||
} else {
|
||||
// file=<file> - check that <file> is specified
|
||||
if (option.startsWith("file=")) {
|
||||
@@ -376,7 +423,7 @@ public class JMap {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
- if (redactParams != null && initRedactParams(redactParams, option)) {
|
||||
+ if (redactParams != null && initRedactParams(redactParams, option, pid)) {
|
||||
continue;
|
||||
}
|
||||
return null; // option not recognized
|
||||
@@ -397,7 +444,7 @@ public class JMap {
|
||||
return filename;
|
||||
}
|
||||
|
||||
- private static boolean initRedactParams(RedactParams redactParams, String option) {
|
||||
+ private static boolean initRedactParams(RedactParams redactParams, String option, String pid) {
|
||||
if (option.startsWith("HeapDumpRedact=")) {
|
||||
if (!redactParams.setAndCheckHeapDumpRedact(option.substring("HeapDumpRedact=".length()))) {
|
||||
usage(1);
|
||||
@@ -409,9 +456,14 @@ public class JMap {
|
||||
} else if (option.startsWith("RedactMapFile=")) {
|
||||
redactParams.setRedactMapFile(option.substring("RedactMapFile=".length()));
|
||||
return true;
|
||||
- } else if (option.startsWith("RedactClassPath")) {
|
||||
+ } else if (option.startsWith("RedactClassPath=")) {
|
||||
redactParams.setRedactClassPath(option.substring("RedactClassPath=".length()));
|
||||
return true;
|
||||
+ } else if (option.startsWith("RedactPassword")) {
|
||||
+ // heap dump may need a password
|
||||
+ String redactPassword = getRedactPassword(pid);
|
||||
+ redactParams.setRedactPassword(redactPassword);
|
||||
+ return true;
|
||||
} else {
|
||||
// None matches
|
||||
return false;
|
||||
@@ -544,11 +596,12 @@ public class JMap {
|
||||
private String redactMap;
|
||||
private String redactMapFile;
|
||||
private String redactClassPath;
|
||||
+ private String redactPassword;
|
||||
|
||||
public RedactParams() {
|
||||
}
|
||||
|
||||
- public RedactParams(String heapDumpRedact, String redactMap, String redactMapFile, String redactClassPath) {
|
||||
+ public RedactParams(String heapDumpRedact, String redactMap, String redactMapFile, String redactClassPath, String redactPassword) {
|
||||
if (heapDumpRedact != null && checkLauncherHeapdumpRedactSupport(heapDumpRedact)) {
|
||||
enableRedact = true;
|
||||
}
|
||||
@@ -556,6 +609,7 @@ public class JMap {
|
||||
this.redactMap = redactMap;
|
||||
this.redactMapFile = redactMapFile;
|
||||
this.redactClassPath = redactClassPath;
|
||||
+ this.redactPassword = redactPassword;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -579,6 +633,11 @@ public class JMap {
|
||||
if (redactClassPath != null) {
|
||||
builder.append("RedactClassPath=");
|
||||
builder.append(redactClassPath);
|
||||
+ builder.append(",");
|
||||
+ }
|
||||
+ if (redactPassword != null) {
|
||||
+ builder.append("RedactPassword=");
|
||||
+ builder.append(redactPassword);
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
@@ -587,7 +646,8 @@ public class JMap {
|
||||
return "-HeapDumpRedact=" + (heapDumpRedact == null ? "off" : heapDumpRedact) +
|
||||
",RedactMap=" + (redactMap == null ? "" : redactMap) +
|
||||
",RedactMapFile=" + (redactMapFile == null ? "" : redactMapFile) +
|
||||
- ",RedactClassPath=" + (redactClassPath == null ? "" : redactClassPath);
|
||||
+ ",RedactClassPath=" + (redactClassPath == null ? "" : redactClassPath) +
|
||||
+ ",RedactPassword=" + (redactPassword == null ? "" : redactPassword);
|
||||
}
|
||||
|
||||
public static boolean checkLauncherHeapdumpRedactSupport(String value) {
|
||||
@@ -644,5 +704,13 @@ public class JMap {
|
||||
public void setRedactClassPath(String redactClassPath) {
|
||||
this.redactClassPath = redactClassPath;
|
||||
}
|
||||
+
|
||||
+ public String getRedactPassword() {
|
||||
+ return redactPassword;
|
||||
+ }
|
||||
+
|
||||
+ public void setRedactPassword(String redactPassword) {
|
||||
+ this.redactPassword = redactPassword;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
--
|
||||
2.22.0
|
||||
|
||||
@ -1,68 +0,0 @@
|
||||
From 9945034658585ea943e6326340c06b5932af8d67 Mon Sep 17 00:00:00 2001
|
||||
Date: Thu, 5 Dec 2019 10:29:18 +0000
|
||||
Subject: [PATCH] Support 'Git commit ID' in the SOURCE field of the release
|
||||
file.
|
||||
|
||||
Summary: <make>:Support 'Git commit ID' in the SOURCE field of the release file.
|
||||
LLT: NA
|
||||
Bug url: NA
|
||||
---
|
||||
common/autoconf/spec.gmk.in | 1 +
|
||||
make/common/MakeBase.gmk | 29 +++++++++++++++++------------
|
||||
2 files changed, 18 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
|
||||
index 88f9f539..506cf617 100644
|
||||
--- a/common/autoconf/spec.gmk.in
|
||||
+++ b/common/autoconf/spec.gmk.in
|
||||
@@ -578,6 +578,7 @@ READELF:=@READELF@
|
||||
EXPR:=@EXPR@
|
||||
FILE:=@FILE@
|
||||
HG:=@HG@
|
||||
+GIT:=@GIT@
|
||||
OBJCOPY:=@OBJCOPY@
|
||||
SETFILE:=@SETFILE@
|
||||
XATTR:=@XATTR@
|
||||
diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk
|
||||
index 9e5e704b..9b7ad702 100644
|
||||
--- a/make/common/MakeBase.gmk
|
||||
+++ b/make/common/MakeBase.gmk
|
||||
@@ -308,18 +308,23 @@ REPO_LIST = $(patsubst ./%,%,$(patsubst %/,%,$(sort $(dir \
|
||||
|
||||
# Emit the repo:id pairs to $@
|
||||
define GetSourceTips
|
||||
- $(CD) $(SRC_ROOT) ; \
|
||||
- for i in $(REPO_LIST) IGNORE ; do \
|
||||
- if [ "$${i}" = "IGNORE" ] ; then \
|
||||
- continue; \
|
||||
- elif [ -d $${i}/$(HG_DIRECTORY) -a "$(HG_VERSION)" != "" ] ; then \
|
||||
- $(PRINTF) " %s:%s" \
|
||||
- "$${i}" `$(HG) id -i --repository $${i}` ; \
|
||||
- elif [ -f $${i}/$(HGTIP_FILENAME) ] ; then \
|
||||
- $(PRINTF) " %s:%s" \
|
||||
- "$${i}" `$(CAT) $${i}/$(HGTIP_FILENAME)` ; \
|
||||
- fi; \
|
||||
- done >> $@
|
||||
+ $(if $(and $(HG), $(wildcard $(TOPDIR)/.hg)), \
|
||||
+ $$($(CD) $(SRC_ROOT) ; \
|
||||
+ for i in $(REPO_LIST) IGNORE ; do \
|
||||
+ if [ "$${i}" = "IGNORE" ] ; then \
|
||||
+ continue; \
|
||||
+ elif [ -d $${i}/$(HG_DIRECTORY) -a "$(HG_VERSION)" != "" ] ; then \
|
||||
+ $(PRINTF) " %s:%s" \
|
||||
+ "$${i}" `$(HG) id -i --repository $${i}` ; \
|
||||
+ elif [ -f $${i}/$(HGTIP_FILENAME) ] ; then \
|
||||
+ $(PRINTF) " %s:%s" \
|
||||
+ "$${i}" `$(CAT) $${i}/$(HGTIP_FILENAME)` ; \
|
||||
+ fi; \
|
||||
+ done >> $@), \
|
||||
+ $(if $(and $(GIT), $(wildcard $(TOPDIR)/.git)), \
|
||||
+ $(PRINTF) ".:git:%s%s\n" \
|
||||
+ "$$(git log -n1 --format=%H | cut -c1-12)" \
|
||||
+ "$$(if test -n "$$(git status --porcelain)"; then printf '+'; fi)" >> $@, ))
|
||||
$(PRINTF) "\n" >> $@
|
||||
endef
|
||||
|
||||
--
|
||||
2.19.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,52 +0,0 @@
|
||||
From b6a24b666a1c7536e35afaba4057cc8eac6fe48f Mon Sep 17 00:00:00 2001
|
||||
Date: Thu, 21 Sep 2023 15:25:03 +0800
|
||||
Subject: add 8146431-j.u.z.ZipFile.getEntry-throws-AIOOBE
|
||||
|
||||
---
|
||||
jdk/src/share/classes/java/util/zip/ZipFile.java | 2 +-
|
||||
jdk/test/java/util/zip/ZipFile/TestZipFile.java | 9 ++++++++-
|
||||
2 files changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/ZipFile.java b/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
index 38b642bdc..36135a9c0 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
@@ -1313,7 +1313,7 @@ class ZipFile implements ZipConstants, Closeable {
|
||||
idx = getEntryNext(idx);
|
||||
}
|
||||
/* If not addSlash, or slash is already there, we are done */
|
||||
- if (!addSlash || name[name.length - 1] == '/') {
|
||||
+ if (!addSlash || name.length == 0 || name[name.length - 1] == '/') {
|
||||
return -1;
|
||||
}
|
||||
// Add a slash to the hash code
|
||||
diff --git a/jdk/test/java/util/zip/ZipFile/TestZipFile.java b/jdk/test/java/util/zip/ZipFile/TestZipFile.java
|
||||
index 30bae3bb9..773f47558 100644
|
||||
--- a/jdk/test/java/util/zip/ZipFile/TestZipFile.java
|
||||
+++ b/jdk/test/java/util/zip/ZipFile/TestZipFile.java
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
- * @bug 8142508
|
||||
+ * @bug 8142508 8146431
|
||||
* @summary Tests various ZipFile apis
|
||||
* @run main/manual TestZipFile
|
||||
*/
|
||||
@@ -230,6 +230,13 @@ public class TestZipFile {
|
||||
}
|
||||
|
||||
static void doTest0(Zip zip, ZipFile zf) throws Throwable {
|
||||
+ // (0) check zero-length entry name, no AIOOBE
|
||||
+ try {
|
||||
+ check(zf.getEntry("") == null);;
|
||||
+ } catch (Throwable t) {
|
||||
+ unexpected(t);
|
||||
+ }
|
||||
+
|
||||
List<ZipEntry> list = new ArrayList(zip.entries.keySet());
|
||||
// (1) check entry list, in expected order
|
||||
if (!check(Arrays.equals(
|
||||
--
|
||||
2.22.0
|
||||
|
||||
@ -1,45 +0,0 @@
|
||||
From 8e3e20eef3f18d023ffc327a9fae30c34de84773 Mon Sep 17 00:00:00 2001
|
||||
Date: Thu, 21 Sep 2023 15:24:45 +0800
|
||||
Subject: add 8170831-ZipFile-implementation-no-longer-caches-the
|
||||
|
||||
---
|
||||
jdk/src/share/classes/java/util/zip/ZipFile.java | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/ZipFile.java b/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
index b6a6c2a48..38b642bdc 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
@@ -342,7 +342,9 @@ class ZipFile implements ZipConstants, Closeable {
|
||||
ZipFileInputStream in = null;
|
||||
synchronized (this) {
|
||||
ensureOpen();
|
||||
- if (!zc.isUTF8() && (entry.flag & EFS) != 0) {
|
||||
+ if (Objects.equals(lastEntryName, entry.name)) {
|
||||
+ pos = lastEntryPos;
|
||||
+ } else if (!zc.isUTF8() && (entry.flag & EFS) != 0) {
|
||||
pos = zsrc.getEntryPos(zc.getBytesUTF8(entry.name), false);
|
||||
} else {
|
||||
pos = zsrc.getEntryPos(zc.getBytes(entry.name), false);
|
||||
@@ -533,6 +535,9 @@ class ZipFile implements ZipConstants, Closeable {
|
||||
Spliterator.IMMUTABLE | Spliterator.NONNULL), false);
|
||||
}
|
||||
|
||||
+ private String lastEntryName;
|
||||
+ private int lastEntryPos;
|
||||
+
|
||||
/* Checks ensureOpen() before invoke this method */
|
||||
private ZipEntry getZipEntry(String name, int pos) {
|
||||
byte[] cen = zsrc.cen;
|
||||
@@ -566,6 +571,8 @@ class ZipFile implements ZipConstants, Closeable {
|
||||
e.comment = zc.toString(cen, start, clen);
|
||||
}
|
||||
}
|
||||
+ lastEntryName = e.name;
|
||||
+ lastEntryPos = pos;
|
||||
return e;
|
||||
}
|
||||
|
||||
--
|
||||
2.22.0
|
||||
|
||||
@ -1,274 +0,0 @@
|
||||
From 131462b71b86d97bd7dadf7a099d4395d9057423 Mon Sep 17 00:00:00 2001
|
||||
Date: Thu, 21 Sep 2023 15:16:36 +0800
|
||||
Subject: add 8226530-ZipFile-reads-wrong-entry-size-from-ZIP64-en
|
||||
|
||||
---
|
||||
.../share/classes/java/util/zip/ZipEntry.java | 41 +++--
|
||||
.../share/classes/java/util/zip/ZipFile.java | 2 +-
|
||||
.../classes/java/util/zip/ZipInputStream.java | 4 +-
|
||||
.../java/util/zip/ZipFile/Zip64SizeTest.java | 147 ++++++++++++++++++
|
||||
4 files changed, 179 insertions(+), 15 deletions(-)
|
||||
create mode 100644 jdk/test/java/util/zip/ZipFile/Zip64SizeTest.java
|
||||
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/ZipEntry.java b/jdk/src/share/classes/java/util/zip/ZipEntry.java
|
||||
index aa93bcb36..4a15428ac 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/ZipEntry.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/ZipEntry.java
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
+ * Copyright (c) 1995, 2019, 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
|
||||
@@ -440,7 +440,7 @@ class ZipEntry implements ZipConstants, Cloneable {
|
||||
* @see #getExtra()
|
||||
*/
|
||||
public void setExtra(byte[] extra) {
|
||||
- setExtra0(extra, false);
|
||||
+ setExtra0(extra, false, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -450,8 +450,11 @@ class ZipEntry implements ZipConstants, Cloneable {
|
||||
* the extra field data bytes
|
||||
* @param doZIP64
|
||||
* if true, set size and csize from ZIP64 fields if present
|
||||
+ * @param isLOC
|
||||
+ * true if setting the extra field for a LOC, false if for
|
||||
+ * a CEN
|
||||
*/
|
||||
- void setExtra0(byte[] extra, boolean doZIP64) {
|
||||
+ void setExtra0(byte[] extra, boolean doZIP64, boolean isLOC) {
|
||||
if (extra != null) {
|
||||
if (extra.length > 0xFFFF) {
|
||||
throw new IllegalArgumentException("invalid extra field length");
|
||||
@@ -468,15 +471,29 @@ class ZipEntry implements ZipConstants, Cloneable {
|
||||
switch (tag) {
|
||||
case EXTID_ZIP64:
|
||||
if (doZIP64) {
|
||||
- // LOC extra zip64 entry MUST include BOTH original
|
||||
- // and compressed file size fields.
|
||||
- // If invalid zip64 extra fields, simply skip. Even
|
||||
- // it's rare, it's possible the entry size happens to
|
||||
- // be the magic value and it "accidently" has some
|
||||
- // bytes in extra match the id.
|
||||
- if (sz >= 16) {
|
||||
- size = get64(extra, off);
|
||||
- csize = get64(extra, off + 8);
|
||||
+ if (isLOC) {
|
||||
+ // LOC extra zip64 entry MUST include BOTH original
|
||||
+ // and compressed file size fields.
|
||||
+ // If invalid zip64 extra fields, simply skip. Even
|
||||
+ // it's rare, it's possible the entry size happens to
|
||||
+ // be the magic value and it "accidently" has some
|
||||
+ // bytes in extra match the id.
|
||||
+ if (sz >= 16) {
|
||||
+ size = get64(extra, off);
|
||||
+ csize = get64(extra, off + 8);
|
||||
+ }
|
||||
+ } else {
|
||||
+ // CEN extra zip64
|
||||
+ if (size == ZIP64_MAGICVAL) {
|
||||
+ if (off + 8 > len) // invalid zip64 extra
|
||||
+ break; // fields, just skip
|
||||
+ size = get64(extra, off);
|
||||
+ }
|
||||
+ if (csize == ZIP64_MAGICVAL) {
|
||||
+ if (off + 16 > len) // invalid zip64 extra
|
||||
+ break; // fields, just skip
|
||||
+ csize = get64(extra, off + 8);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
break;
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/ZipFile.java b/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
index 5d9b0de97..9e854e84d 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
@@ -556,7 +556,7 @@ class ZipFile implements ZipConstants, Closeable {
|
||||
e.method = CENHOW(cen, pos);
|
||||
if (elen != 0) {
|
||||
int start = pos + CENHDR + nlen;
|
||||
- e.setExtra0(Arrays.copyOfRange(cen, start, start + elen), true);
|
||||
+ e.setExtra0(Arrays.copyOfRange(cen, start, start + elen), true, false);
|
||||
}
|
||||
if (clen != 0) {
|
||||
int start = pos + CENHDR + nlen + elen;
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/ZipInputStream.java b/jdk/src/share/classes/java/util/zip/ZipInputStream.java
|
||||
index 98526ef82..398dd70ad 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/ZipInputStream.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/ZipInputStream.java
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
+ * Copyright (c) 1996, 2019, 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
|
||||
@@ -320,7 +320,7 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants {
|
||||
byte[] extra = new byte[len];
|
||||
readFully(extra, 0, len);
|
||||
e.setExtra0(extra,
|
||||
- e.csize == ZIP64_MAGICVAL || e.size == ZIP64_MAGICVAL);
|
||||
+ e.csize == ZIP64_MAGICVAL || e.size == ZIP64_MAGICVAL, true);
|
||||
}
|
||||
return e;
|
||||
}
|
||||
diff --git a/jdk/test/java/util/zip/ZipFile/Zip64SizeTest.java b/jdk/test/java/util/zip/ZipFile/Zip64SizeTest.java
|
||||
new file mode 100644
|
||||
index 000000000..be701e480
|
||||
--- /dev/null
|
||||
+++ b/jdk/test/java/util/zip/ZipFile/Zip64SizeTest.java
|
||||
@@ -0,0 +1,147 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2019, 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.AfterMethod;
|
||||
+import org.testng.annotations.BeforeMethod;
|
||||
+import org.testng.annotations.Test;
|
||||
+
|
||||
+import java.io.*;
|
||||
+import java.nio.file.Files;
|
||||
+import java.nio.file.Path;
|
||||
+import java.util.List;
|
||||
+import java.util.zip.ZipEntry;
|
||||
+import java.util.zip.ZipFile;
|
||||
+import java.util.zip.ZipOutputStream;
|
||||
+
|
||||
+import static org.testng.Assert.assertTrue;
|
||||
+
|
||||
+/**
|
||||
+ * @test
|
||||
+ * @bug 8226530
|
||||
+ * @summary ZIP File System tests that leverage DirectoryStream
|
||||
+ * @modules java.base
|
||||
+ * @compile Zip64SizeTest.java
|
||||
+ * @run testng Zip64SizeTest
|
||||
+ */
|
||||
+public class Zip64SizeTest {
|
||||
+
|
||||
+ private static final int BUFFER_SIZE = 2048;
|
||||
+ // ZIP file to create
|
||||
+ private static final String ZIP_FILE_NAME = "Zip64SizeTest.zip";
|
||||
+ // File that will be created with a size greater than 0xFFFFFFFF
|
||||
+ private static final String LARGE_FILE_NAME = "LargeZipEntry.txt";
|
||||
+ // File that will be created with a size less than 0xFFFFFFFF
|
||||
+ private static final String SMALL_FILE_NAME = "SmallZipEntry.txt";
|
||||
+ // List of files to be added to the ZIP file
|
||||
+ private static final List<String> ZIP_ENTRIES = List.of(LARGE_FILE_NAME,
|
||||
+ SMALL_FILE_NAME);
|
||||
+ private static final long LARGE_FILE_SIZE = 5L * 1024L * 1024L * 1024L; // 5GB
|
||||
+ private static final long SMALL_FILE_SIZE = 0x100000L; // 1024L x 1024L;
|
||||
+
|
||||
+ /**
|
||||
+ * Validate that if the size of a ZIP entry exceeds 0xFFFFFFFF, that the
|
||||
+ * correct size is returned from the ZIP64 Extended information.
|
||||
+ * @throws IOException
|
||||
+ */
|
||||
+ @Test
|
||||
+ private static void validateZipEntrySizes() throws IOException {
|
||||
+ createFiles();
|
||||
+ createZipFile();
|
||||
+ System.out.println("Validating Zip Entry Sizes");
|
||||
+ try (ZipFile zip = new ZipFile(ZIP_FILE_NAME)) {
|
||||
+ ZipEntry ze = zip.getEntry(LARGE_FILE_NAME);
|
||||
+ System.out.printf("Entry: %s, size= %s%n", ze.getName(), ze.getSize());
|
||||
+ assertTrue(ze.getSize() == LARGE_FILE_SIZE);
|
||||
+ ze = zip.getEntry(SMALL_FILE_NAME);
|
||||
+ System.out.printf("Entry: %s, size= %s%n", ze.getName(), ze.getSize());
|
||||
+ assertTrue(ze.getSize() == SMALL_FILE_SIZE);
|
||||
+
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Delete the files created for use by the test
|
||||
+ * @throws IOException if an error occurs deleting the files
|
||||
+ */
|
||||
+ private static void deleteFiles() throws IOException {
|
||||
+ Files.deleteIfExists(Path.of(ZIP_FILE_NAME));
|
||||
+ Files.deleteIfExists(Path.of(LARGE_FILE_NAME));
|
||||
+ Files.deleteIfExists(Path.of(SMALL_FILE_NAME));
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Create the ZIP file adding an entry whose size exceeds 0xFFFFFFFF
|
||||
+ * @throws IOException if an error occurs creating the ZIP File
|
||||
+ */
|
||||
+ private static void createZipFile() throws IOException {
|
||||
+ try (FileOutputStream fos = new FileOutputStream(ZIP_FILE_NAME);
|
||||
+ ZipOutputStream zos = new ZipOutputStream(fos)) {
|
||||
+ System.out.printf("Creating Zip file: %s%n", ZIP_FILE_NAME);
|
||||
+ for (String srcFile : ZIP_ENTRIES) {
|
||||
+ System.out.printf("...Adding Entry: %s%n", srcFile);
|
||||
+ File fileToZip = new File(srcFile);
|
||||
+ try (FileInputStream fis = new FileInputStream(fileToZip)) {
|
||||
+ ZipEntry zipEntry = new ZipEntry(fileToZip.getName());
|
||||
+ zipEntry.setSize(fileToZip.length());
|
||||
+ zos.putNextEntry(zipEntry);
|
||||
+ byte[] bytes = new byte[BUFFER_SIZE];
|
||||
+ int length;
|
||||
+ while ((length = fis.read(bytes)) >= 0) {
|
||||
+ zos.write(bytes, 0, length);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Create the files that will be added to the ZIP file
|
||||
+ * @throws IOException if there is a problem creating the files
|
||||
+ */
|
||||
+ private static void createFiles() throws IOException {
|
||||
+ try (RandomAccessFile largeFile = new RandomAccessFile(LARGE_FILE_NAME, "rw");
|
||||
+ RandomAccessFile smallFile = new RandomAccessFile(SMALL_FILE_NAME, "rw")) {
|
||||
+ System.out.printf("Creating %s%n", LARGE_FILE_NAME);
|
||||
+ largeFile.setLength(LARGE_FILE_SIZE);
|
||||
+ System.out.printf("Creating %s%n", SMALL_FILE_NAME);
|
||||
+ smallFile.setLength(SMALL_FILE_SIZE);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Make sure the needed test files do not exist prior to executing the test
|
||||
+ * @throws IOException
|
||||
+ */
|
||||
+ @BeforeMethod
|
||||
+ public void setUp() throws IOException {
|
||||
+ deleteFiles();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Remove the files created for the test
|
||||
+ * @throws IOException
|
||||
+ */
|
||||
+ @AfterMethod
|
||||
+ public void tearDown() throws IOException {
|
||||
+ deleteFiles();
|
||||
+ }
|
||||
+}
|
||||
\ No newline at end of file
|
||||
--
|
||||
2.22.0
|
||||
|
||||
@ -1,54 +0,0 @@
|
||||
From 6430afa36959aa740f47d64427f06c755ea1549f Mon Sep 17 00:00:00 2001
|
||||
Date: Thu, 21 Sep 2023 15:25:27 +0800
|
||||
Subject: add 8226530-test-case-fixed
|
||||
|
||||
---
|
||||
jdk/test/java/util/zip/ZipFile/Zip64SizeTest.java | 13 +++++++------
|
||||
1 file changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/jdk/test/java/util/zip/ZipFile/Zip64SizeTest.java b/jdk/test/java/util/zip/ZipFile/Zip64SizeTest.java
|
||||
index be701e480..c466ffa07 100644
|
||||
--- a/jdk/test/java/util/zip/ZipFile/Zip64SizeTest.java
|
||||
+++ b/jdk/test/java/util/zip/ZipFile/Zip64SizeTest.java
|
||||
@@ -26,7 +26,8 @@ import org.testng.annotations.Test;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
-import java.nio.file.Path;
|
||||
+import java.nio.file.Paths;
|
||||
+import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipFile;
|
||||
@@ -52,7 +53,7 @@ public class Zip64SizeTest {
|
||||
// File that will be created with a size less than 0xFFFFFFFF
|
||||
private static final String SMALL_FILE_NAME = "SmallZipEntry.txt";
|
||||
// List of files to be added to the ZIP file
|
||||
- private static final List<String> ZIP_ENTRIES = List.of(LARGE_FILE_NAME,
|
||||
+ private static final List<String> ZIP_ENTRIES = Arrays.asList(LARGE_FILE_NAME,
|
||||
SMALL_FILE_NAME);
|
||||
private static final long LARGE_FILE_SIZE = 5L * 1024L * 1024L * 1024L; // 5GB
|
||||
private static final long SMALL_FILE_SIZE = 0x100000L; // 1024L x 1024L;
|
||||
@@ -83,9 +84,9 @@ public class Zip64SizeTest {
|
||||
* @throws IOException if an error occurs deleting the files
|
||||
*/
|
||||
private static void deleteFiles() throws IOException {
|
||||
- Files.deleteIfExists(Path.of(ZIP_FILE_NAME));
|
||||
- Files.deleteIfExists(Path.of(LARGE_FILE_NAME));
|
||||
- Files.deleteIfExists(Path.of(SMALL_FILE_NAME));
|
||||
+ Files.deleteIfExists(Paths.get(ZIP_FILE_NAME));
|
||||
+ Files.deleteIfExists(Paths.get(LARGE_FILE_NAME));
|
||||
+ Files.deleteIfExists(Paths.get(SMALL_FILE_NAME));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,4 +145,4 @@ public class Zip64SizeTest {
|
||||
public void tearDown() throws IOException {
|
||||
deleteFiles();
|
||||
}
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+}
|
||||
--
|
||||
2.22.0
|
||||
|
||||
@ -1,70 +0,0 @@
|
||||
From be90711b32cb79822222d31f258ff4e0f45a616c Mon Sep 17 00:00:00 2001
|
||||
Date: Thu, 21 Sep 2023 15:24:07 +0800
|
||||
Subject: add 8242842-Avoid-reallocating-name-when-checking-for-tr
|
||||
|
||||
---
|
||||
.../share/classes/java/util/zip/ZipFile.java | 25 ++++++++++++-------
|
||||
1 file changed, 16 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/ZipFile.java b/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
index 9e854e84d..b6a6c2a48 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
@@ -1049,7 +1049,7 @@ class ZipFile implements ZipConstants, Closeable {
|
||||
return h;
|
||||
}
|
||||
|
||||
- private static final int hash_append(int hash, byte b) {
|
||||
+ private static final int hashAppend(int hash, byte b) {
|
||||
return hash * 31 + b;
|
||||
}
|
||||
|
||||
@@ -1267,11 +1267,13 @@ class ZipFile implements ZipConstants, Closeable {
|
||||
}
|
||||
int hsh = hashN(name, 0, name.length);
|
||||
int idx = table[(hsh & 0x7fffffff) % tablelen];
|
||||
+ boolean appendSlash = false;
|
||||
/*
|
||||
* This while loop is an optimization where a double lookup
|
||||
- * for name and name+/ is being performed. The name char
|
||||
- * array has enough room at the end to try again with a
|
||||
- * slash appended if the first table lookup does not succeed.
|
||||
+ * for name and name+/ is being performed. The name byte
|
||||
+ * array will be updated with an added slash only if the first
|
||||
+ * table lookup fails and there is a matching hash value for
|
||||
+ * name+/.
|
||||
*/
|
||||
while(true) {
|
||||
/*
|
||||
@@ -1282,6 +1284,11 @@ class ZipFile implements ZipConstants, Closeable {
|
||||
if (getEntryHash(idx) == hsh) {
|
||||
// The CEN name must match the specfied one
|
||||
int pos = getEntryPos(idx);
|
||||
+ if (appendSlash) {
|
||||
+ name = Arrays.copyOf(name, name.length + 1);
|
||||
+ name[name.length - 1] = '/';
|
||||
+ appendSlash = false;
|
||||
+ }
|
||||
if (name.length == CENNAM(cen, pos)) {
|
||||
boolean matched = true;
|
||||
int nameoff = pos + CENHDR;
|
||||
@@ -1302,11 +1309,11 @@ class ZipFile implements ZipConstants, Closeable {
|
||||
if (!addSlash || name[name.length - 1] == '/') {
|
||||
return -1;
|
||||
}
|
||||
- /* Add slash and try once more */
|
||||
- name = Arrays.copyOf(name, name.length + 1);
|
||||
- name[name.length - 1] = '/';
|
||||
- hsh = hash_append(hsh, (byte)'/');
|
||||
- //idx = table[hsh % tablelen];
|
||||
+ // Add a slash to the hash code
|
||||
+ hsh = hashAppend(hsh, (byte)'/');
|
||||
+ // If we find a match on the new hash code, we need to append a
|
||||
+ // slash when comparing
|
||||
+ appendSlash = true;
|
||||
idx = table[(hsh & 0x7fffffff) % tablelen];
|
||||
addSlash = false;
|
||||
}
|
||||
--
|
||||
2.22.0
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
From 7965b56b3269b8e553ce929a466466990c9d0c07 Mon Sep 17 00:00:00 2001
|
||||
Date: Fri, 22 Sep 2023 14:45:16 +0800
|
||||
Subject: add Adapting-IOException-of-Zip-to-ZipException
|
||||
|
||||
---
|
||||
jdk/src/share/classes/java/util/zip/ZipFile.java | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/jdk/src/share/classes/java/util/zip/ZipFile.java b/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
index 36135a9c0..e603e83d3 100644
|
||||
--- a/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
+++ b/jdk/src/share/classes/java/util/zip/ZipFile.java
|
||||
@@ -970,7 +970,11 @@ class ZipFile implements ZipConstants, Closeable {
|
||||
return src;
|
||||
}
|
||||
}
|
||||
- src = new Source(key, toDelete);
|
||||
+ try {
|
||||
+ src = new Source(key, toDelete);
|
||||
+ } catch (IOException exception) {
|
||||
+ throw new ZipException(exception.getMessage());
|
||||
+ }
|
||||
|
||||
synchronized (files) {
|
||||
if (files.containsKey(key)) { // someone else put in first
|
||||
--
|
||||
2.22.0
|
||||
|
||||
@ -91,7 +91,7 @@ index 00000000..9b614024
|
||||
--- /dev/null
|
||||
+++ b/version.txt
|
||||
@@ -0,0 +1 @@
|
||||
+8.412.8.0.13
|
||||
+8.432.8.0.13
|
||||
--
|
||||
2.23.0
|
||||
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
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
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
From d94e836f5dc230839aacb4585dcc30575c94d785 Mon Sep 17 00:00:00 2001
|
||||
From: zhangyipeng <zhangyipeng7@huawei.com>
|
||||
Date: Sat, 11 Sep 2021 15:24:54 +0800
|
||||
Subject: [PATCH 16/23] fix wrong commitID in release file
|
||||
|
||||
Summary: <make> : fix wrong commitID in release file
|
||||
LLT: NA
|
||||
Patch Type: huawei
|
||||
Bug url: NA
|
||||
---
|
||||
make/common/MakeBase.gmk | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk
|
||||
index 9b7ad7024..8179139ec 100644
|
||||
--- a/make/common/MakeBase.gmk
|
||||
+++ b/make/common/MakeBase.gmk
|
||||
@@ -322,9 +322,10 @@ define GetSourceTips
|
||||
fi; \
|
||||
done >> $@), \
|
||||
$(if $(and $(GIT), $(wildcard $(TOPDIR)/.git)), \
|
||||
+ $$($(CD) $(SRC_ROOT) ; \
|
||||
$(PRINTF) ".:git:%s%s\n" \
|
||||
"$$(git log -n1 --format=%H | cut -c1-12)" \
|
||||
- "$$(if test -n "$$(git status --porcelain)"; then printf '+'; fi)" >> $@, ))
|
||||
+ "$$(if test -n "$$(git status --porcelain)"; then printf '+'; fi)" >> $@), ))
|
||||
$(PRINTF) "\n" >> $@
|
||||
endef
|
||||
|
||||
--
|
||||
2.22.0
|
||||
|
||||
@ -40,13 +40,13 @@ index 54e1bfa0d..c1423dc5b 100644
|
||||
|
||||
// The numbers of certs now.
|
||||
- private static final int COUNT = 83;
|
||||
+ private static final int COUNT = 104;
|
||||
+ private static final int COUNT = 106;
|
||||
|
||||
// SHA-256 of cacerts, can be generated with
|
||||
// shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95
|
||||
private static final String CHECKSUM
|
||||
- = "2D:04:88:6C:52:53:54:EB:38:2D:BC:E0:AF:B7:82:F4:9E:32:A8:1A:1B:A3:AE:CF:25:CB:C2:F6:0F:4E:E1:20";
|
||||
+ = "1C:10:89:F9:32:8C:05:D1:10:90:27:7F:66:21:28:71:79:8F:55:44:6C:08:BA:00:48:C0:D4:7A:0D:3B:9C:45";
|
||||
+ = "73:5F:49:B0:EC:C0:E4:43:27:B1:5F:D1:9B:A7:8A:05:B4:25:84:A6:81:9F:FC:A7:A7:04:8F:86:82:97:FF:7C";
|
||||
|
||||
// map of cert alias to SHA-256 fingerprint
|
||||
@SuppressWarnings("serial")
|
||||
|
||||
@ -1,115 +0,0 @@
|
||||
diff -ruN jdk8/common/autoconf/libraries.m4 jdk8/common/autoconf/libraries.m4
|
||||
--- jdk8/common/autoconf/libraries.m4 2013-11-14 20:08:01.845065585 -0500
|
||||
+++ jdk8/common/autoconf/libraries.m4 2013-11-14 20:10:56.186553066 -0500
|
||||
@@ -676,6 +676,47 @@
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
+ # Check for the png library
|
||||
+ #
|
||||
+
|
||||
+ AC_ARG_WITH(libpng, [AS_HELP_STRING([--with-libpng],
|
||||
+ [use libpng from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
|
||||
+
|
||||
+ AC_CHECK_LIB(png, png_sig_cmp,
|
||||
+ [ LIBPNG_FOUND=yes ],
|
||||
+ [ LIBPNG_FOUND=no ])
|
||||
+
|
||||
+ AC_MSG_CHECKING([for which libpng to use])
|
||||
+
|
||||
+ # default is bundled
|
||||
+ DEFAULT_LIBPNG=bundled
|
||||
+
|
||||
+ #
|
||||
+ # if user didn't specify, use DEFAULT_LIBPNG
|
||||
+ #
|
||||
+ if test "x${with_libpng}" = "x"; then
|
||||
+ with_libpng=${DEFAULT_libpng}
|
||||
+ fi
|
||||
+
|
||||
+
|
||||
+ if test "x${with_libpng}" = "xbundled"; then
|
||||
+ USE_EXTERNAL_LIBPNG=false
|
||||
+ AC_MSG_RESULT([bundled])
|
||||
+ elif test "x${with_libpng}" = "xsystem"; then
|
||||
+ if test "x${LIBPNG_FOUND}" = "xyes"; then
|
||||
+ USE_EXTERNAL_LIBPNG=true
|
||||
+ AC_MSG_RESULT([system])
|
||||
+ else
|
||||
+ AC_MSG_RESULT([system not found])
|
||||
+ AC_MSG_ERROR([--with-libpng=system specified, but no libpng found!])
|
||||
+ fi
|
||||
+ else
|
||||
+ AC_MSG_ERROR([Invalid value of --with-libpng: ${with_libpng}, use 'system' or 'bundled'])
|
||||
+ fi
|
||||
+ AC_SUBST(USE_EXTERNAL_LIBPNG)
|
||||
+
|
||||
+ ###############################################################################
|
||||
+ #
|
||||
# Check for the zlib library
|
||||
#
|
||||
|
||||
diff -ruN jdk8/common/autoconf/spec.gmk.in jdk8/common/autoconf/spec.gmk.in
|
||||
--- jdk8/common/autoconf/spec.gmk.in 2013-10-31 19:24:33.000000000 -0400
|
||||
+++ jdk8/common/autoconf/spec.gmk.in 2013-11-14 21:10:56.365976518 -0500
|
||||
@@ -548,6 +548,7 @@
|
||||
ENABLE_JFR=@ENABLE_JFR@
|
||||
ENABLE_INTREE_EC=@ENABLE_INTREE_EC@
|
||||
USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
|
||||
+USE_EXTERNAL_LIBPNG:=@USE_EXTERNAL_LIBPNG@
|
||||
USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@
|
||||
USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
|
||||
LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@
|
||||
diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries.gmk
|
||||
--- jdk8/jdk/make/lib/Awt2dLibraries.gmk 2013-11-14 20:08:01.845065585 -0500
|
||||
+++ jdk8/jdk/make/lib/Awt2dLibraries.gmk 2013-11-14 20:14:10.791982343 -0500
|
||||
@@ -1183,7 +1183,6 @@
|
||||
|
||||
ifndef BUILD_HEADLESS_ONLY
|
||||
LIBSPLASHSCREEN_DIRS := \
|
||||
- $(JDK_TOPDIR)/src/share/native/sun/awt/libpng \
|
||||
$(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBGIF), true)
|
||||
@@ -1200,6 +1199,13 @@
|
||||
LIBJPEG_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/jpeg
|
||||
endif
|
||||
|
||||
+ ifeq ($(USE_EXTERNAL_LIBPNG), true)
|
||||
+ LIBPNG_LDFLAGS := -lpng
|
||||
+ else
|
||||
+ LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/image/libpng
|
||||
+ LIBPNG_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/libpng
|
||||
+ endif
|
||||
+
|
||||
ifneq ($(OPENJDK_TARGET_OS), macosx)
|
||||
LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
|
||||
else
|
||||
@@ -1263,12 +1269,12 @@
|
||||
LANG := C, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
|
||||
- $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS), \
|
||||
+ $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(LIBPNG_CFLAGS), \
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) \
|
||||
- $(LIBZ) $(GIFLIB_LDFLAGS) $(LIBJPEG_LDFLAGS), \
|
||||
+ $(LIBZ) $(GIFLIB_LDFLAGS) $(LIBJPEG_LDFLAGS) $(LIBPNG_LDFLAGS), \
|
||||
LDFLAGS_SUFFIX_solaris := -lc, \
|
||||
VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
|
||||
RC_FLAGS := $(RC_FLAGS) \
|
||||
diff -ruN jdk8/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c jdk8/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c
|
||||
--- jdk8/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c 2013-10-31 19:44:18.000000000 -0400
|
||||
+++ jdk8/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c 2013-11-14 20:14:41.363892797 -0500
|
||||
@@ -25,8 +25,7 @@
|
||||
|
||||
#include "splashscreen_impl.h"
|
||||
|
||||
-#include "../libpng/png.h"
|
||||
-
|
||||
+#include <png.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
#define SIG_BYTES 8
|
||||
@ -1,118 +0,0 @@
|
||||
diff -ruN jdk8/common/autoconf/libraries.m4 jdk8/common/autoconf/libraries.m4
|
||||
--- openjdk/common/autoconf/libraries.m4 2013-11-14 22:04:38.039440136 -0500
|
||||
+++ openjdk/common/autoconf/libraries.m4 2013-11-14 22:05:11.474356424 -0500
|
||||
@@ -676,6 +676,46 @@
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
+ # Check for the lcms2 library
|
||||
+ #
|
||||
+
|
||||
+ AC_ARG_WITH(lcms, [AS_HELP_STRING([--with-lcms],
|
||||
+ [use lcms2 from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
|
||||
+
|
||||
+ AC_CHECK_LIB(lcms2, cmsOpenProfileFromFile,
|
||||
+ [ LCMS_FOUND=yes ],
|
||||
+ [ LCMS_FOUND=no ])
|
||||
+
|
||||
+ AC_MSG_CHECKING([for which lcms to use])
|
||||
+
|
||||
+ DEFAULT_LCMS=bundled
|
||||
+
|
||||
+ #
|
||||
+ # If user didn't specify, use DEFAULT_LCMS
|
||||
+ #
|
||||
+ if test "x${with_lcms}" = "x"; then
|
||||
+ with_lcms=${DEFAULT_LCMS}
|
||||
+ fi
|
||||
+
|
||||
+ if test "x${with_lcms}" = "xbundled"; then
|
||||
+ USE_EXTERNAL_LCMS=false
|
||||
+ AC_MSG_RESULT([bundled])
|
||||
+ elif test "x${with_lcms}" = "xsystem"; then
|
||||
+ if test "x${LCMS_FOUND}" = "xyes"; then
|
||||
+ USE_EXTERNAL_LCMS=true
|
||||
+ AC_MSG_RESULT([system])
|
||||
+ else
|
||||
+ AC_MSG_RESULT([system not found])
|
||||
+ AC_MSG_ERROR([--with-lcms=system specified, but no lcms found!])
|
||||
+ fi
|
||||
+ else
|
||||
+ AC_MSG_ERROR([Invalid value for --with-lcms: ${with_lcms}, use 'system' or 'bundled'])
|
||||
+ fi
|
||||
+
|
||||
+ AC_SUBST(USE_EXTERNAL_LCMS)
|
||||
+
|
||||
+ ###############################################################################
|
||||
+ #
|
||||
# Check for the png library
|
||||
#
|
||||
|
||||
diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries.gmk
|
||||
--- openjdk/jdk/make/lib/Awt2dLibraries.gmk 2013-11-14 22:04:38.040440133 -0500
|
||||
+++ openjdk/jdk/make/lib/Awt2dLibraries.gmk 2013-11-14 22:05:11.475356411 -0500
|
||||
@@ -666,18 +666,35 @@
|
||||
|
||||
##########################################################################################
|
||||
|
||||
+LIBLCMS_DIR := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms
|
||||
+
|
||||
+ifeq ($(USE_EXTERNAL_LCMS), true)
|
||||
+ # If we're using an external library, we'll just need the wrapper part.
|
||||
+ # By including it explicitely, all other files will be excluded.
|
||||
+ BUILD_LIBLCMS_INCLUDE_FILES := LCMS.c
|
||||
+ BUILD_LIBLCMS_HEADERS :=
|
||||
+else
|
||||
+ BUILD_LIBLCMS_INCLUDE_FILES :=
|
||||
+ # If we're using the bundled library, we'll need to include it in the
|
||||
+ # include path explicitly. Otherwise the system headers will be used.
|
||||
+ BUILD_LIBLCMS_HEADERS := -I$(LIBLCMS_DIR)
|
||||
+endif
|
||||
+
|
||||
# TODO: Update awt lib path when awt is converted
|
||||
$(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
|
||||
LIBRARY := lcms, \
|
||||
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
|
||||
- SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \
|
||||
+ SRC := $(LIBLCMS_DIR), \
|
||||
+ INCLUDE_FILES := $(BUILD_LIBLCMS_INCLUDE_FILES), \
|
||||
LANG := C, \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
|
||||
-DCMS_DONT_USE_FAST_FLOOR \
|
||||
$(SHARED_LIBRARY_FLAGS) \
|
||||
-I$(JDK_TOPDIR)/src/share/native/sun/java2d \
|
||||
- -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \
|
||||
+ -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
|
||||
+ $(BUILD_LIBLCMS_HEADERS) \
|
||||
+ $(LCMS_CFLAGS), \
|
||||
CFLAGS_solaris := -xc99=no_lib, \
|
||||
CFLAGS_windows := -DCMS_IS_WINDOWS_, \
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \
|
||||
@@ -685,10 +702,10 @@
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
|
||||
LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
|
||||
- LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \
|
||||
- LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \
|
||||
- LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm, \
|
||||
- LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm,\
|
||||
+ LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc $(LCMS_LIBS), \
|
||||
+ LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm $(LCMS_LIBS), \
|
||||
+ LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm $(LCMS_LIBS), \
|
||||
+ LDFLAGS_SUFFIX_aix := -lm -lawt -ljava -ljvm $(LCMS_LIBS),\
|
||||
VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
|
||||
RC_FLAGS := $(RC_FLAGS) \
|
||||
-D "JDK_FNAME=lcms.dll" \
|
||||
diff -r 3d1c3b0b73a3 src/share/native/sun/java2d/cmm/lcms/LCMS.c
|
||||
--- openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c Tue Sep 08 22:31:26 2015 +0300
|
||||
+++ openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c Thu Oct 15 05:29:28 2015 +0100
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "jni_util.h"
|
||||
#include "Trace.h"
|
||||
#include "Disposer.h"
|
||||
-#include "lcms2.h"
|
||||
+#include <lcms2.h>
|
||||
#include "jlong.h"
|
||||
|
||||
|
||||
@ -1,228 +0,0 @@
|
||||
diff -ruN jdk8/common/autoconf/libraries.m4 jdk8/common/autoconf/libraries.m4
|
||||
--- jdk8/common/autoconf/libraries.m4 2013-10-31 19:24:33.000000000 -0400
|
||||
+++ jdk8/common/autoconf/libraries.m4 2013-11-14 21:55:20.249903347 -0500
|
||||
@@ -601,12 +601,42 @@
|
||||
#
|
||||
|
||||
USE_EXTERNAL_LIBJPEG=true
|
||||
- AC_CHECK_LIB(jpeg, main, [],
|
||||
- [ USE_EXTERNAL_LIBJPEG=false
|
||||
- AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source])
|
||||
- ])
|
||||
+ AC_ARG_WITH(libjpeg, [AS_HELP_STRING([--with-libjpeg],
|
||||
+ [use libjpeg from build system or OpenJDK sources (system, bundled) @<:@bundled@:>@])])
|
||||
+
|
||||
+ AC_CHECK_LIB(jpeg, jpeg_destroy_compress,
|
||||
+ [ LIBJPEG_FOUND=yes ],
|
||||
+ [ LIBJPEG_FOUND=no ])
|
||||
+
|
||||
+ AC_MSG_CHECKING([for which libjpeg to use])
|
||||
+
|
||||
+ # default is bundled
|
||||
+ DEFAULT_LIBJPEG=bundled
|
||||
+
|
||||
+ #
|
||||
+ # if user didn't specify, use DEFAULT_LIBJPEG
|
||||
+ #
|
||||
+ if test "x${with_libjpeg}" = "x"; then
|
||||
+ with_libjpeg=${DEFAULT_LIBJPEG}
|
||||
+ fi
|
||||
+
|
||||
+ if test "x${with_libjpeg}" = "xbundled"; then
|
||||
+ USE_EXTERNAL_LIBJPEG=false
|
||||
+ AC_MSG_RESULT([bundled])
|
||||
+ elif test "x${with_libjpeg}" = "xsystem"; then
|
||||
+ if test "x${LIBJPEG_FOUND}" = "xyes"; then
|
||||
+ USE_EXTERNAL_LIBJPEG=true
|
||||
+ AC_MSG_RESULT([system])
|
||||
+ else
|
||||
+ AC_MSG_RESULT([system not found])
|
||||
+ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])
|
||||
+ fi
|
||||
+ else
|
||||
+ AC_MSG_ERROR([Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'])
|
||||
+ fi
|
||||
AC_SUBST(USE_EXTERNAL_LIBJPEG)
|
||||
|
||||
+
|
||||
###############################################################################
|
||||
#
|
||||
# Check for the gif library
|
||||
diff -ruN jdk8/jdk/make/lib/Awt2dLibraries.gmk jdk8/jdk/make/lib/Awt2dLibraries.gmk
|
||||
--- jdk8/jdk/make/lib/Awt2dLibraries.gmk 2013-10-31 19:44:18.000000000 -0400
|
||||
+++ jdk8/jdk/make/lib/Awt2dLibraries.gmk 2013-11-14 21:56:01.020796703 -0500
|
||||
@@ -693,17 +693,17 @@
|
||||
##########################################################################################
|
||||
|
||||
ifdef OPENJDK
|
||||
- BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers
|
||||
+ BUILD_LIBJAVAJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers
|
||||
else
|
||||
- BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers-closed
|
||||
- BUILD_LIBJPEG_CLOSED_SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg
|
||||
- BUILD_LIBJPEG_CLOSED_INCLUDES := -I$(BUILD_LIBJPEG_CLOSED_SRC)
|
||||
+ BUILD_LIBJAVAJPEG_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjpeg/mapfile-vers-closed
|
||||
+ BUILD_LIBJAVAJPEG_CLOSED_SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg
|
||||
+ BUILD_LIBJAVAJPEG_CLOSED_INCLUDES := -I$(BUILD_LIBJPEG_CLOSED_SRC)
|
||||
endif
|
||||
|
||||
-BUILD_LIBJPEG_REORDER :=
|
||||
+BUILD_LIBJAVAJPEG_REORDER :=
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
ifneq ($(OPENJDK_TARGET_CPU), x86_64)
|
||||
- BUILD_LIBJPEG_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
|
||||
+ BUILD_LIBJAVAJPEG_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -718,37 +718,38 @@
|
||||
# $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
|
||||
# \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
|
||||
# ifeq ($(CC_43_OR_NEWER), 1)
|
||||
-# BUILD_LIBJPEG_CFLAGS_linux += -Wno-clobbered
|
||||
+# BUILD_LIBJAVAJPEG_CFLAGS_linux += -Wno-clobbered
|
||||
# endif
|
||||
#endif
|
||||
|
||||
-$(eval $(call SetupNativeCompilation,BUILD_LIBJPEG, \
|
||||
- LIBRARY := jpeg, \
|
||||
+$(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \
|
||||
+ LIBRARY := javajpeg, \
|
||||
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
|
||||
- SRC := $(BUILD_LIBJPEG_CLOSED_SRC) \
|
||||
+ SRC := $(BUILD_LIBJAVAJPEG_CLOSED_SRC) \
|
||||
$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
|
||||
LANG := C, \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
- $(BUILD_LIBJPEG_CLOSED_INCLUDES) \
|
||||
+ $(BUILD_LIBJAVAJPEG_CLOSED_INCLUDES) \
|
||||
-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
|
||||
- MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \
|
||||
- LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
+ MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \
|
||||
+ LDFLAGS := $(subst -Xlinker --as-needed,, \
|
||||
+ $(subst -Wl$(COMMA)--as-needed,, $(LDFLAGS_JDKLIB))) -ljpeg \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_windows := $(WIN_JAVA_LIB) jvm.lib, \
|
||||
LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
|
||||
VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
|
||||
RC_FLAGS := $(RC_FLAGS) \
|
||||
- -D "JDK_FNAME=jpeg.dll" \
|
||||
- -D "JDK_INTERNAL_NAME=jpeg" \
|
||||
+ -D "JDK_FNAME=javajpeg.dll" \
|
||||
+ -D "JDK_INTERNAL_NAME=javajpeg" \
|
||||
-D "JDK_FTYPE=0x2L", \
|
||||
- REORDER := $(BUILD_LIBJPEG_REORDER), \
|
||||
- OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjpeg, \
|
||||
+ REORDER := $(BUILD_LIBJAVAJPEG_REORDER), \
|
||||
+ OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjavajpeg, \
|
||||
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
|
||||
|
||||
-$(BUILD_LIBJPEG): $(BUILD_LIBJAVA)
|
||||
+$(BUILD_LIBJAVAJPEG): $(BUILD_LIBJAVA)
|
||||
|
||||
-BUILD_LIBRARIES += $(BUILD_LIBJPEG)
|
||||
+BUILD_LIBRARIES += $(BUILD_LIBJAVAJPEG)
|
||||
|
||||
##########################################################################################
|
||||
|
||||
@@ -1127,7 +1128,6 @@
|
||||
|
||||
ifndef BUILD_HEADLESS_ONLY
|
||||
LIBSPLASHSCREEN_DIRS := \
|
||||
- $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
|
||||
$(JDK_TOPDIR)/src/share/native/sun/awt/libpng \
|
||||
$(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen
|
||||
|
||||
@@ -1138,6 +1138,13 @@
|
||||
GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib
|
||||
endif
|
||||
|
||||
+ ifeq ($(USE_EXTERNAL_LIBJPEG), true)
|
||||
+ LIBJPEG_LDFLAGS := -ljpeg
|
||||
+ else
|
||||
+ LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg
|
||||
+ LIBJPEG_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/jpeg
|
||||
+ endif
|
||||
+
|
||||
ifneq ($(OPENJDK_TARGET_OS), macosx)
|
||||
LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
|
||||
else
|
||||
@@ -1193,11 +1200,13 @@
|
||||
EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
|
||||
LANG := C, \
|
||||
OPTIMIZATION := LOW, \
|
||||
- CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS), \
|
||||
+ CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
|
||||
+ $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS), \
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
- LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) $(GIFLIB_LDFLAGS), \
|
||||
+ LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) \
|
||||
+ $(LIBZ) $(GIFLIB_LDFLAGS) $(LIBJPEG_LDFLAGS), \
|
||||
LDFLAGS_SUFFIX_solaris := -lc, \
|
||||
VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
|
||||
RC_FLAGS := $(RC_FLAGS) \
|
||||
diff -ruN jdk8/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java jdk8/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java
|
||||
--- jdk8/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java 2013-10-31 19:44:18.000000000 -0400
|
||||
+++ jdk8/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java 2013-11-14 21:55:20.250903340 -0500
|
||||
@@ -89,7 +89,7 @@
|
||||
java.security.AccessController.doPrivileged(
|
||||
new java.security.PrivilegedAction<Void>() {
|
||||
public Void run() {
|
||||
- System.loadLibrary("jpeg");
|
||||
+ System.loadLibrary("javajpeg");
|
||||
return null;
|
||||
}
|
||||
});
|
||||
diff -ruN jdk8/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java jdk8/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java
|
||||
--- jdk8/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java 2013-10-31 19:44:18.000000000 -0400
|
||||
+++ jdk8/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java 2013-11-14 21:55:20.250903340 -0500
|
||||
@@ -179,7 +179,7 @@
|
||||
java.security.AccessController.doPrivileged(
|
||||
new java.security.PrivilegedAction<Void>() {
|
||||
public Void run() {
|
||||
- System.loadLibrary("jpeg");
|
||||
+ System.loadLibrary("javajpeg");
|
||||
return null;
|
||||
}
|
||||
});
|
||||
diff -ruN jdk8/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java jdk8/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java
|
||||
--- jdk8/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java 2013-10-31 19:44:18.000000000 -0400
|
||||
+++ jdk8/jdk/src/share/classes/sun/awt/image/JPEGImageDecoder.java 2013-11-14 21:55:20.251903376 -0500
|
||||
@@ -56,7 +56,7 @@
|
||||
java.security.AccessController.doPrivileged(
|
||||
new java.security.PrivilegedAction<Void>() {
|
||||
public Void run() {
|
||||
- System.loadLibrary("jpeg");
|
||||
+ System.loadLibrary("javajpeg");
|
||||
return null;
|
||||
}
|
||||
});
|
||||
diff -ruN jdk8/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c jdk8/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c
|
||||
--- jdk8/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c 2013-10-31 19:44:18.000000000 -0400
|
||||
+++ jdk8/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c 2013-11-14 21:55:20.251903376 -0500
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
#include "splashscreen_impl.h"
|
||||
|
||||
-#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jerror.h"
|
||||
|
||||
@@ -107,11 +106,11 @@
|
||||
if (cinfo->src == NULL) { /* first time for this JPEG object? */
|
||||
cinfo->src = (struct jpeg_source_mgr *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
|
||||
- JPOOL_PERMANENT, SIZEOF(stream_source_mgr));
|
||||
+ JPOOL_PERMANENT, sizeof(stream_source_mgr));
|
||||
src = (stream_src_ptr) cinfo->src;
|
||||
src->buffer = (JOCTET *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
|
||||
- JPOOL_PERMANENT, INPUT_BUF_SIZE * SIZEOF(JOCTET));
|
||||
+ JPOOL_PERMANENT, INPUT_BUF_SIZE * sizeof(JOCTET));
|
||||
}
|
||||
|
||||
src = (stream_src_ptr) cinfo->src;
|
||||
Binary file not shown.
@ -20,6 +20,8 @@
|
||||
%bcond_without slowdebug
|
||||
# Enable release builds by default on relevant arches.
|
||||
%bcond_without release
|
||||
# Disable global LTO
|
||||
%define _lto_cflags %{nil}
|
||||
|
||||
# The -g flag says to use strip -g instead of full strip on DSOs or EXEs.
|
||||
# This fixes detailed NMT and other tools which need minimal debug info.
|
||||
@ -172,13 +174,13 @@
|
||||
%global origin_nice OpenJDK
|
||||
%global top_level_dir_name %{origin}
|
||||
%global repo jdk8u
|
||||
%global revision jdk8u422-b05
|
||||
%global revision jdk8u432-b06
|
||||
%global full_revision %{repo}-%{revision}
|
||||
# Define IcedTea version used for SystemTap tapsets and desktop files
|
||||
%global icedteaver 3.15.0
|
||||
|
||||
%global updatever 422
|
||||
%global buildver b05
|
||||
%global updatever 432
|
||||
%global buildver b06
|
||||
# priority must be 7 digits in total. The expression is workarounding tip
|
||||
%global priority 1800%{updatever}
|
||||
|
||||
@ -945,7 +947,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r
|
||||
|
||||
Name: java-%{javaver}-%{origin}
|
||||
Version: %{javaver}.%{updatever}.%{buildver}
|
||||
Release: 11
|
||||
Release: 1
|
||||
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
|
||||
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
|
||||
# also included the epoch in their virtual provides. This created a
|
||||
@ -1154,7 +1156,7 @@ Patch241: 8268819-SA-Remove-libthread_db-dependency-on-Linux.patch
|
||||
# 8u332
|
||||
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
|
||||
Patch245: change-sa-jdi.jar-make-file-for-BEP.patch
|
||||
Patch246: 7092821-java.security.Provider.getService-is-synchro.patch
|
||||
|
||||
# 8u342
|
||||
@ -1207,10 +1209,10 @@ Patch301: fix-SUSE-x86_32-build-failure.patch
|
||||
Patch302: fix-the-issue-that-cert-of-geotrustglobalca-expired.patch
|
||||
|
||||
# 8u372
|
||||
Patch303: 8074354-Make-CreateMinidumpOnCrash-a-new-name-and-av.patch
|
||||
Patch304: jcmd-mnt-add-start-time-and-end-time.patch
|
||||
Patch305: Fix-localtime_r-not-defined-on-windows.patch
|
||||
Patch306: 8057743-process-Synchronize-exiting-of-threads-and-p.patch
|
||||
Patch303: 8074354-Make-CreateMinidumpOnCrash-a-new-name-and-av.patch
|
||||
Patch304: jcmd-mnt-add-start-time-and-end-time.patch
|
||||
Patch305: Fix-localtime_r-not-defined-on-windows.patch
|
||||
Patch306: 8057743-process-Synchronize-exiting-of-threads-and-p.patch
|
||||
Patch307: 8305541-C2-Div-Mod-nodes-without-zero-check-could-be.patch
|
||||
Patch308: 0002-8179498-attach-in-linux-should-be-relative-to-proc-p.patch
|
||||
Patch309: 0003-8187408-AbstractQueuedSynchronizer-wait-queue-corrup.patch
|
||||
@ -1304,7 +1306,6 @@ Patch403: 8193682-Infinite-loop-in-ZipOutputStream.close.patch
|
||||
Patch404: 8285516-clearPassword-should-be-called-in-a-finally-.patch
|
||||
Patch405: 8148470-Metadata-print-routines-should-not-print-to-.patch
|
||||
Patch406: 8293344-JDK-8242181-broke-stack-printing-for-non-att.patch
|
||||
Patch407: 8278794-Infinite-loop-in-DeflaterOutputStream.finish.patch
|
||||
Patch408: 8312065-Socket.connect-does-not-timeout-when-profili.patch
|
||||
Patch409: Add-Problemlist.patch
|
||||
Patch410: Fix-an-error-caused-by-anonymous-when-AppCDS-generat.patch
|
||||
@ -1350,6 +1351,12 @@ Patch446: 8137165-Tests-fail-in-SR_Handler-because-thread-is-n.patch
|
||||
Patch447: heap-dump-redact-support.patch
|
||||
Patch448: KAE-zip-support-streaming-data-decompression.patch
|
||||
Patch449: Enhance-SIGBUS-and-rlimit-information-in-errlog.patch
|
||||
|
||||
#433
|
||||
Patch450: Huawei-Fix-build-failures-due-to-wrap-in-x86.patch
|
||||
Patch451: Backport-8069330-and-adapt-G1GC-related-optimization.patch
|
||||
Patch452: SA-redact-support-password.patch
|
||||
Patch453: Backport-8057910-G1-BOT-verification-should-not-pass.patch
|
||||
#############################################
|
||||
#
|
||||
# Upstreamable patches
|
||||
@ -1360,7 +1367,6 @@ Patch449: Enhance-SIGBUS-and-rlimit-information-in-errlog.patch
|
||||
#############################################
|
||||
# PR2888: OpenJDK should check for system cacerts database (e.g. /etc/pki/java/cacerts)
|
||||
# PR3575, RH1567204: System cacerts database handling should not affect jssecacerts
|
||||
Patch539: pr2888-openjdk_should_check_for_system_cacerts_database_eg_etc_pki_java_cacerts.patch
|
||||
|
||||
#############################################
|
||||
#
|
||||
@ -1394,7 +1400,6 @@ Patch539: pr2888-openjdk_should_check_for_system_cacerts_database_eg_etc_pki_jav
|
||||
# This section includes patches to code other
|
||||
# that from OpenJDK.
|
||||
#############################################
|
||||
Patch1000: rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch
|
||||
|
||||
# riscv64 support
|
||||
Patch2000: add-riscv64-support.patch
|
||||
@ -1971,7 +1976,6 @@ pushd %{top_level_dir_name}
|
||||
%patch404 -p1
|
||||
%patch405 -p1
|
||||
%patch406 -p1
|
||||
%patch407 -p1
|
||||
%patch408 -p1
|
||||
%patch409 -p1
|
||||
%patch410 -p1
|
||||
@ -2013,6 +2017,10 @@ pushd %{top_level_dir_name}
|
||||
%patch447 -p1
|
||||
%patch448 -p1
|
||||
%patch449 -p1
|
||||
%patch450 -p1
|
||||
%patch451 -p1
|
||||
%patch452 -p1
|
||||
%patch453 -p1
|
||||
%endif
|
||||
|
||||
%ifarch loongarch64
|
||||
@ -2031,12 +2039,8 @@ pushd %{top_level_dir_name}
|
||||
popd
|
||||
|
||||
# System library fixes
|
||||
# %patch201
|
||||
# %patch202
|
||||
# %patch203
|
||||
|
||||
# RPM-only fixes
|
||||
# %patch1000
|
||||
|
||||
# Extract systemtap tapsets
|
||||
%if %{with_systemtap}
|
||||
@ -2274,7 +2278,7 @@ done
|
||||
|
||||
# Make sure gdb can do a backtrace based on line numbers on libjvm.so
|
||||
# javaCalls.cpp:58 should map to:
|
||||
# http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/ff3b27e6bcc2/src/share/vm/runtime/javaCalls.cpp#l58
|
||||
# http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/ff3b27e6bcc2/src/share/vm/runtime/javaCalls.cpp#l58
|
||||
# Using line number 1 might cause build problems.
|
||||
%ifnarch loongarch64
|
||||
gdb -q "$JAVA_HOME/bin/java" <<EOF | tee gdb.out
|
||||
@ -2370,7 +2374,7 @@ mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{jredir -- $suffix}/lib/%{archinstall}/clien
|
||||
# Install demos and samples.
|
||||
cp -a demo $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}
|
||||
mkdir -p sample/rmi
|
||||
if [ ! -e sample/rmi/java-rmi.cgi ] ; then
|
||||
if [ ! -e sample/rmi/java-rmi.cgi ] ; then
|
||||
# hack to allow --short-circuit on install
|
||||
mv bin/java-rmi.cgi sample/rmi
|
||||
fi
|
||||
@ -2483,11 +2487,11 @@ for file in lib/security/cacerts lib/security/policy/unlimited/US_export_policy.
|
||||
done
|
||||
|
||||
# stabilize permissions
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "*.so" -exec chmod 755 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -type d -exec chmod 755 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "ASSEMBLY_EXCEPTION" -exec chmod 644 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "LICENSE" -exec chmod 644 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "THIRD_PARTY_README" -exec chmod 644 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "*.so" -exec chmod 755 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -type d -exec chmod 755 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "ASSEMBLY_EXCEPTION" -exec chmod 644 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "LICENSE" -exec chmod 644 {} \; ;
|
||||
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "THIRD_PARTY_README" -exec chmod 644 {} \; ;
|
||||
|
||||
# end, dual install
|
||||
done
|
||||
@ -2678,6 +2682,20 @@ cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Thu Oct 17 2024 Autistic_boyya <wangzhongyi7@huawei.com> -1:1.8.0.432.b06-1
|
||||
- modified 8014628-Support-AES-Encryption-with-HMAC-SHA2-for-Ke.patch
|
||||
- modified 8193682-Infinite-loop-in-ZipOutputStream.close.patch
|
||||
- modified 8313626-C2-crash-due-to-unexpected-exception-control.patch
|
||||
- modified Backport-8318889-Backport-Important-Fixed-Issues-in-Later-Ver.patch
|
||||
- modified GCC-12-reports-some-compiler-warnings.patch
|
||||
- modified add-missing-test-case.patch
|
||||
- modified fix_X509TrustManagerImpl_symantec_distrust.patch
|
||||
- modified update-cacerts-and-VerifyCACerts.java-test.patch
|
||||
- deleted 8278794-Infinite-loop-in-DeflaterOutputStream.finish.patch
|
||||
- add Backport-8057910-G1-BOT-verification-should-not-pass.patch
|
||||
- add Backport-8069330-and-adapt-G1GC-related-optimization.patch
|
||||
- add SA-redact-support-password.patch
|
||||
|
||||
* Fri Sep 6 2024 Benshuai5D <zhangyunbo7@huawei.com> -1:1.8.0.422-b05.11
|
||||
- add Enhance-SIGBUS-and-rlimit-information-in-errlog.patch
|
||||
|
||||
@ -2700,7 +2718,7 @@ cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect
|
||||
- fix changelog date error
|
||||
|
||||
* Tue Aug 6 2024 benshuai5D <zhangyunbo7@huawei.com> -1:1.8.0.422-b05.5
|
||||
- modified add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch
|
||||
- modified add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch
|
||||
|
||||
* Sat Aug 3 2024 kuenking111 <wangkun49@huawei.com> -1:1.8.0.422-b05.4
|
||||
- Add 8137165-Tests-fail-in-SR_Handler-because-thread-is-n.patch
|
||||
@ -2986,7 +3004,7 @@ cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect
|
||||
- 0055-Fix-CodelistTest.java-Failed-to-Execute-CodelistTest.patch
|
||||
|
||||
* Thu May 11 2023 crash888 <wangmengqi13@huawei.com> - 1:1.8.0.372-b07.1
|
||||
- modified Fix-the-crash-that-occurs-when-the-process-exits-due.patch
|
||||
- modified Fix-the-crash-that-occurs-when-the-process-exits-due.patch
|
||||
|
||||
* Sat May 6 2023 crash888 <wangmengqi13@huawei.com> - 1:1.8.0.372-b07.0
|
||||
- deleted Add-ability-to-configure-third-port-for-remote-JMX.patch
|
||||
@ -3004,10 +3022,10 @@ cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect
|
||||
- modified add-missing-test-case.patch
|
||||
- modified fix-the-issue-that-cert-of-geotrustglobalca-expired.patch
|
||||
- modified fix_X509TrustManagerImpl_symantec_distrust.patch
|
||||
- add 8074354-Make-CreateMinidumpOnCrash-a-new-name-and-av.patch
|
||||
- add jcmd-mnt-add-start-time-and-end-time.patch
|
||||
- add Fix-localtime_r-not-defined-on-windows.patch
|
||||
- add 8057743-process-Synchronize-exiting-of-threads-and-p.patch
|
||||
- add 8074354-Make-CreateMinidumpOnCrash-a-new-name-and-av.patch
|
||||
- add jcmd-mnt-add-start-time-and-end-time.patch
|
||||
- add Fix-localtime_r-not-defined-on-windows.patch
|
||||
- add 8057743-process-Synchronize-exiting-of-threads-and-p.patch
|
||||
- add 8305541-C2-Div-Mod-nodes-without-zero-check-could-be.patch
|
||||
- upgrade to jdk8u372-b07
|
||||
|
||||
@ -3211,7 +3229,7 @@ cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect
|
||||
- modified implementation_of_Blas_hotspot_function_in_Intrinsics.patch
|
||||
|
||||
* Tue Feb 15 2022 eapen <zhangyipeng7@huawei.com> - 1:1.8.0.322-b06.1
|
||||
- fix makes failure when gcc version is lower than 8
|
||||
- fix makes failure when gcc version is lower than 8
|
||||
|
||||
* Thu Feb 10 2022 eapen <zhangyipeng7@huawei.com> - 1:1.8.0.322-b06.0
|
||||
- upgrade to 8u322-b06(ga)
|
||||
@ -3487,7 +3505,7 @@ cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect
|
||||
|
||||
* Tue Nov 10 2020 ow_wo <fengshijie2@huawei.com> - 1:1.8.0.272-b10.6
|
||||
- add 8236512-PKCS11-Connection-closed-after-Cipher.doFinal-and-NoPadding.patch
|
||||
- add 8250861-Crash-in-MinINode-Ideal-PhaseGVN-bool.patch
|
||||
- add 8250861-Crash-in-MinINode-Ideal-PhaseGVN-bool.patch
|
||||
|
||||
* Mon Nov 09 2020 ow_wo <fengshijie2@huawei.com> - 1:1.8.0.272-b10.5
|
||||
- add 8223940-Private-key-not-supported-by-chosen-signature.patch
|
||||
@ -3565,7 +3583,7 @@ cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect
|
||||
- Add Ddot-intrinsic-implement.patch
|
||||
- Add 8234003-Improve-IndexSet-iteration.patch
|
||||
- Add 8220159-Optimize-various-RegMask-operations-by-introducing-watermarks.patch
|
||||
- Remove prohibition-of-irreducible-loop-in-mergers.patch
|
||||
- Remove prohibition-of-irreducible-loop-in-mergers.patch
|
||||
|
||||
* Tue Aug 25 2020 noah <hedongbo@huawei.com> - 1:1.8.0.265-b10.0
|
||||
- Update to aarch64-shenandoah-jdk8u-8u265-b01
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
# HG changeset patch
|
||||
# User andrew
|
||||
# Date 1459487045 -3600
|
||||
# Fri Apr 01 06:04:05 2016 +0100
|
||||
# Node ID 3334efeacd8327a14b7d2f392f4546e3c29c594b
|
||||
# Parent 6b81fd2227d14226f2121f2d51b464536925686e
|
||||
PR2888: OpenJDK should check for system cacerts database (e.g. /etc/pki/java/cacerts)
|
||||
PR3575: System cacerts database handling should not affect jssecacerts
|
||||
|
||||
diff --git openjdk.orig/jdk/src/share/classes/sun/security/ssl/TrustStoreManager.java openjdk/jdk/src/share/classes/sun/security/ssl/TrustStoreManager.java
|
||||
--- openjdk.orig/jdk/src/share/classes/sun/security/ssl/TrustStoreManager.java
|
||||
+++ openjdk/jdk/src/share/classes/sun/security/ssl/TrustStoreManager.java
|
||||
@@ -72,7 +72,7 @@
|
||||
* The preference of the default trusted KeyStore is:
|
||||
* javax.net.ssl.trustStore
|
||||
* jssecacerts
|
||||
- * cacerts
|
||||
+ * cacerts (system and local)
|
||||
*/
|
||||
private static final class TrustStoreDescriptor {
|
||||
private static final String fileSep = File.separator;
|
||||
@@ -83,6 +83,10 @@
|
||||
defaultStorePath + fileSep + "cacerts";
|
||||
private static final String jsseDefaultStore =
|
||||
defaultStorePath + fileSep + "jssecacerts";
|
||||
+ /* Check system cacerts DB: /etc/pki/java/cacerts */
|
||||
+ private static final String systemStore =
|
||||
+ fileSep + "etc" + fileSep + "pki" +
|
||||
+ fileSep + "java" + fileSep + "cacerts";
|
||||
|
||||
// the trust store name
|
||||
private final String storeName;
|
||||
@@ -146,7 +150,8 @@
|
||||
long temporaryTime = 0L;
|
||||
if (!"NONE".equals(storePropName)) {
|
||||
String[] fileNames =
|
||||
- new String[] {storePropName, defaultStore};
|
||||
+ new String[] {storePropName,
|
||||
+ systemStore, defaultStore};
|
||||
for (String fileName : fileNames) {
|
||||
File f = new File(fileName);
|
||||
if (f.isFile() && f.canRead()) {
|
||||
diff --git openjdk.orig/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java openjdk/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java
|
||||
--- openjdk.orig/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java
|
||||
+++ openjdk/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java
|
||||
@@ -108,9 +108,14 @@
|
||||
throws Exception
|
||||
{
|
||||
String sep = File.separator;
|
||||
- File file = new File(System.getProperty("java.home") + sep
|
||||
- + "lib" + sep + "security" + sep
|
||||
- + "cacerts");
|
||||
+ /* Check system cacerts DB first; /etc/pki/java/cacerts */
|
||||
+ File file = new File(sep + "etc" + sep + "pki" + sep
|
||||
+ + "java" + sep + "cacerts");
|
||||
+ if (!file.exists()) {
|
||||
+ file = new File(System.getProperty("java.home") + sep
|
||||
+ + "lib" + sep + "security" + sep
|
||||
+ + "cacerts");
|
||||
+ }
|
||||
if (!file.exists()) {
|
||||
return null;
|
||||
}
|
||||
@ -1,76 +0,0 @@
|
||||
From 7e879bcae45b7a7e4b3fa8044564e3590344dbbd Mon Sep 17 00:00:00 2001
|
||||
Date: Fri, 22 Jan 2021 16:23:51 +0800
|
||||
Subject: recreate .java_pid file when deleted for attach
|
||||
mechanism
|
||||
|
||||
Summary: <hotspot>: <enable attach mechanism when .java_pid is lost>
|
||||
LLT:
|
||||
Bug url:
|
||||
---
|
||||
.../src/os/linux/vm/attachListener_linux.cpp | 20 +++++++++++++++----
|
||||
.../src/share/vm/services/attachListener.cpp | 1 +
|
||||
.../src/share/vm/services/attachListener.hpp | 2 +-
|
||||
3 files changed, 18 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/hotspot/src/os/linux/vm/attachListener_linux.cpp b/hotspot/src/os/linux/vm/attachListener_linux.cpp
|
||||
index 700a09ff0..1ca089740 100644
|
||||
--- a/hotspot/src/os/linux/vm/attachListener_linux.cpp
|
||||
+++ b/hotspot/src/os/linux/vm/attachListener_linux.cpp
|
||||
@@ -485,13 +485,25 @@ bool AttachListener::init_at_startup() {
|
||||
// If the file .attach_pid<pid> exists in the working directory
|
||||
// or /tmp then this is the trigger to start the attach mechanism
|
||||
bool AttachListener::is_init_trigger() {
|
||||
- if (init_at_startup() || is_initialized()) {
|
||||
- return false; // initialized at startup or already initialized
|
||||
+ if (init_at_startup()) {
|
||||
+ return false; // initialized at startup
|
||||
}
|
||||
- char fn[PATH_MAX+1];
|
||||
- sprintf(fn, ".attach_pid%d", os::current_process_id());
|
||||
+
|
||||
+ char fn[PATH_MAX + 1];
|
||||
int ret;
|
||||
struct stat64 st;
|
||||
+
|
||||
+ // check initialized
|
||||
+ if (is_initialized()) {
|
||||
+ // check .java_pid file exists
|
||||
+ RESTARTABLE(::stat64(LinuxAttachListener::path(), &st), ret);
|
||||
+ if (ret == -1) {
|
||||
+ ::shutdown(LinuxAttachListener::listener(), SHUT_RDWR);
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ sprintf(fn, ".attach_pid%d", os::current_process_id());
|
||||
RESTARTABLE(::stat64(fn, &st), ret);
|
||||
if (ret == -1) {
|
||||
snprintf(fn, sizeof(fn), "%s/.attach_pid%d",
|
||||
diff --git a/hotspot/src/share/vm/services/attachListener.cpp b/hotspot/src/share/vm/services/attachListener.cpp
|
||||
index 59b2f5483..0f51378dd 100644
|
||||
--- a/hotspot/src/share/vm/services/attachListener.cpp
|
||||
+++ b/hotspot/src/share/vm/services/attachListener.cpp
|
||||
@@ -425,6 +425,7 @@ static void attach_listener_thread_entry(JavaThread* thread, TRAPS) {
|
||||
for (;;) {
|
||||
AttachOperation* op = AttachListener::dequeue();
|
||||
if (op == NULL) {
|
||||
+ AttachListener::set_initialized(false);
|
||||
return; // dequeue failed or shutdown
|
||||
}
|
||||
|
||||
diff --git a/hotspot/src/share/vm/services/attachListener.hpp b/hotspot/src/share/vm/services/attachListener.hpp
|
||||
index 5204c4c62..11ec525c6 100644
|
||||
--- a/hotspot/src/share/vm/services/attachListener.hpp
|
||||
+++ b/hotspot/src/share/vm/services/attachListener.hpp
|
||||
@@ -71,7 +71,7 @@ class AttachListener: AllStatic {
|
||||
|
||||
public:
|
||||
static bool is_initialized() { return _initialized; }
|
||||
- static void set_initialized() { _initialized = true; }
|
||||
+ static void set_initialized(bool init = true) { _initialized = init; }
|
||||
|
||||
// indicates if this VM supports attach-on-demand
|
||||
static bool is_attach_supported() { return !DisableAttachMechanism; }
|
||||
--
|
||||
2.19.0
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
diff -r 5b86f66575b7 src/share/lib/security/java.security-linux
|
||||
--- openjdk/jdk/src/share/lib/security/java.security-linux Tue May 16 13:29:05 2017 -0700
|
||||
+++ openjdk/jdk/src/share/lib/security/java.security-linux Tue Jun 06 14:05:12 2017 +0200
|
||||
@@ -74,6 +74,7 @@
|
||||
security.provider.7=com.sun.security.sasl.Provider
|
||||
security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI
|
||||
security.provider.9=sun.security.smartcardio.SunPCSC
|
||||
+#security.provider.10=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg
|
||||
|
||||
#
|
||||
# Sun Provider SecureRandom seed source.
|
||||
@ -257,13 +257,13 @@ index dd107fc..791ddb6 100644
|
||||
+ File.separator + "security" + File.separator + "cacerts";
|
||||
|
||||
// The numbers of certs now.
|
||||
- private static final int COUNT = 110;
|
||||
- private static final int COUNT = 112;
|
||||
+ private static final int COUNT = 83;
|
||||
|
||||
// SHA-256 of cacerts, can be generated with
|
||||
// shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95
|
||||
private static final String CHECKSUM
|
||||
- = "C1:68:B4:AC:51:BF:B5:C6:FD:20:69:17:E1:AF:E4:5B:01:9B:AA:3F:C3:9A:80:A8:51:53:74:2C:A2:04:B0:FF";
|
||||
- = "8F:E0:6F:7F:21:59:33:A6:43:F3:48:FD:A3:4A:8E:28:35:AA:DD:6E:A5:43:56:F1:28:34:48:DF:5C:D2:7C:72";
|
||||
+ = "2D:04:88:6C:52:53:54:EB:38:2D:BC:E0:AF:B7:82:F4:9E:32:A8:1A:1B:A3:AE:CF:25:CB:C2:F6:0F:4E:E1:20";
|
||||
|
||||
// map of cert alias to SHA-256 fingerprint
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user