Skip to content

Commit 00bb93b

Browse files
committed
Merge master jdk-17.0.6+2 into openj9-staging
Signed-off-by: J9 Build <[email protected]>
2 parents 78d5fdf + 95c9b8c commit 00bb93b

File tree

17 files changed

+638
-227
lines changed

17 files changed

+638
-227
lines changed

make/common/modules/LauncherCommon.gmk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ endif
4747

4848
LAUNCHER_SRC := $(TOPDIR)/src/java.base/share/native/launcher
4949
LAUNCHER_CFLAGS += -I$(TOPDIR)/src/java.base/share/native/launcher \
50-
-I$(TOPDIR)/src/java.desktop/share/native/include \
5150
-I$(TOPDIR)/src/java.base/share/native/libjli \
5251
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli \
5352
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli \

make/conf/jib-profiles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ var getJibProfilesProfiles = function (input, common, data) {
564564
"ANT_HOME": input.get("ant", "home_path")
565565
}
566566
};
567-
[ "linux-x64", "macosx-x64", "windows-x64"]
567+
[ "linux-x64", "macosx-x64", "windows-x64", "linux-aarch64"]
568568
.forEach(function (name) {
569569
var maketestName = name + "-testmake";
570570
profiles[maketestName] = concatObjects(profiles[name], testmakeBase);

make/modules/java.desktop/lib/Awt2dLibraries.gmk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
WIN_AWT_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt/awt.lib
2727

2828
LIBAWT_DEFAULT_HEADER_DIRS := \
29+
common/awt/utility \
2930
libawt/awt/image \
3031
libawt/awt/image/cvutils \
3132
libawt/java2d \
@@ -368,7 +369,6 @@ ifeq ($(call isTargetOs, windows macosx), false)
368369
common/awt/debug \
369370
common/font \
370371
common/java2d/opengl \
371-
include \
372372
#
373373

374374
LIBAWT_HEADLESS_CFLAGS := $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) $(X_CFLAGS) \
@@ -474,11 +474,11 @@ endif
474474
LIBFONTMANAGER_EXTRA_HEADER_DIRS := \
475475
libharfbuzz \
476476
common/awt \
477+
common/awt/utility \
477478
common/font \
478479
libawt/java2d \
479480
libawt/java2d/pipe \
480481
libawt/java2d/loops \
481-
include \
482482
#
483483

484484
LIBFONTMANAGER_CFLAGS += $(LIBFREETYPE_CFLAGS)
@@ -563,6 +563,7 @@ ifeq ($(call isTargetOs, windows), true)
563563
LIBJAWT_EXTRA_HEADER_DIRS := \
564564
include \
565565
common/awt/debug \
566+
common/awt/utility \
566567
libawt/awt/image/cvutils \
567568
libawt/java2d \
568569
libawt/java2d/windows \
@@ -658,7 +659,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
658659
common/awt/systemscale \
659660
#
660661

661-
LIBSPLASHSCREEN_HEADER_DIRS += include
662+
LIBSPLASHSCREEN_HEADER_DIRS += common/awt/utility
662663

663664
ifeq ($(USE_EXTERNAL_LIBGIF), false)
664665
LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/giflib

make/modules/java.security.jgss/Lib.gmk

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,19 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2GSS, \
4040

4141
TARGETS += $(BUILD_LIBJ2GSS)
4242

43+
ifeq ($(call isTargetOs, windows), true)
44+
$(eval $(call SetupJdkLibrary, BUILD_LIBSSPI_BRIDGE, \
45+
NAME := sspi_bridge, \
46+
OPTIMIZATION := LOW, \
47+
CFLAGS := $(CFLAGS_JDKLIB) \
48+
-I$(TOPDIR)/src/java.security.jgss/share/native/libj2gss, \
49+
LDFLAGS := $(LDFLAGS_JDKLIB) \
50+
$(call SET_SHARED_LIBRARY_ORIGIN) \
51+
))
52+
53+
TARGETS += $(BUILD_LIBSSPI_BRIDGE)
54+
endif
55+
4356
################################################################################
4457

4558
ifneq ($(BUILD_CRYPTO), false)
@@ -57,17 +70,6 @@ ifneq ($(BUILD_CRYPTO), false)
5770
))
5871

