Skip to content

Commit

Permalink
Merge master HEAD into openj9-staging
Browse files Browse the repository at this point in the history
Signed-off-by: J9 Build <j9build@ca.ibm.com>
  • Loading branch information
j9build committed Sep 28, 2024
2 parents 676487f + f1007e3 commit 4d66474
Show file tree
Hide file tree
Showing 23 changed files with 587 additions and 46 deletions.
11 changes: 7 additions & 4 deletions src/java.base/macosx/native/libjli/java_md_macosx.m
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ static void ParkEventLoop() {
static void MacOSXStartup(int argc, char *argv[]) {
// Thread already started?
static jboolean started = false;
int rc;
if (started) {
return;
}
Expand All @@ -309,12 +310,14 @@ static void MacOSXStartup(int argc, char *argv[]) {

// Fire up the main thread
pthread_t main_thr;
if (pthread_create(&main_thr, NULL, &apple_main, &args) != 0) {
JLI_ReportErrorMessageSys("Could not create main thread: %s\n", strerror(errno));
rc = pthread_create(&main_thr, NULL, &apple_main, &args);
if (rc != 0) {
JLI_ReportErrorMessageSys("Could not create main thread, return code: %s\n", rc);
exit(1);
}
if (pthread_detach(main_thr)) {
JLI_ReportErrorMessageSys("pthread_detach() failed: %s\n", strerror(errno));
rc = pthread_detach(main_thr);
if (rc != 0) {
JLI_ReportErrorMessage("pthread_detach() failed, return code: %s\n", rc);
exit(1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,29 @@
* Charset service-provider class.
*
* <p> A charset provider is a concrete subclass of this class that has a
* zero-argument constructor and some number of associated charset
* implementation classes. Charset providers may be installed in an instance
* of the Java platform as extensions. Providers may also be made available by
* adding them to the application class path or by some other
* platform-specific means. Charset providers are looked up via the current
* thread's {@link java.lang.Thread#getContextClassLoader() context class
* loader}.
* zero-argument constructor and some number of associated {@code Charset}
* implementation classes. Charset providers are deployed on the application
* module path or the application class path. In order to be looked up, charset
* providers must be visible to the {@link ClassLoader#getSystemClassLoader() system
* class loader}. See {@link java.util.ServiceLoader##developing-service-providers
* Deploying Service Providers} for further detail on deploying a charset
* provider as a module or on the class path.
*
* <p> A charset provider identifies itself with a provider-configuration file
* named {@code java.nio.charset.spi.CharsetProvider} in the resource
* directory {@code META-INF/services}. The file should contain a list of
* <p> For a charset provider deployed in a module, the <i>provides</i>
* directive must be specified in the module declaration. The provides directive
* specifies both the service and the service provider. In this case, the service
* is {@code java.nio.charset.spi.CharsetProvider}.
*
* <p> As an example, a charset provider deployed as a module might specify the
* following directive:
* <pre>{@code
* provides java.nio.charset.spi.CharsetProvider with com.example.ExternalCharsetProvider;
* }</pre>
*
* <p> For a charset provider deployed on the class path, it identifies itself
* with a provider-configuration file named {@code
* java.nio.charset.spi.CharsetProvider} in the resource directory
* {@code META-INF/services}. The file should contain a list of
* fully-qualified concrete charset-provider class names, one per line. A line
* is terminated by any one of a line feed ({@code '\n'}), a carriage return
* ({@code '\r'}), or a carriage return followed immediately by a line feed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void checkDistrust(String variant, X509Certificate[] chain)

/**
* Distrust TLS Server certificates anchored by an Entrust root CA and
* issued after October 31, 2024. If enabled, this policy is currently
* issued after November 11, 2024. If enabled, this policy is currently
* enforced by the PKIX and SunX509 TrustManager implementations
* of the SunJSSE provider implementation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ final class EntrustTLSPolicy {

// Any TLS Server certificate that is anchored by one of the Entrust
// roots above and is issued after this date will be distrusted.
private static final LocalDate OCTOBER_31_2024 =
LocalDate.of(2024, Month.OCTOBER, 31);
private static final LocalDate NOVEMBER_11_2024 =
LocalDate.of(2024, Month.NOVEMBER, 11);

/**
* This method assumes the eeCert is a TLS Server Cert and chains back to
Expand All @@ -111,8 +111,8 @@ static void checkDistrust(X509Certificate[] chain)
Date notBefore = chain[0].getNotBefore();
LocalDate ldNotBefore = LocalDate.ofInstant(notBefore.toInstant(),
ZoneOffset.UTC);
// reject if certificate is issued after October 31, 2024
checkNotBefore(ldNotBefore, OCTOBER_31_2024, anchor);
// reject if certificate is issued after November 11, 2024
checkNotBefore(ldNotBefore, NOVEMBER_11_2024, anchor);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/java.base/share/conf/security/java.security
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ jdk.sasl.disabledMechanisms=
# Distrust after December 31, 2019.
#
# ENTRUST_TLS : Distrust TLS Server certificates anchored by
# an Entrust root CA and issued after October 31, 2024.
# an Entrust root CA and issued after November 11, 2024.
#
# Leading and trailing whitespace surrounding each value are ignored.
# Unknown values are ignored. If the property is commented out or set to the
Expand Down
21 changes: 21 additions & 0 deletions src/java.base/share/data/cacerts/ssltlsrootecc2022
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Owner: CN=SSL.com TLS ECC Root CA 2022, O=SSL Corporation, C=US
Issuer: CN=SSL.com TLS ECC Root CA 2022, O=SSL Corporation, C=US
Serial number: 1403f5abfb378b17405be243b2a5d1c4
Valid from: Thu Aug 25 16:33:48 GMT 2022 until: Sun Aug 19 16:33:47 GMT 2046
Signature algorithm name: SHA384withECDSA
Subject Public Key Algorithm: 384-bit EC (secp384r1) key
Version: 3
-----BEGIN CERTIFICATE-----
MIICOjCCAcCgAwIBAgIQFAP1q/s3ixdAW+JDsqXRxDAKBggqhkjOPQQDAzBOMQsw
CQYDVQQGEwJVUzEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMSUwIwYDVQQDDBxT
U0wuY29tIFRMUyBFQ0MgUm9vdCBDQSAyMDIyMB4XDTIyMDgyNTE2MzM0OFoXDTQ2
MDgxOTE2MzM0N1owTjELMAkGA1UEBhMCVVMxGDAWBgNVBAoMD1NTTCBDb3Jwb3Jh
dGlvbjElMCMGA1UEAwwcU1NMLmNvbSBUTFMgRUNDIFJvb3QgQ0EgMjAyMjB2MBAG
ByqGSM49AgEGBSuBBAAiA2IABEUpNXP6wrgjzhR9qLFNoFs27iosU8NgCTWyJGYm
acCzldZdkkAZDsalE3D07xJRKF3nzL35PIXBz5SQySvOkkJYWWf9lCcQZIxPBLFN
SeR7T5v15wj4A4j3p8OSSxlUgaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSME
GDAWgBSJjy+j6CugFFR781a4Jl9nOAuc0DAdBgNVHQ4EFgQUiY8vo+groBRUe/NW
uCZfZzgLnNAwDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMDA2gAMGUCMFXjIlbp
15IkWE8elDIPDAI2wv2sdDJO4fscgIijzPvX6yv/N33w7deedWo1dlJF4AIxAMeN
b0Igj762TVntd00pxCAgRWSGOlDGxK0tk/UYfXLtqc/ErFc2KAhl3zx5Zn6g6g==
-----END CERTIFICATE-----
39 changes: 39 additions & 0 deletions src/java.base/share/data/cacerts/ssltlsrootrsa2022
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Owner: CN=SSL.com TLS RSA Root CA 2022, O=SSL Corporation, C=US
Issuer: CN=SSL.com TLS RSA Root CA 2022, O=SSL Corporation, C=US
Serial number: 6fbedaad73bd0840e28b4dbed4f75b91
Valid from: Thu Aug 25 16:34:22 GMT 2022 until: Sun Aug 19 16:34:21 GMT 2046
Signature algorithm name: SHA256withRSA
Subject Public Key Algorithm: 4096-bit RSA key
Version: 3
-----BEGIN CERTIFICATE-----
MIIFiTCCA3GgAwIBAgIQb77arXO9CEDii02+1PdbkTANBgkqhkiG9w0BAQsFADBO
MQswCQYDVQQGEwJVUzEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMSUwIwYDVQQD
DBxTU0wuY29tIFRMUyBSU0EgUm9vdCBDQSAyMDIyMB4XDTIyMDgyNTE2MzQyMloX
DTQ2MDgxOTE2MzQyMVowTjELMAkGA1UEBhMCVVMxGDAWBgNVBAoMD1NTTCBDb3Jw
b3JhdGlvbjElMCMGA1UEAwwcU1NMLmNvbSBUTFMgUlNBIFJvb3QgQ0EgMjAyMjCC
AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANCkCXJPQIgSYT41I57u9nTP
L3tYPc48DRAokC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j29TH0ZR6LDSeeW
P4+a0zvkEdiLA9z2tmBVGKaBUfPhqBVq6+AL8BQx1rmMRTqoENjwuSfr98t67wVy
lrXEj5ZzxOhWc5y8aVFjvO9nHEMaX3cZHxj4HCUp+UmZKbaSPaKDN7EgkaibMOlq
bLQjk2UEqxHzDh1TJElTHaE/nUiSEeJ9DU/1172iWD54nR4fK/4huxoTtrEoZP2w
AgDHbICivRZQIA9ygV/MlP+7mea6kMvq+cYMwq7FGc4zoWtcu358NFcXrfA/rs3q
r5nsLFR+jM4uElZI7xc7P0peYNLcdDa8pUNjyw9bowJWCZ4kLOGGgYz+qxcs+sji
Mho6/4UIyYOf8kpIEFR3N+2ivEC+5BB09+Rbu7nzifmPQdjH5FCQNYA+HLhNkNPU
98OwoX6EyneSMSy4kLGCenROmxMmtNVQZlR4rmA=
-----END CERTIFICATE-----
8 changes: 1 addition & 7 deletions src/java.base/unix/native/libjli/java_md_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,7 @@ JLI_ReportErrorMessage(const char* fmt, ...) {
JNIEXPORT void JNICALL
JLI_ReportErrorMessageSys(const char* fmt, ...) {
va_list vl;
char *emsg;

/*
* TODO: its safer to use strerror_r but is not available on
* Solaris 8. Until then....
*/
emsg = strerror(errno);
char *emsg = strerror(errno);
if (emsg != NULL) {
fprintf(stderr, "%s\n", emsg);
}
Expand Down
14 changes: 12 additions & 2 deletions src/java.compiler/share/classes/javax/lang/model/util/Types.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
* <p><b>Compatibility Note:</b> Methods may be added to this interface
* in future releases of the platform.
*
* @apiNote
* In the reference implementation, handling {@linkplain ErrorType
* error types} generally does not cause an {@code
* IllegalArgumentException} from the methods in this interface.
*
* @see javax.annotation.processing.ProcessingEnvironment#getTypeUtils
* @since 1.6
*/
Expand Down Expand Up @@ -198,8 +203,10 @@ public interface Types {
*
* @param t the type to be unboxed
* @return the type of an unboxed value of type {@code t}
*
* @throws IllegalArgumentException if the given type has no
* unboxing conversion
* unboxing conversion. Only types for the wrapper classes
* have an unboxing conversion.
* @jls 5.1.8 Unboxing Conversion
*/
PrimitiveType unboxedType(TypeMirror t);
Expand Down Expand Up @@ -268,7 +275,10 @@ public interface Types {
*
* @param extendsBound the extends (upper) bound, or {@code null} if none
* @param superBound the super (lower) bound, or {@code null} if none
* @throws IllegalArgumentException if bounds are not valid
*
* @throws IllegalArgumentException if bounds are not valid. Invalid bounds
* include all types that are not {@linkplain ReferenceType
* reference types}.
* @jls 4.5.1 Type Arguments of Parameterized Types
*/
WildcardType getWildcardType(TypeMirror extendsBound,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,13 @@ static int isInAquaSession() {
SplashCreateThread(Splash * splash) {
pthread_t thr;
pthread_attr_t attr;
int rc;

int rslt = pthread_attr_init(&attr);
if (rslt != 0) return;
rc = pthread_create(&thr, &attr, SplashScreenThread, (void *) splash);
rslt = pthread_create(&thr, &attr, SplashScreenThread, (void *) splash);
if (rslt != 0) {
fprintf(stderr, "Could not create SplashScreen thread, error number:%d\n", rslt);
}
pthread_attr_destroy(&attr);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,10 @@ SplashCreateThread(Splash * splash) {

int rslt = pthread_attr_init(&attr);
if (rslt != 0) return;
pthread_create(&thr, &attr, SplashScreenThread, (void *) splash);
rslt = pthread_create(&thr, &attr, SplashScreenThread, (void *) splash);
if (rslt != 0) {
fprintf(stderr, "Could not create SplashScreen thread, error number:%d\n", rslt);
}
pthread_attr_destroy(&attr);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2352,6 +2352,12 @@ private TypeAnnotationSymbolVisitor(List<Attribute.TypeCompound> attributes) {
this.attributes = attributes;
}

/**
* A supertype_index value of 65535 specifies that the annotation appears on the superclass
* in an extends clause of a class declaration, see JVMS 4.7.20.1
*/
public static final int SUPERCLASS_INDEX = 65535;

@Override
public Void visitClassSymbol(Symbol.ClassSymbol s, Void unused) {
ClassType t = (ClassType) s.type;
Expand All @@ -2361,7 +2367,7 @@ public Void visitClassSymbol(Symbol.ClassSymbol s, Void unused) {
interfaces.add(addTypeAnnotations(itf, classExtends(i++)));
}
t.interfaces_field = interfaces.toList();
t.supertype_field = addTypeAnnotations(t.supertype_field, classExtends(65535));
t.supertype_field = addTypeAnnotations(t.supertype_field, classExtends(SUPERCLASS_INDEX));
if (t.typarams_field != null) {
t.typarams_field =
rewriteTypeParameters(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2024, 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
Expand Down Expand Up @@ -870,10 +870,12 @@ private List<JavaFileObject> getFiles(ModulePackage modpkg,

private ModuleSymbol findModuleOfPackageName(String packageName) {
Name pack = names.fromString(packageName);
for (ModuleSymbol msym : modules.allModules()) {
PackageSymbol p = syms.getPackage(msym, pack);
if (p != null && !p.members().isEmpty()) {
return msym;
if (modules.modulesInitialized()) {
for (ModuleSymbol msym : modules.allModules()) {
PackageSymbol p = syms.getPackage(msym, pack);
if (p != null && !p.members().isEmpty()) {
return msym;
}
}
}
return null;
Expand Down
2 changes: 2 additions & 0 deletions test/hotspot/jtreg/ProblemList-Xcomp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001/TestDescription.java 829

vmTestbase/nsk/stress/thread/thread006.java 8321476 linux-all

compiler/cha/TypeProfileFinalMethod.java 8341039 generic-all

gc/arguments/TestNewSizeFlags.java 8299116 macosx-aarch64

runtime/condy/escapeAnalysis/TestEscapeCondy.java 8339694 generic-all
3 changes: 2 additions & 1 deletion test/hotspot/jtreg/runtime/Unsafe/InternalErrorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ public static void test(MappedByteBuffer buffer, Unsafe unsafe, long mapAddr, lo
break;
case 1:
// testing Unsafe.copySwapMemory, trying to access next page after truncation.
unsafe.copySwapMemory(null, mapAddr + pageSize, new byte[4000], 16, 2000, 2);
int destOffset = Unsafe.ARRAY_BYTE_BASE_OFFSET;
unsafe.copySwapMemory(null, mapAddr + pageSize, new byte[4000], destOffset, 2000, 2);
break;
case 2:
// testing Unsafe.copySwapMemory, trying to access next page after truncation.
Expand Down
60 changes: 60 additions & 0 deletions test/jdk/java/nio/charset/spi/CharsetProviderAsModuleTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright (c) 2024, 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 8340404
* @summary Check that a CharsetProvider SPI can be deployed as a module
* @build provider/*
* @run main/othervm CharsetProviderAsModuleTest
*/

import java.nio.charset.Charset;

public class CharsetProviderAsModuleTest {

// Basic test ensures that our BAZ charset is loaded via the BazProvider
public static void main(String[] args) {
var cs = Charset.availableCharsets();
Charset bazCs;
// check provider is providing BAZ via charsets()
if (!cs.containsKey("BAZ")) {
throw new RuntimeException("SPI BazProvider did not provide BAZ Charset");
} else {
bazCs = cs.get("BAZ");
// check provider is in a named module
if (!bazCs.getClass().getModule().isNamed()) {
throw new RuntimeException("BazProvider is not a named module");
}
var aliases = bazCs.aliases();
// check BAZ cs aliases were loaded correctly
if (!aliases.contains("BAZ-1") || !aliases.contains("BAZ-2")) {
throw new RuntimeException("BAZ Charset did not provide correct aliases");
}
// check provider implements charsetForName()
if (!bazCs.equals(Charset.forName("BAZ"))) {
throw new RuntimeException("SPI BazProvider provides bad charsetForName()");
}
}
}
}
25 changes: 25 additions & 0 deletions test/jdk/java/nio/charset/spi/provider/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2024, 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.
*/
module provider {
provides java.nio.charset.spi.CharsetProvider with spi.BazProvider;
}
Loading

0 comments on commit 4d66474

Please sign in to comment.