Skip to content

Commit

Permalink
Merge master jdk-17.0.10+3 into openj9-staging
Browse files Browse the repository at this point in the history
Signed-off-by: J9 Build <[email protected]>
  • Loading branch information
j9build committed Nov 16, 2023
2 parents fa90845 + 55b4c12 commit 82060f8
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 30 deletions.
9 changes: 5 additions & 4 deletions make/RunTests.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,9 @@ define SetupRunJtregTestBody
endif
endif

clean-workdir-$1:
clean-outputdirs-$1:
$$(RM) -r $$($1_TEST_SUPPORT_DIR)
$$(RM) -r $$($1_TEST_RESULTS_DIR)

$1_COMMAND_LINE := \
$$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
Expand Down Expand Up @@ -887,7 +888,7 @@ define SetupRunJtregTestBody
done
endif

run-test-$1: pre-run-test clean-workdir-$1
run-test-$1: pre-run-test clean-outputdirs-$1
$$(call LogWarn)
$$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR) \
Expand Down Expand Up @@ -924,9 +925,9 @@ define SetupRunJtregTestBody
$$(eval $1_TOTAL := 1) \
)

$1: run-test-$1 parse-test-$1 clean-workdir-$1
$1: run-test-$1 parse-test-$1 clean-outputdirs-$1

TARGETS += $1 run-test-$1 parse-test-$1 clean-workdir-$1
TARGETS += $1 run-test-$1 parse-test-$1 clean-outputdirs-$1
TEST_TARGETS += parse-test-$1

endef
Expand Down
21 changes: 21 additions & 0 deletions make/data/cacerts/letsencryptisrgx2
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Owner: CN=ISRG Root X2, O=Internet Security Research Group, C=US
Issuer: CN=ISRG Root X2, O=Internet Security Research Group, C=US
Serial number: 41d29dd172eaeea780c12c6ce92f8752
Valid from: Fri Sep 04 00:00:00 GMT 2020 until: Mon Sep 17 16:00:00 GMT 2040
Signature algorithm name: SHA384withECDSA
Subject Public Key Algorithm: 384-bit EC (secp384r1) key
Version: 3
-----BEGIN CERTIFICATE-----
MIICGzCCAaGgAwIBAgIQQdKd0XLq7qeAwSxs6S+HUjAKBggqhkjOPQQDAzBPMQsw
CQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2gg
R3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBYMjAeFw0yMDA5MDQwMDAwMDBaFw00
MDA5MTcxNjAwMDBaME8xCzAJBgNVBAYTAlVTMSkwJwYDVQQKEyBJbnRlcm5ldCBT
ZWN1cml0eSBSZXNlYXJjaCBHcm91cDEVMBMGA1UEAxMMSVNSRyBSb290IFgyMHYw
EAYHKoZIzj0CAQYFK4EEACIDYgAEzZvVn4CDCuwJSvMWSj5cz3es3mcFDR0HttwW
+1qLFNvicWDEukWVEYmO6gbf9yoWHKS5xcUy4APgHoIYOIvXRdgKam7mAHf7AlF9
ItgKbppbd9/w+kHsOdx1ymgHDB/qo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0T
AQH/BAUwAwEB/zAdBgNVHQ4EFgQUfEKWrt5LSDv6kviejM9ti6lyN5UwCgYIKoZI
zj0EAwMDaAAwZQIwe3lORlCEwkSHRhtFcP9Ymd70/aTSVaYgLXTWNLxBo1BfASdW
tL4ndQavEi51mI38AjEAi/V3bNTIZargCyzuFJ0nN6T5U6VR5CmD1/iQMVtCnwr1
/q4AaOeMSQ+2b1tbFfLn
-----END CERTIFICATE-----
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@
package sun.print;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Vector;
import java.security.AccessController;
Expand All @@ -54,6 +52,8 @@
import java.net.URL;
import java.nio.file.Files;

import sun.awt.util.ThreadGroupUtils;