5972
TARGETS += $(BUILD_LIBW2K_LSA_AUTH)
60-
61-
$(eval $(call SetupJdkLibrary, BUILD_LIBSSPI_BRIDGE, \
62-
NAME := sspi_bridge, \
63-
OPTIMIZATION := LOW, \
64-
CFLAGS := $(CFLAGS_JDKLIB) \
65-
-I$(TOPDIR)/src/java.security.jgss/share/native/libj2gss, \
66-
LDFLAGS := $(LDFLAGS_JDKLIB) \
67-
$(call SET_SHARED_LIBRARY_ORIGIN) \
68-
))
69-
70-
TARGETS += $(BUILD_LIBSSPI_BRIDGE)
7173
endif
7274

7375
ifeq ($(call isTargetOs, macosx), true)

src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,12 @@ private void duplexCloseOutput() throws IOException {
639639
if (!conContext.protocolVersion.useTLS13PlusSpec()) {
640640
hasCloseReceipt = true;
641641
} else {
642-
// Use a user_canceled alert for TLS 1.3 duplex close.
643-
useUserCanceled = true;
642+
// Do not use user_canceled workaround if the other side has
643+
// already half-closed the connection
644+
if (!conContext.isInboundClosed()) {
645+
// Use a user_canceled alert for TLS 1.3 duplex close.
646+
useUserCanceled = true;
647+
}
644648
}
645649
} else if (conContext.handshakeContext != null) { // initial handshake
646650
// Use user_canceled alert regardless the protocol versions.

src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,11 @@ private Plaintext[] decodeInputRecord() throws IOException, BadPaddingException
255255
// Decrypt the fragment
256256
//
257257
ByteBuffer fragment;
258+
recordLock.lock();
258259
try {
260+
if (isClosed) {
261+
return null;
262+
}
259263
Plaintext plaintext =
260264
readCipher.decrypt(contentType, recordBody, null);
261265
fragment = plaintext.fragment;
@@ -265,6 +269,8 @@ private Plaintext[] decodeInputRecord() throws IOException, BadPaddingException
265269
} catch (GeneralSecurityException gse) {
266270
throw (SSLProtocolException)(new SSLProtocolException(
267271
"Unexpected exception")).initCause(gse);
272+
} finally {
273+
recordLock.unlock();
268274
}
269275

270276
if (contentType != ContentType.HANDSHAKE.id &&

src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,11 @@ - (void)getActionsWithEnv:(JNIEnv *)env
615615
[fActions setObject:action forKey:NSAccessibilityPickAction];
616616
[fActionSelectors addObject:[sActionSelectors objectForKey:NSAccessibilityPickAction]];
617617
} else {
618-
[fActions setObject:action forKey:[sActions objectForKey:[action getDescription]]];
619-
[fActionSelectors addObject:[sActionSelectors objectForKey:[sActions objectForKey:[action getDescription]]]];
618+
NSString *nsActionName = [sActions objectForKey:[action getDescription]];
619+
if (nsActionName != nil) {
620+
[fActions setObject:action forKey:nsActionName];
621+
[fActionSelectors addObject:[sActionSelectors objectForKey:nsActionName]];
622+
}
620623
}
621624
[action release];
622625
}

src/java.desktop/share/native/include/sizecalc.h renamed to src/java.desktop/share/native/common/awt/utility/sizecalc.h

File renamed without changes.

test/hotspot/jtreg/containers/docker/TestMisc.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,19 @@ private static void checkContainerInfo(OutputAnalyzer out) throws Exception {
123123
for (String s : expectedToContain) {
124124
out.shouldContain(s);
125125
}
126+
String str = out.getOutput();
127+
if (str.contains("cgroupv1")) {
128+
out.shouldContain("kernel_memory_usage_in_bytes");
129+
out.shouldContain("kernel_memory_max_usage_in_bytes");
130+
out.shouldContain("kernel_memory_limit_in_bytes");
131+
} else {
132+
if (str.contains("cgroupv2")) {
133+
out.shouldContain("memory_swap_current_in_bytes");
134+
out.shouldContain("memory_swap_max_limit_in_bytes");
135+
} else {
136+
throw new RuntimeException("Output has to contain information about cgroupv1 or cgroupv2");
137+
}
138+
}
126139
}
127140

