From ea00ee93679bfe993603873d4c6b056263f2aa08 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Fri, 15 Nov 2024 07:35:01 +0000 Subject: [PATCH 01/10] 8343474: [updates] Customize README.md to specifics of update project Reviewed-by: sgehwolf, lucy Backport-of: 22d5e0d1f8849410abe40165b58f45f5e4293884 --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 399e7cc311f..55e2a24a175 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,11 @@ -# Welcome to the JDK! +# Welcome to OpenJDK 17 Updates! + +The JDK 17 Updates project uses two GitHub repositories. +Updates are continuously developed in the repository [jdk17u-dev](https://github.com/openjdk/jdk17u-dev). This is the repository usually targeted by contributors. +The [jdk17u](https://github.com/openjdk/jdk17u) repository is used for rampdown of the update releases of jdk17u and only accepts critical changes that must make the next release during rampdown. (You probably do not want to target jdk17u). + +For more OpenJDK 17 updates specific information such as timelines and contribution guidelines see the [project wiki page](https://wiki.openjdk.org/display/JDKUpdates/JDK+17u/). + For build instructions please see the [online documentation](https://openjdk.java.net/groups/build/doc/building.html), From c5607ffeb90272587a92cdbdc94bf01e32774a35 Mon Sep 17 00:00:00 2001 From: Peter Shipton Date: Fri, 15 Nov 2024 10:14:45 -0500 Subject: [PATCH 02/10] Set test flag vm.opt.final.ClassUnloading Backport https://github.com/ibmruntimes/openj9-openjdk-jdk21/pull/34 Issue https://github.com/eclipse-openj9/openj9/issues/20587 Signed-off-by: Peter Shipton --- closed/test/jtreg-ext/requires/OpenJ9PropsExt.java | 1 + 1 file changed, 1 insertion(+) diff --git a/closed/test/jtreg-ext/requires/OpenJ9PropsExt.java b/closed/test/jtreg-ext/requires/OpenJ9PropsExt.java index 410bfc87556..b70dc91c2bd 100644 --- a/closed/test/jtreg-ext/requires/OpenJ9PropsExt.java +++ b/closed/test/jtreg-ext/requires/OpenJ9PropsExt.java @@ -50,6 +50,7 @@ public Map call() { map.put("vm.hasJFR", "false"); map.put("vm.jvmti", "true"); map.put("vm.musl", "false"); + map.put("vm.opt.final.ClassUnloading", "true"); } catch (Exception e) { e.printStackTrace(); From 3394d3cf421e3370ff15b4ede8d6a3f70d2f0384 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 18 Nov 2024 10:14:36 +0000 Subject: [PATCH 03/10] 8300416: java.security.MessageDigestSpi clone can result in thread-unsafe clones Backport-of: 2e2e71e1fa326b8d30f018a3e0726bbcd6d24019 --- .../java/security/MessageDigestSpi.java | 12 +++- .../security/MessageDigest/TestCloneable.java | 58 +++++++++++++++++-- 2 files changed, 64 insertions(+), 6 deletions(-) diff --git a/src/java.base/share/classes/java/security/MessageDigestSpi.java b/src/java.base/share/classes/java/security/MessageDigestSpi.java index 17bd34e507c..c99abf79ecd 100644 --- a/src/java.base/share/classes/java/security/MessageDigestSpi.java +++ b/src/java.base/share/classes/java/security/MessageDigestSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -204,7 +204,15 @@ protected int engineDigest(byte[] buf, int offset, int len) */ public Object clone() throws CloneNotSupportedException { if (this instanceof Cloneable) { - return super.clone(); + MessageDigestSpi o = (MessageDigestSpi)super.clone(); + if (o.tempArray != null) { + // New byte arrays are allocated when the ByteBuffer argument + // to engineUpdate is not backed by a byte array. + // Here, the newly allocated byte array must also be cloned + // to prevent threads from sharing the same memory. + o.tempArray = tempArray.clone(); + } + return o; } else { throw new CloneNotSupportedException(); } diff --git a/test/jdk/java/security/MessageDigest/TestCloneable.java b/test/jdk/java/security/MessageDigest/TestCloneable.java index 915f0c0996e..3a4feb82ff6 100644 --- a/test/jdk/java/security/MessageDigest/TestCloneable.java +++ b/test/jdk/java/security/MessageDigest/TestCloneable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 @@ -23,12 +23,16 @@ /* * @test - * @bug 8246077 + * @bug 8246077 8300416 * @summary Make sure that digest spi and the resulting digest impl are - * consistent in the impl of Cloneable interface + * consistent in the impl of Cloneable interface, and that clones do not + * share memory. * @run testng TestCloneable */ +import java.nio.ByteBuffer; import java.security.*; +import java.util.Arrays; +import java.util.Random; import java.util.Objects; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -53,7 +57,7 @@ public Object[][] testData() { @Test(dataProvider = "testData") public void test(String algo, String provName) throws NoSuchProviderException, NoSuchAlgorithmException, - CloneNotSupportedException { + CloneNotSupportedException, InterruptedException { System.out.print("Testing " + algo + " impl from " + provName); Provider p = Security.getProvider(provName); Provider.Service s = p.getService("MessageDigest", algo); @@ -71,6 +75,52 @@ public void test(String algo, String provName) System.out.println(": NOT Cloneable"); Assert.assertThrows(CNSE, ()->md.clone()); } + + System.out.print("Testing " + algo + " impl from " + provName); + final var d1 = MessageDigest.getInstance(algo, provName); + final var buffer = ByteBuffer.allocateDirect(1024); + final var r = new Random(1024); + + fillBuffer(r, buffer); + d1.update(buffer); // this statement triggers tempArray allocation + final var d2 = (MessageDigest) d1.clone(); + assert Arrays.equals(d1.digest(), d2.digest()); + + final var t1 = updateThread(d1); + final var t2 = updateThread(d2); + t1.join(); + t2.join(); + + System.out.println(": Shared data check"); + // Random is producing the same sequence of bytes for each thread, + // and thus each MessageDigest should be equal. When the memory is + // shared, they inevitably overwrite each other's tempArray and + // you get different results. + if (!Arrays.equals(d1.digest(), d2.digest())) { + throw new AssertionError("digests differ"); + } + System.out.println("Test Passed"); } + + private static void fillBuffer(final Random r, final ByteBuffer buffer) { + final byte[] bytes = new byte[buffer.capacity()]; + r.nextBytes(bytes); + buffer.clear(); + buffer.put(bytes); + buffer.flip(); + } + + public static Thread updateThread(final MessageDigest d) { + final var t = new Thread(() -> { + final var r = new Random(1024); + final ByteBuffer buffer = ByteBuffer.allocateDirect(1024); + for (int i = 0; i < 1024; i++) { + fillBuffer(r, buffer); + d.update(buffer); + } + }); + t.start(); + return t; + } } From 589be4a1cb132e525e0b3c606b76b76a20334053 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 18 Nov 2024 13:45:47 +0000 Subject: [PATCH 04/10] 8258734: jdk/jfr/event/oldobject/TestClassLoaderLeak.java failed with "RuntimeException: Could not find class leak" Backport-of: aefd4ac4a336f00c067bcb91b95472ccc9a6bf83 --- .../jdk/jfr/event/oldobject/TestClassLoaderLeak.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/jdk/jdk/jfr/event/oldobject/TestClassLoaderLeak.java b/test/jdk/jdk/jfr/event/oldobject/TestClassLoaderLeak.java index 51fd2e045f4..aa74c631389 100644 --- a/test/jdk/jdk/jfr/event/oldobject/TestClassLoaderLeak.java +++ b/test/jdk/jdk/jfr/event/oldobject/TestClassLoaderLeak.java @@ -55,11 +55,14 @@ public static void main(String[] args) throws Exception { r.enable(EventNames.OldObjectSample).withStackTrace().with("cutoff", "infinity"); r.start(); TestClassLoader testClassLoader = new TestClassLoader(); - for (Class clazz : testClassLoader.loadClasses(OldObjects.MIN_SIZE / 20)) { + for (Class clazz : testClassLoader.loadClasses(OldObjects.MIN_SIZE / 200)) { // Allocate array to trigger sampling code path for interpreter / c1 - for (int i = 0; i < 20; i++) { + for (int i = 0; i < 200; i++) { Object classArray = Array.newInstance(clazz, 20); - Array.set(classArray, i, clazz.newInstance()); + // No need to fill whole array + for (int j = 0; j < 5; j++) { + Array.set(classArray, j, clazz.getConstructors()[0].newInstance()); + } classObjects.add(classArray); } } @@ -67,6 +70,7 @@ public static void main(String[] args) throws Exception { List events = Events.fromRecording(r); Events.hasEvents(events); for (RecordedEvent e : events) { + System.out.println(e); RecordedObject object = e.getValue("object"); RecordedClass rc = object.getValue("type"); if (rc.getName().contains("TestClass")) { From 0f95e70889930812418aaa5649bef59b6fe01695 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 18 Nov 2024 13:46:53 +0000 Subject: [PATCH 05/10] 8284291: sun/security/krb5/auto/Renew.java fails intermittently on Windows 11 Backport-of: 05ae7ed1aac6fabc9c8820c12b6567fe93a3546f --- test/jdk/sun/security/krb5/auto/Renew.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/jdk/sun/security/krb5/auto/Renew.java b/test/jdk/sun/security/krb5/auto/Renew.java index 9b3ac7db38b..30e5be285ab 100644 --- a/test/jdk/sun/security/krb5/auto/Renew.java +++ b/test/jdk/sun/security/krb5/auto/Renew.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -82,7 +82,10 @@ public static void main(String[] args) throws Exception { Date d1 = c.s().getPrivateCredentials(KerberosTicket.class).iterator().next().getAuthTime(); // 6s is longer than half of 10s - Thread.sleep(6000); + Date expiring = new Date(d1.getTime() + 6000); + while (new Date().before(expiring)) { + Thread.sleep(500); + } // The second login uses the cache c = Context.fromJAAS("second"); From 8947c88aa8a7c81938431432e3f643f14ed68bb1 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 18 Nov 2024 13:47:53 +0000 Subject: [PATCH 06/10] 8292309: Fix java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java test Backport-of: b22a38dedb06199f2cba3b6f8962ddf2f9f4f16d --- .../ConstrainedPrintingTest.java | 396 +++++------------- 1 file changed, 112 insertions(+), 284 deletions(-) diff --git a/test/jdk/java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java b/test/jdk/java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java index b284a033316..f5c349ac9a5 100644 --- a/test/jdk/java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java +++ b/test/jdk/java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -27,90 +27,89 @@ @key printer @summary verify that child components can draw only inside their visible bounds - @author das@sparc.spb.su area=awt.print - @run main/manual=yesno ConstrainedPrintingTest + @library /test/lib + @library /javax/accessibility/manual + @build lib.ManualTestFrame + @build lib.TestResult + @build jtreg.SkippedException + @run main/manual ConstrainedPrintingTest */ -// Note there is no @ in front of test above. This is so that the -// harness will not mistake this file as a test file. It should -// only see the html file as a test file. (the harness runs all -// valid test files, so it would run this test twice if this file -// were valid as well as the html file.) -// Also, note the area= after Your Name in the author tag. Here, you -// should put which functional area the test falls in. See the -// AWT-core home page -> test areas and/or -> AWT team for a list of -// areas. -// There are several places where ManualYesNoTest appear. It is -// recommended that these be changed by a global search and replace, -// such as ESC-% in xemacs. - - - -/** - * ConstrainedPrintingTest.java - * - * summary: verify that child components can draw only inside their - * visible bounds - * - */ - -import java.applet.Applet; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - - -//Manual tests should run as applet tests if possible because they -// get their environments cleaned up, including AWT threads, any -// test created threads, and any system resources used by the test -// such as file descriptors. (This is normally not a problem as -// main tests usually run in a separate VM, however on some platforms -// such as the Mac, separate VMs are not possible and non-applet -// tests will cause problems). Also, you don't have to worry about -// synchronisation stuff in Applet tests the way you do in main -// tests... - - -public class ConstrainedPrintingTest implements ActionListener - { - //Declare things used in the test, like buttons and labels here - final Frame frame = new Frame("PrintTest"); - final Button button = new Button("Print"); - final Panel panel = new Panel(); - final Component testComponent = new Component() { - public void paint(Graphics g) { - ConstrainedPrintingTest.paintOutsideBounds(this, g, Color.green); - } - public Dimension getPreferredSize() { - return new Dimension(100, 100); - } - }; - final Canvas testCanvas = new Canvas() { - public void paint(Graphics g) { - ConstrainedPrintingTest.paintOutsideBounds(this, g, Color.red); - // The frame is sized so that only the upper part of - // the canvas is visible. We draw on the lower part, - // so that we can verify that the output is clipped - // by the parent container bounds. - Dimension panelSize = panel.getSize(); - Rectangle b = getBounds(); - g.setColor(Color.red); - g.setClip(null); - for (int i = panelSize.height - b.y; i < b.height; i+= 10) { - g.drawLine(0, i, b.width, i); +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Canvas; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.JobAttributes; +import java.awt.PageAttributes; +import java.awt.Panel; +import java.awt.PrintJob; +import java.awt.Rectangle; +import java.awt.print.PrinterJob; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.util.function.Consumer; +import java.util.function.Supplier; +import javax.swing.JEditorPane; +import jtreg.SkippedException; +import lib.ManualTestFrame; +import lib.TestResult; + +public class ConstrainedPrintingTest { + + public static void createTestUI() { + Frame frame = new Frame("PrintTest"); + Button button = new Button("Print"); + Panel panel = new Panel(); + Component testComponent = new Component() { + public void paint(Graphics g) { + ConstrainedPrintingTest.paintOutsideBounds(this, g, Color.green); } - } - public Dimension getPreferredSize() { - return new Dimension(100, 100); - } - }; - - public void init() - { - //Create instructions for the user here, as well as set up - // the environment -- set the layout manager, add buttons, - // etc. - button.addActionListener(this); + public Dimension getPreferredSize() { + return new Dimension(100, 100); + } + }; + + Canvas testCanvas = new Canvas() { + public void paint(Graphics g) { + ConstrainedPrintingTest.paintOutsideBounds(this, g, Color.red); + // The frame is sized so that only the upper part of + // the canvas is visible. We draw on the lower part, + // so that we can verify that the output is clipped + // by the parent container bounds. + Dimension panelSize = panel.getSize(); + Rectangle b = getBounds(); + g.setColor(Color.red); + g.setClip(null); + for (int i = panelSize.height - b.y; i < b.height; i+= 10) { + g.drawLine(0, i, b.width, i); + } + } + public Dimension getPreferredSize() { + return new Dimension(100, 100); + } + }; + + button.addActionListener((actionEvent) -> { + PageAttributes pa = new PageAttributes(); + pa.setPrinterResolution(36); + PrintJob pjob = frame.getToolkit().getPrintJob(frame, "NewTest", + new JobAttributes(), pa); + if (pjob != null) { + Graphics pg = pjob.getGraphics(); + if (pg != null) { + pg.translate(20, 20); + frame.printAll(pg); + pg.dispose(); + } + pjob.end(); + } + }); panel.setBackground(Color.white); panel.setLayout(new FlowLayout(FlowLayout.CENTER, 20, 20)); @@ -123,63 +122,8 @@ public void init() frame.setSize(200, 250); frame.validate(); frame.setResizable(false); - - String[] instructions = - { - "1.Look at the frame titled \"PrintTest\". If you see green or", - " red lines on the white area below the \"Print\" button, the", - " test fails. Otherwise go to step 2.", - "2.Press \"Print\" button. The print dialog will appear. Select", - " a printer and proceed. Look at the output. If you see multiple", - " lines outside of the frame bounds or in the white area below", - " the image of the \"Print\" button, the test fails. Otherwise", - " the test passes." - }; - Sysout.createDialogWithInstructions( instructions ); - - }//End init() - - public void start () - { - //Get things going. Request focus, set size, et cetera - + frame.setLocationRelativeTo(null); frame.setVisible(true); - - //What would normally go into main() will probably go here. - //Use System.out.println for diagnostic messages that you want - // to read after the test is done. - //Use Sysout.println for messages you want the tester to read. - - }// start() - - //The rest of this class is the actions which perform the test... - - //Use Sysout.println to communicate with the user NOT System.out!! - //Sysout.println ("Something Happened!"); - - public void stop() { - frame.setVisible(false); - } - - public void destroy() { - frame.dispose(); - } - - public void actionPerformed(ActionEvent e) { - PageAttributes pa = new PageAttributes(); - pa.setPrinterResolution(36); - PrintJob pjob = frame.getToolkit().getPrintJob(frame, "NewTest", - new JobAttributes(), - pa); - if (pjob != null) { - Graphics pg = pjob.getGraphics(); - if (pg != null) { - pg.translate(20, 20); - frame.printAll(pg); - pg.dispose(); - } - pjob.end(); - } } public static void paintOutsideBounds(Component comp, @@ -204,153 +148,37 @@ public static void paintOutsideBounds(Component comp, } } - public static void main(String[] args) { - ConstrainedPrintingTest c = new ConstrainedPrintingTest(); - - c.init(); - c.start(); - } + public static void main(String[] args) throws InterruptedException, + InvocationTargetException, IOException { - }// class ConstrainedPrintingTest - -/* Place other classes related to the test after this line */ - - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - - }// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog - { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("South", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() + if (PrinterJob.lookupPrintServices().length == 0) { + throw new SkippedException("Printer not configured or available." + + " Test cannot continue."); + } - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); + String instruction = """ + 1.Look at the frame titled "PrintTest". If you see green or, + red lines on the white area below the "Print" button, the, + test fails. Otherwise go to step 2., + 2.Press "Print" button. The print dialog will appear. + Select, a printer and proceed. Look at the output. + If you see multiple, lines outside of the frame bounds + or in the white area below, the image of the "Print" + button, the test fails. Otherwise,the test passes. + """; + Consumer testInstProvider = e -> { + e.setContentType("text/plain"); + e.setText(instruction); + }; + + Supplier resultSupplier = ManualTestFrame.showUI( + "Tests ConstrainedPrintingTest", + "Wait until the Test UI is seen", testInstProvider); + EventQueue.invokeAndWait(ConstrainedPrintingTest::createTestUI); + + //this will block until user decision to pass or fail the test + TestResult testResult = resultSupplier.get(); + ManualTestFrame.handleResult(testResult,"ConstrainedPrintingTest"); } +} - }// TestDialog class From b79394052e34c99be60bc5c02f74f7c503bd45ff Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 18 Nov 2024 13:49:14 +0000 Subject: [PATCH 07/10] 8298513: vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy009/TestDescription.java fails with usage tracker Backport-of: 220781fa56a9c8d3b64c5c6578ffd76b9edb795c --- .../nsk/jdi/EventSet/suspendPolicy/suspendpolicy009.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy009.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy009.java index 86a8e1faa5e..d7a1bbc7833 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy009.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy009.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -292,7 +292,7 @@ private void testRun() for (int i = 0; ; i++) { - breakpointForCommunication(); + breakpointForCommunication(debuggeeName); int instruction = ((IntegerValue) (debuggeeClass.getValue(debuggeeClass.fieldByName("instruction")))).value(); From afa639075817ab743b5a6194cc8a5b9c2db3c5e2 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Mon, 18 Nov 2024 15:39:29 +0000 Subject: [PATCH 08/10] 8207908: JMXStatusTest.java fails assertion intermittently Backport-of: d0abff2f0745aa135cc9dbf6def4f260b634f107 --- .../management/jmxremote/startstop/JMXStatusTest.java | 5 ++--- .../jmxremote/startstop/ManagementAgentJcmd.java | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java b/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java index 1e6259ef0d7..fc1b4883220 100644 --- a/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java +++ b/test/jdk/sun/management/jmxremote/startstop/JMXStatusTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -88,8 +88,6 @@ public final void setup() throws Exception { args.addAll(getCustomVmArgs()); args.add(TEST_APP_NAME); testAppPb = ProcessTools.createTestJavaProcessBuilder(args); - - jcmd = new ManagementAgentJcmd(TEST_APP_NAME, false); } @BeforeMethod @@ -98,6 +96,7 @@ public final void startTestApp() throws Exception { TEST_APP_NAME, testAppPb, (Predicate)l->l.trim().equals("main enter") ); + jcmd = new ManagementAgentJcmd(testApp, false); } @AfterMethod diff --git a/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java b/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java index 0781bc941fd..7135f6ea2db 100644 --- a/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java +++ b/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -47,11 +47,11 @@ final class ManagementAgentJcmd { private static final String CMD_STATUS = "ManagementAgent.status"; private static final String CMD_PRINTPERF = "PerfCounter.print"; - private final String id; + private final long pid; private final boolean verbose; - public ManagementAgentJcmd(String targetApp, boolean verbose) { - this.id = targetApp; + public ManagementAgentJcmd(Process targetApp, boolean verbose) { + this.pid = targetApp.pid(); this.verbose = verbose; } @@ -174,7 +174,7 @@ private String jcmd(String ... command) throws IOException, InterruptedException * @throws InterruptedException */ private String jcmd(Consumer c, String ... command) throws IOException, InterruptedException { - return jcmd(id, c, command); + return jcmd(Long.toString(pid), c, command); } /** From d20f6a6a5c9f4d377de39fcc5354e97daf259110 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Mon, 18 Nov 2024 16:25:53 +0000 Subject: [PATCH 09/10] 8343923: GHA: Switch to Xcode 15 on MacOS AArch64 runners Backport-of: 4c5bc5f2f091ae861d5329cdae42fe7fa295544b --- .github/workflows/main.yml | 4 +++- .github/workflows/test.yml | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e89dcb81809..6db382ea324 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -237,7 +237,7 @@ jobs: with: platform: macos-aarch64 runs-on: 'macos-14' - xcode-toolset-version: '14.3.1' + xcode-toolset-version: '15.4' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.select.outputs.macos-aarch64 == 'true' @@ -291,6 +291,7 @@ jobs: platform: macos-x64 bootjdk-platform: macos-x64 runs-on: macos-13 + xcode-toolset-version: '14.3.1' test-macos-aarch64: name: macos-aarch64 @@ -301,6 +302,7 @@ jobs: platform: macos-aarch64 bootjdk-platform: macos-aarch64 runs-on: macos-14 + xcode-toolset-version: '15.4' test-windows-x64: name: windows-x64 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a8885866c12..3517fa53941 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,9 @@ on: runs-on: required: true type: string + xcode-toolset-version: + required: false + type: string env: # These are needed to make the MSYS2 bash work properly @@ -147,7 +150,7 @@ jobs: run: | # On macOS we need to install some dependencies for testing brew install make - sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer + sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-toolset-version }}.app/Contents/Developer # This will make GNU make available as 'make' and not only as 'gmake' echo '/usr/local/opt/make/libexec/gnubin' >> $GITHUB_PATH if: runner.os == 'macOS' From 3728b1667719b690869d9fd09cd7a66215873cc9 Mon Sep 17 00:00:00 2001 From: Jason Feng Date: Wed, 20 Nov 2024 10:27:15 -0500 Subject: [PATCH 10/10] Update OPENJDK_TAG to merged level jdk-17.0.14+4 Signed-off-by: Jason Feng --- closed/openjdk-tag.gmk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/closed/openjdk-tag.gmk b/closed/openjdk-tag.gmk index 00a10355220..234dabaa278 100644 --- a/closed/openjdk-tag.gmk +++ b/closed/openjdk-tag.gmk @@ -1 +1 @@ -OPENJDK_TAG := jdk-17.0.14+3 +OPENJDK_TAG := jdk-17.0.14+4