/*
* Remind: This class uses solaris commands. We also need a linux
* version
Expand Down Expand Up @@ -204,14 +204,18 @@ static int getBSDCommandIndex() {
return BSD_LPD;
}


@SuppressWarnings("removal")
public PrintServiceLookupProvider() {
// start the printer listener thread
if (pollServices) {
Thread thr = new Thread(null, new PrinterChangeListener(),
"PrinterListener", 0, false);
thr.setDaemon(true);
thr.start();
AccessController.doPrivileged((PrivilegedAction<Thread>) () -> {
Thread thr = new Thread(ThreadGroupUtils.getRootThreadGroup(),
new PrinterChangeListener(),
"PrinterListener", 0, false);
thr.setContextClassLoader(null);
thr.setDaemon(true);
return thr;
}).start();
IPPPrintService.debug_println(debugPrefix+"polling turned on");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

package sun.print;

import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;

import javax.print.DocFlavor;
Expand All @@ -41,6 +43,8 @@
import javax.print.attribute.PrintServiceAttributeSet;
import javax.print.attribute.standard.PrinterName;

import sun.awt.util.ThreadGroupUtils;

public class PrintServiceLookupProvider extends PrintServiceLookup {

private PrintService defaultPrintService;
Expand Down Expand Up @@ -81,22 +85,31 @@ public static PrintServiceLookupProvider getWin32PrintLUS() {
return win32PrintLUS;
}

@SuppressWarnings("removal")
public PrintServiceLookupProvider() {

if (win32PrintLUS == null) {
win32PrintLUS = this;

// start the local printer listener thread
Thread thr = new Thread(null, new PrinterChangeListener(),
"PrinterListener", 0, false);
thr.setDaemon(true);
thr.start();
AccessController.doPrivileged((PrivilegedAction<Thread>) () -> {
Thread thr = new Thread(ThreadGroupUtils.getRootThreadGroup(),
new PrinterChangeListener(),
"PrinterListener", 0, false);
thr.setContextClassLoader(null);
thr.setDaemon(true);
return thr;
}).start();

// start the remote printer listener thread
Thread remThr = new Thread(null, new RemotePrinterChangeListener(),
"RemotePrinterListener", 0, false);
remThr.setDaemon(true);
remThr.start();
AccessController.doPrivileged((PrivilegedAction<Thread>) () -> {
Thread thr = new Thread(ThreadGroupUtils.getRootThreadGroup(),
new RemotePrinterChangeListener(),
"RemotePrinterListener", 0, false);
thr.setContextClassLoader(null);
thr.setDaemon(true);
return thr;
}).start();
} /* else condition ought to never happen! */
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -779,9 +779,13 @@ synchronized Collection<X509CRL> getCRLs(X509CRLSelector xsel,
} catch (IllegalArgumentException e) {
continue;
}
} else {
} else if (nameObject instanceof String) {
issuerName = (String)nameObject;
} else {
throw new CertStoreException(
"unrecognized issuerName: must be String or byte[]");
}