128141
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*
2+
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2022, Google and/or its affiliates. All rights reserved.
4+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5+
*
6+
* This code is free software; you can redistribute it and/or modify it
7+
* under the terms of the GNU General Public License version 2 only, as
8+
* published by the Free Software Foundation.
9+
*
10+
* This code is distributed in the hope that it will be useful, but WITHOUT
11+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13+
* version 2 for more details (a copy is included in the LICENSE file that
14+
* accompanied this code).
15+
*
16+
* You should have received a copy of the GNU General Public License version
17+
* 2 along with this work; if not, write to the Free Software Foundation,
18+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19+
*
20+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21+
* or visit www.oracle.com if you need additional information or have any
22+
* questions.
23+
*/
24+
25+
/*
26+
* @test id=default
27+
* @bug 8292695
28+
* @summary Check that Ctrl-\ or Ctrl-Break (on Windows) causes HotSpot VM to print a full thread dump.
29+
* @library /vmTestbase
30+
* /test/lib
31+
* @run driver TestBreakSignalThreadDump
32+
*/
33+
34+
/*
35+
* @test id=with_jsig
36+
* @bug 8292695
37+
* @summary Check that Ctrl-\ causes HotSpot VM to print a full thread dump when signal chaining is used.
38+
* @requires os.family != "windows" & os.family != "aix"
39+
* @library /vmTestbase
40+
* /test/lib
41+
* @run driver TestBreakSignalThreadDump load_libjsig
42+
*/
43+
44+
import java.nio.file.Files;
45+
import java.nio.file.Path;
46+
import java.util.Map;
47+
import jdk.test.lib.Platform;
48+
import jdk.test.lib.Utils;
49+
import jdk.test.lib.process.ProcessTools;
50+
import jdk.test.lib.process.OutputAnalyzer;
51+
import vm.share.ProcessUtils;
52+
53+
public class TestBreakSignalThreadDump {
54+
55+
static class TestProcess {
56+
static {
57+
System.loadLibrary("ProcessUtils");
58+
}
59+
60+
public static void main(String[] argv) throws Exception {
61+
ProcessUtils.sendCtrlBreak();
62+
// Wait a bit, as JVM processes the break signal asynchronously.
63+
Thread.sleep(1000);
64+
System.out.println("Done!");
65+
}
66+
}
67+
68+
public static void main(String[] argv) throws Exception {
69+
String main = "TestBreakSignalThreadDump$TestProcess";
70+
ProcessBuilder pb = ProcessTools.createTestJvm("-Djava.library.path=" + Utils.TEST_NATIVE_PATH, main);
71+
72+
if (argv.length > 0 && argv[0].equals("load_libjsig")) {
73+
prepend_jsig_lib(pb.environment());
74+
}
75+
76+
OutputAnalyzer output = new OutputAnalyzer(pb.start());
77+
output.shouldHaveExitValue(0);
78+
output.shouldContain("Full thread dump ");
79+
output.shouldContain("java.lang.Thread.State: RUNNABLE");
80+
output.shouldContain("Done!");
81+
}
82+
83+
private static void prepend_jsig_lib(Map<String, String> env) {
84+
Path libjsig = Platform.jvmLibDir().resolve("libjsig." + Platform.sharedLibraryExt());
85+
if (!Files.exists(libjsig)) {
86+
throw new RuntimeException("File libjsig not found, path: " + libjsig);
87+
}
88+
String env_var = Platform.isOSX() ? "DYLD_INSERT_LIBRARIES" : "LD_PRELOAD";
89+
env.put(env_var, libjsig.toString());
90+
}
91+
}

0 commit comments

Comments
 (0)