// If all we want is CA certs, try to get the (probably shorter) ARL
Collection<X509CRL> entryCRLs = Collections.emptySet();
if (certChecking == null || certChecking.getBasicConstraints() != -1) {
Expand Down
4 changes: 0 additions & 4 deletions test/hotspot/jtreg/ProblemList-zgc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,3 @@ serviceability/sa/TestJmapCoreMetaspace.java 8268722,8268636
serviceability/sa/TestJhsdbJstackMixed.java 8248912 generic-all
serviceability/sa/ClhsdbPstack.java#id0 8248912 generic-all
serviceability/sa/ClhsdbPstack.java#id1 8248912 generic-all

serviceability/dcmd/framework/HelpTest.java 8268433 windows-x64
serviceability/dcmd/framework/InvalidCommandTest.java 8268433 windows-x64
serviceability/dcmd/framework/VMVersionTest.java 8268433 windows-x64
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ public Process launch() {

public void quit() {
if (pipe != null) {
pipe.println("quit");
if (pipe.isConnected()) {
pipe.println("quit");
} else {
System.out.println("WARNING: IOPipe is not connected");
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* Copyright Amazon.com Inc. 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.awt.EventQueue;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.net.URL;
import java.net.URLClassLoader;

import javax.print.DocFlavor;
import javax.print.PrintServiceLookup;

/**
* @test
* @bug 8273831
* @summary Tests custom class loader cleanup
* @library /javax/swing/regtesthelpers
* @build Util
* @run main/timeout=60/othervm -mx32m FlushCustomClassLoader
*/
public final class FlushCustomClassLoader {

public static void main(String[] args) throws Exception {
Reference<ClassLoader> loader = getLoader("testMethod");

int attempt = 0;
while (loader.get() != null) {
Util.generateOOME();
System.out.println("Not freed, attempt: " + attempt++);
}
}

public static void testMethod() {
DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
PrintServiceLookup.lookupPrintServices(flavor, null);
}

private static Reference<ClassLoader> getLoader(String m) throws Exception {
/*
* The print services are stored per the AppContext, and each AppContext
* caches the "current" class loader during creation.
* see javax.print.PrintServiceLookup.
*
* To prevent AppContext from cache our test loader we force AppContext
* creation early by the invokeAndWait.
* The "EventQueue.invokeAndWait(() -> {});" can be removed when the
* AppContext usage will be deleted in the PrintServiceLookup
*/
EventQueue.invokeAndWait(() -> {});

URL url = FlushCustomClassLoader.class.getProtectionDomain()
.getCodeSource().getLocation();
URLClassLoader loader = new URLClassLoader(new URL[]{url}, null);

Thread ct = Thread.currentThread();
ct.setContextClassLoader(loader);
Class<?> cls = Class.forName("FlushCustomClassLoader", true, loader);
cls.getDeclaredMethod(m).invoke(null);
ct.setContextClassLoader(null);
loader.close();
return new WeakReference<>(loader);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,21 @@
/*
* @test id=letsencryptisrgx1
* @bug 8189131
* @summary Interoperability tests with Let's Encrypt CA
* @summary Interoperability tests with Let's Encrypt ISRG Root X1 CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
* @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop letsencryptisrgx1 DEFAULT
*/

/*
* @test id=letsencryptisrgx2
* @bug 8317374
* @summary Interoperability tests with Let's Encrypt ISRG Root X2 CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
* @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop letsencryptisrgx2 DEFAULT
*/

/*
* @test id=globalsignrootcar6
* @bug 8216577
Expand Down Expand Up @@ -455,6 +464,9 @@ private CATestURLs getTestURLs(String alias) {
case "letsencryptisrgx1" ->
new CATestURLs("https://valid-isrgrootx1.letsencrypt.org",
"https://revoked-isrgrootx1.letsencrypt.org");
case "letsencryptisrgx2" ->
new CATestURLs("https://valid-isrgrootx2.letsencrypt.org",
"https://revoked-isrgrootx2.letsencrypt.org");

case "globalsignrootcar6" ->
new CATestURLs("https://valid.r6.roots.globalsign.com",
Expand Down
8 changes: 5 additions & 3 deletions test/jdk/sun/security/lib/cacerts/VerifyCACerts.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* 8209452 8209506 8210432 8195793 8216577 8222089 8222133 8222137 8222136
* 8223499 8225392 8232019 8234245 8233223 8225068 8225069 8243321 8243320
* 8243559 8225072 8258630 8259312 8256421 8225081 8225082 8225083 8245654
* 8305975 8304760 8307134 8295894 8314960 8317373
* 8305975 8304760 8307134 8295894 8314960 8317373 8317374
* @summary Check root CA entries in cacerts file
*/
import java.io.ByteArrayInputStream;
Expand All @@ -47,12 +47,12 @@ public class VerifyCACerts {
+ File.separator + "security" + File.separator + "cacerts";

// The numbers of certs now.
private static final int COUNT = 98;
private static final int COUNT = 99;

// 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
= "63:A7:1F:4F:8E:4B:A1:04:DE:BB:EC:2E:31:35:5B:5A:19:D4:B1:C0:59:62:B1:13:65:C3:AE:C7:DB:78:9A:1E";
= "DA:61:45:1C:93:F3:6A:30:24:68:C6:72:BC:C5:E6:E4:E3:BA:6A:AE:36:29:7B:45:53:B7:10:53:52:7D:7E:A5";
// Hex formatter to upper case with ":" delimiter
private static final HexFormat HEX = HexFormat.ofDelimiter(":").withUpperCase();

Expand Down Expand Up @@ -146,6 +146,8 @@ public class VerifyCACerts {
"5D:56:49:9B:E4:D2:E0:8B:CF:CA:D0:8A:3E:38:72:3D:50:50:3B:DE:70:69:48:E4:2F:55:60:30:19:E5:28:AE");
put("letsencryptisrgx1 [jdk]",
"96:BC:EC:06:26:49:76:F3:74:60:77:9A:CF:28:C5:A7:CF:E8:A3:C0:AA:E1:1A:8F:FC:EE:05:C0:BD:DF:08:C6");
put("letsencryptisrgx2 [jdk]",
"69:72:9B:8E:15:A8:6E:FC:17:7A:57:AF:B7:17:1D:FC:64:AD:D2:8C:2F:CA:8C:F1:50:7E:34:45:3C:CB:14:70");
put("luxtrustglobalrootca [jdk]",
"A1:B2:DB:EB:64:E7:06:C6:16:9E:3C:41:18:B2:3B:AA:09:01:8A:84:27:66:6D:8B:F0:E2:88:91:EC:05:19:50");
put("quovadisrootca [jdk]",
Expand Down

0 comments on commit 82060f8

Please sign in to comment.