diff --git a/7092821-java.security.Provider.getService-is-synchro.patch b/7092821-java.security.Provider.getService-is-synchro.patch index 81bd24504fb43e43407946310f8c287742ef55b9..a20593fbc510c7cb8dab00f7d108500458b18b73 100644 --- a/7092821-java.security.Provider.getService-is-synchro.patch +++ b/7092821-java.security.Provider.getService-is-synchro.patch @@ -43,21 +43,22 @@ Bug url: https://bugs.openjdk.java.net/browse/JDK-7092821 create mode 100644 jdk/test/micro/org/openeuler/bench/security/provider/GetServiceBenchmark.java diff --git a/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java b/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java -index efe8031fe..472439b86 100644 +index 1e5b5dd0..66a26db2 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java -@@ -28,6 +28,10 @@ package com.sun.crypto.provider; +@@ -28,7 +28,10 @@ package com.sun.crypto.provider; import java.security.AccessController; import java.security.Provider; import java.security.SecureRandom; +- +import java.security.PrivilegedAction; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; - /** -@@ -78,16 +82,6 @@ public final class SunJCE extends Provider { + * The "SunJCE" Cryptographic Service Provider. +@@ -78,16 +81,6 @@ public final class SunJCE extends Provider { "(implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, " + "Diffie-Hellman, HMAC)"; @@ -74,11 +75,10 @@ index efe8031fe..472439b86 100644 /* Are we debugging? -- for developers */ static final boolean debug = false; -@@ -102,10 +96,116 @@ public final class SunJCE extends Provider { +@@ -102,10 +95,115 @@ public final class SunJCE extends Provider { } static SecureRandom getRandom() { return SecureRandomHolder.RANDOM; } -+ + // create an aliases List from the specified aliases + public static List createAliases(String ... aliases) { + return Arrays.asList(aliases); @@ -191,7 +191,7 @@ index efe8031fe..472439b86 100644 final String BLOCK_MODES = "ECB|CBC|PCBC|CTR|CTS|CFB|OFB" + "|CFB8|CFB16|CFB24|CFB32|CFB40|CFB48|CFB56|CFB64" + "|OFB8|OFB16|OFB24|OFB32|OFB40|OFB48|OFB56|OFB64"; -@@ -114,676 +214,516 @@ public final class SunJCE extends Provider { +@@ -114,694 +212,529 @@ public final class SunJCE extends Provider { "|OFB72|OFB80|OFB88|OFB96|OFB104|OFB112|OFB120|OFB128"; final String BLOCK_PADS = "NOPADDING|PKCS5PADDING|ISO10126PADDING"; @@ -788,7 +788,19 @@ index efe8031fe..472439b86 100644 - put("Alg.Alias.Mac.1.2.840.113549.2.11", "HmacSHA512"); - - put("Mac.HmacPBESHA1", -- "com.sun.crypto.provider.HmacPKCS12PBESHA1"); +- "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA1"); +- put("Mac.HmacPBESHA224", +- "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA224"); +- put("Mac.HmacPBESHA256", +- "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA256"); +- put("Mac.HmacPBESHA384", +- "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA384"); +- put("Mac.HmacPBESHA512", +- "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA512"); +- put("Mac.HmacPBESHA512/224", +- "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA512_224"); +- put("Mac.HmacPBESHA512/256", +- "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA512_256"); - - // PBMAC1 - @@ -815,6 +827,12 @@ index efe8031fe..472439b86 100644 - put("Mac.HmacSHA384 SupportedKeyFormats", "RAW"); - put("Mac.HmacSHA512 SupportedKeyFormats", "RAW"); - put("Mac.HmacPBESHA1 SupportedKeyFormats", "RAW"); +- put("Mac.HmacPBESHA224 SupportedKeyFormats", "RAW"); +- put("Mac.HmacPBESHA256 SupportedKeyFormats", "RAW"); +- put("Mac.HmacPBESHA384 SupportedKeyFormats", "RAW"); +- put("Mac.HmacPBESHA512 SupportedKeyFormats", "RAW"); +- put("Mac.HmacPBESHA512/224 SupportedKeyFormats", "RAW"); +- put("Mac.HmacPBESHA512/256 SupportedKeyFormats", "RAW"); - put("Mac.PBEWithHmacSHA1 SupportedKeyFormatS", "RAW"); - put("Mac.PBEWithHmacSHA224 SupportedKeyFormats", "RAW"); - put("Mac.PBEWithHmacSHA256 SupportedKeyFormats", "RAW"); @@ -1324,8 +1342,21 @@ index efe8031fe..472439b86 100644 + ps("Mac", "HmacSHA512", "com.sun.crypto.provider.HmacCore$HmacSHA512", + macSHA512Aliases, attrs); + // TODO: aliases with OIDs -+ ps("Mac", "HmacPBESHA1", "com.sun.crypto.provider.HmacPKCS12PBESHA1", ++ ps("Mac", "HmacPBESHA1", "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA1", ++ null, attrs); ++ ps("Mac", "HmacPBESHA224", "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA224", ++ null, attrs); ++ ps("Mac", "HmacPBESHA256", "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA256", + null, attrs); ++ ps("Mac", "HmacPBESHA384", "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA384", ++ null, attrs); ++ ps("Mac", "HmacPBESHA512", "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA512", ++ null, attrs); ++ ps("Mac", "HmacPBESHA512/224", "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA512_224", ++ null, attrs); ++ ps("Mac", "HmacPBESHA512/256", "com.sun.crypto.provider.HmacPKCS12PBECore$HmacPKCS12PBE_SHA512_256", ++ null, attrs); ++ + // PBMAC1 + ps("Mac", "PBEWithHmacSHA1", + "com.sun.crypto.provider.PBMAC1Core$HmacSHA1", null, attrs); diff --git a/8168926.patch b/8168926.patch deleted file mode 100644 index 2eef8859afc511bf16dda001ba30f870fd750b38..0000000000000000000000000000000000000000 --- a/8168926.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 72853c670c97aae4eab64a5e9edb3c7176beaf6a Mon Sep 17 00:00:00 2001 -Date: Fri, 22 Jan 2021 16:36:41 +0800 -Subject: 8168926: C2: Bytecode escape analyzer crashes due to - stack overflow - -Summary: :8168926: C2: Bytecode escape analyzer crashes due to stack overflow -LLT: N/A -Bug url: https://bugs.openjdk.java.net/browse/JDK-8168926 ---- - hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp | 30 ++++++++++++++++++-- - hotspot/src/share/vm/ci/ciMethod.hpp | 12 +++++--- - 2 files changed, 35 insertions(+), 7 deletions(-) - -diff --git a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp -index 2b9e0e514..34bdbe94d 100644 ---- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp -+++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp -@@ -894,9 +894,33 @@ void BCEscapeAnalyzer::iterate_one_block(ciBlock *blk, StateInfo &state, Growabl - ciMethod* target = s.get_method(ignored_will_link, &declared_signature); - ciKlass* holder = s.get_declared_method_holder(); - assert(declared_signature != NULL, "cannot be null"); -- // Push appendix argument, if one. -- if (s.has_appendix()) { -- state.apush(unknown_obj); -+ // If the current bytecode has an attached appendix argument, -+ // push an unknown object to represent that argument. (Analysis -+ // of dynamic call sites, especially invokehandle calls, needs -+ // the appendix argument on the stack, in addition to "regular" arguments -+ // pushed onto the stack by bytecode instructions preceding the call.) -+ // -+ // The escape analyzer does _not_ use the ciBytecodeStream::has_appendix(s) -+ // method to determine whether the current bytecode has an appendix argument. -+ // The has_appendix() method obtains the appendix from the -+ // ConstantPoolCacheEntry::_f1 field, which can happen concurrently with -+ // resolution of dynamic call sites. Callees in the -+ // ciBytecodeStream::get_method() call above also access the _f1 field; -+ // interleaving the get_method() and has_appendix() calls in the current -+ // method with call site resolution can lead to an inconsistent view of -+ // the current method's argument count. In particular, some interleaving(s) -+ // can cause the method's argument count to not include the appendix, which -+ // then leads to stack over-/underflow in the escape analyzer. -+ // -+ // Instead of pushing the argument if has_appendix() is true, the escape analyzer -+ // pushes an appendix for all call sites targeted by invokedynamic and invokehandle -+ // instructions, except if the call site is the _invokeBasic intrinsic -+ // (that intrinsic is always targeted by an invokehandle instruction but does -+ // not have an appendix argument). -+ if (target->is_loaded() && -+ Bytecodes::has_optional_appendix(s.cur_bc_raw()) && -+ target->intrinsic_id() != vmIntrinsics::_invokeBasic) { -+ state.apush(unknown_obj); - } - // Pass in raw bytecode because we need to see invokehandle instructions. - invoke(state, s.cur_bc_raw(), target, holder); -diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp -index 307452422..99d8dbe67 100644 ---- a/hotspot/src/share/vm/ci/ciMethod.hpp -+++ b/hotspot/src/share/vm/ci/ciMethod.hpp -@@ -133,15 +133,19 @@ class ciMethod : public ciMetadata { - check_is_loaded(); - return _signature->size() + (_flags.is_static() ? 0 : 1); - } -- // Report the number of elements on stack when invoking this method. -- // This is different than the regular arg_size because invokedynamic -- // has an implicit receiver. -+ // Report the number of elements on stack when invoking the current method. -+ // If the method is loaded, arg_size() gives precise information about the -+ // number of stack elements (using the method's signature and its flags). -+ // However, if the method is not loaded, the number of stack elements must -+ // be determined differently, as the method's flags are not yet available. -+ // The invoke_arg_size() method assumes in that case that all bytecodes except -+ // invokestatic and invokedynamic have a receiver that is also pushed onto the -+ // stack by the caller of the current method. - int invoke_arg_size(Bytecodes::Code code) const { - if (is_loaded()) { - return arg_size(); - } else { - int arg_size = _signature->size(); -- // Add a receiver argument, maybe: - if (code != Bytecodes::_invokestatic && - code != Bytecodes::_invokedynamic) { - arg_size++; --- -2.19.0 - diff --git a/8194154.patch b/8194154.patch deleted file mode 100644 index c5589c8d7e36aea78f5b736b9b4c879ca3f377d6..0000000000000000000000000000000000000000 --- a/8194154.patch +++ /dev/null @@ -1,156 +0,0 @@ -From 5547d1f77577ad8514136255eed16921e4d02845 Mon Sep 17 00:00:00 2001 -Date: Fri, 22 Jan 2021 15:23:47 +0800 -Subject: 8194154: System property user.dir should not be changed - -Summary: : System property user.dir should not be changed -LLT: jdk/test/java/io/File/UserDirChangedTest.java -Bug url: https://bugs.openjdk.java.net/browse/JDK-8194154 ---- - .../classes/java/io/UnixFileSystem.java | 11 +++- - .../classes/java/io/WinNTFileSystem.java | 11 +++- - jdk/test/java/io/File/UserDirChangedTest.java | 51 +++++++++++++++++++ - 3 files changed, 69 insertions(+), 4 deletions(-) - create mode 100644 jdk/test/java/io/File/UserDirChangedTest.java - -diff --git a/jdk/src/solaris/classes/java/io/UnixFileSystem.java b/jdk/src/solaris/classes/java/io/UnixFileSystem.java -index fb0fef636..a6ef2d3a6 100644 ---- a/jdk/src/solaris/classes/java/io/UnixFileSystem.java -+++ b/jdk/src/solaris/classes/java/io/UnixFileSystem.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1998, 2018, 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 -@@ -34,6 +34,7 @@ class UnixFileSystem extends FileSystem { - private final char slash; - private final char colon; - private final String javaHome; -+ private final String userDir; - - public UnixFileSystem() { - slash = AccessController.doPrivileged( -@@ -42,6 +43,8 @@ class UnixFileSystem extends FileSystem { - new GetPropertyAction("path.separator")).charAt(0); - javaHome = AccessController.doPrivileged( - new GetPropertyAction("java.home")); -+ userDir = AccessController.doPrivileged( -+ new GetPropertyAction("user.dir")); - } - - -@@ -130,7 +133,11 @@ class UnixFileSystem extends FileSystem { - - public String resolve(File f) { - if (isAbsolute(f)) return f.getPath(); -- return resolve(System.getProperty("user.dir"), f.getPath()); -+ SecurityManager sm = System.getSecurityManager(); -+ if (sm != null) { -+ sm.checkPropertyAccess("user.dir"); -+ } -+ return resolve(userDir, f.getPath()); - } - - // Caches for canonicalization results to improve startup performance. -diff --git a/jdk/src/windows/classes/java/io/WinNTFileSystem.java b/jdk/src/windows/classes/java/io/WinNTFileSystem.java -index caa47f80c..1844a662a 100644 ---- a/jdk/src/windows/classes/java/io/WinNTFileSystem.java -+++ b/jdk/src/windows/classes/java/io/WinNTFileSystem.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2001, 2018, 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 -@@ -40,6 +40,7 @@ class WinNTFileSystem extends FileSystem { - private final char slash; - private final char altSlash; - private final char semicolon; -+ private final String userDir; - - // Whether to enable alternative data streams (ADS) by suppressing - // checking the path for invalid characters, in particular ":". -@@ -47,6 +48,8 @@ class WinNTFileSystem extends FileSystem { - semicolon = AccessController.doPrivileged( - new GetPropertyAction("path.separator")).charAt(0); - altSlash = (this.slash == '\\') ? '/' : '\\'; -+ userDir = AccessController.doPrivileged( -+ new GetPropertyAction("user.dir")); - } - - private boolean isSlash(char c) { -@@ -343,7 +346,11 @@ class WinNTFileSystem extends FileSystem { - private String getUserPath() { - /* For both compatibility and security, - we must look this up every time */ -- return normalize(System.getProperty("user.dir")); -+ SecurityManager sm = System.getSecurityManager(); -+ if (sm != null) { -+ sm.checkPropertyAccess("user.dir"); -+ } -+ return normalize(userDir); - } - - private String getDrive(String path) { -diff --git a/jdk/test/java/io/File/UserDirChangedTest.java b/jdk/test/java/io/File/UserDirChangedTest.java -new file mode 100644 -index 000000000..9eccb768e ---- /dev/null -+++ b/jdk/test/java/io/File/UserDirChangedTest.java -@@ -0,0 +1,51 @@ -+/* -+ * Copyright (c) 2018, 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 8194154 -+ @summary Test changing property user.dir on impacting getCanonicalPath -+ @run main/othervm UserDirChangedTest -+ */ -+ -+import java.io.File; -+ -+public class UserDirChangedTest { -+ public static void main(String[] args) throws Exception { -+ String keyUserDir = "user.dir"; -+ String userDirNew = "/home/a/b/c/"; -+ String fileName = "./a"; -+ -+ String userDir = System.getProperty(keyUserDir); -+ File file = new File(fileName); -+ String canFilePath = file.getCanonicalPath(); -+ -+ // now reset user.dir, this will cause crash on linux without bug 8194154 fixed. -+ System.setProperty(keyUserDir, userDirNew); -+ String newCanFilePath = file.getCanonicalPath(); -+ System.out.format("%24s %48s%n", "Canonical Path = ", canFilePath); -+ System.out.format("%24s %48s%n", "new Canonical Path = ", newCanFilePath); -+ if (!canFilePath.equals(newCanFilePath)) { -+ throw new RuntimeException("Changing property user.dir should have no effect on getCanonicalPath"); -+ } -+ } -+} --- -2.19.0 - diff --git a/8202142-jfr-event-io-TestInstrumentation-is-unstable.patch b/8202142-jfr-event-io-TestInstrumentation-is-unstable.patch deleted file mode 100755 index 6c10c0a559d0a8d58e98c6330089d1f9e5b8a4f8..0000000000000000000000000000000000000000 --- a/8202142-jfr-event-io-TestInstrumentation-is-unstable.patch +++ /dev/null @@ -1,1185 +0,0 @@ -From baadf220d261a6c610920d749a2b9c19f864ba96 Mon Sep 17 00:00:00 2001 -From: wuyan -Date: Sat, 11 Sep 2021 10:07:53 +0800 -Subject: [PATCH 20/23] 8202142: jfr/event/io/TestInstrumentation is unstable - -Summary: : JDK-8202142: jfr/event/io/TestInstrumentation is unstable -LLT: jdk/test/jdk/jfr/event/io/TestInstrumentation.java -Patch Type: backport -Bug url: https://bugs.openjdk.java.net/browse/JDK-8202142 ---- - jdk/test/jdk/jfr/event/io/IOEvent.java | 9 +- - jdk/test/jdk/jfr/event/io/IOHelper.java | 8 +- - .../jdk/jfr/event/io/TestDisabledEvents.java | 33 +-- - .../jfr/event/io/TestFileChannelEvents.java | 138 +++++------ - .../jdk/jfr/event/io/TestFileReadOnly.java | 77 +++--- - .../jfr/event/io/TestFileStreamEvents.java | 69 +++--- - .../jdk/jfr/event/io/TestInstrumentation.java | 4 +- - .../event/io/TestRandomAccessFileEvents.java | 115 ++++----- - .../event/io/TestRandomAccessFileThread.java | 222 +++++++++--------- - .../jfr/event/io/TestSocketChannelEvents.java | 122 +++++----- - .../jdk/jfr/event/io/TestSocketEvents.java | 104 ++++---- - 11 files changed, 455 insertions(+), 446 deletions(-) - -diff --git a/jdk/test/jdk/jfr/event/io/IOEvent.java b/jdk/test/jdk/jfr/event/io/IOEvent.java -index e3939fbf8..dcf70ccc3 100644 ---- a/jdk/test/jdk/jfr/event/io/IOEvent.java -+++ b/jdk/test/jdk/jfr/event/io/IOEvent.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, 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 -@@ -197,14 +197,11 @@ public class IOEvent { - } - return canonical_path; - } else { -- return String.format("%s/%s:%d", -- event.getValue("host"), -- event.getValue("address"), -- event.getValue("port")); -+ return event.getValue("address") + ":" + event.getValue("port"); - } - } - - private static String getAddress(Socket s) { -- return s.getInetAddress().toString() + ":" + s.getPort(); -+ return s.getInetAddress().getHostAddress() + ":" + s.getPort(); - } - } -diff --git a/jdk/test/jdk/jfr/event/io/IOHelper.java b/jdk/test/jdk/jfr/event/io/IOHelper.java -index f1f205529..23e61f59a 100644 ---- a/jdk/test/jdk/jfr/event/io/IOHelper.java -+++ b/jdk/test/jdk/jfr/event/io/IOHelper.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, 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 -@@ -28,6 +28,8 @@ package jdk.jfr.event.io; - import static jdk.test.lib.Asserts.assertEquals; - import static jdk.test.lib.Asserts.assertTrue; - -+import java.util.Collections; -+import java.util.Comparator; - import java.util.List; - import java.util.stream.Collectors; - -@@ -41,6 +43,7 @@ import jdk.test.lib.jfr.Events; - public class IOHelper { - - public static void verifyEqualsInOrder(List events, List expectedEvents) throws Throwable { -+ Collections.sort(events, Comparator.comparing(RecordedEvent::getStartTime)); - List actualEvents = getTestEvents(events, expectedEvents); - try { - assertEquals(actualEvents.size(), expectedEvents.size(), "Wrong number of events."); -@@ -48,6 +51,9 @@ public class IOHelper { - assertEquals(actualEvents.get(i), expectedEvents.get(i), "Wrong event at pos " + i); - } - } catch (Throwable t) { -+ for (RecordedEvent e: events) { -+ System.out.println(e); -+ } - logEvents(actualEvents, expectedEvents); - throw t; - } -diff --git a/jdk/test/jdk/jfr/event/io/TestDisabledEvents.java b/jdk/test/jdk/jfr/event/io/TestDisabledEvents.java -index aad1b217f..d80304cf0 100644 ---- a/jdk/test/jdk/jfr/event/io/TestDisabledEvents.java -+++ b/jdk/test/jdk/jfr/event/io/TestDisabledEvents.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, 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 -@@ -57,21 +57,22 @@ public class TestDisabledEvents { - public static void main(String[] args) throws Throwable { - File tmp = File.createTempFile("TestDisabledEvents", ".tmp", new File(".")); - tmp.deleteOnExit(); -- Recording recording = new Recording(); -- recording.disable(IOEvent.EVENT_FILE_READ); -- recording.disable(IOEvent.EVENT_FILE_WRITE); -- recording.start(); -- -- useRandomAccessFile(tmp); -- useFileStreams(tmp); -- useFileChannel(tmp); -- -- recording.stop(); -- for (RecordedEvent event : Events.fromRecording(recording)) { -- final String eventName = event.getEventType().getName(); -- System.out.println("Got eventName:" + eventName); -- assertNotEquals(eventName, IOEvent.EVENT_FILE_READ, "Got disabled read event"); -- assertNotEquals(eventName, IOEvent.EVENT_FILE_WRITE, "Got disabled write event"); -+ try (Recording recording = new Recording()) { -+ recording.disable(IOEvent.EVENT_FILE_READ); -+ recording.disable(IOEvent.EVENT_FILE_WRITE); -+ recording.start(); -+ -+ useRandomAccessFile(tmp); -+ useFileStreams(tmp); -+ useFileChannel(tmp); -+ -+ recording.stop(); -+ for (RecordedEvent event : Events.fromRecording(recording)) { -+ final String eventName = event.getEventType().getName(); -+ System.out.println("Got eventName:" + eventName); -+ assertNotEquals(eventName, IOEvent.EVENT_FILE_READ, "Got disabled read event"); -+ assertNotEquals(eventName, IOEvent.EVENT_FILE_WRITE, "Got disabled write event"); -+ } - } - } - -diff --git a/jdk/test/jdk/jfr/event/io/TestFileChannelEvents.java b/jdk/test/jdk/jfr/event/io/TestFileChannelEvents.java -index cb90bc54f..632fcaba3 100644 ---- a/jdk/test/jdk/jfr/event/io/TestFileChannelEvents.java -+++ b/jdk/test/jdk/jfr/event/io/TestFileChannelEvents.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, 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 -@@ -50,74 +50,74 @@ public class TestFileChannelEvents { - public static void main(String[] args) throws Throwable { - File tmp = File.createTempFile("TestFileChannelEvents", ".tmp", new File(".")); - tmp.deleteOnExit(); -- Recording recording = new Recording(); -- List expectedEvents = new ArrayList<>(); -- -- try (RandomAccessFile rf = new RandomAccessFile(tmp, "rw"); FileChannel ch = rf.getChannel();) { -- recording.enable(IOEvent.EVENT_FILE_FORCE).withThreshold(Duration.ofMillis(0)); -- recording.enable(IOEvent.EVENT_FILE_READ).withThreshold(Duration.ofMillis(0)); -- recording.enable(IOEvent.EVENT_FILE_WRITE).withThreshold(Duration.ofMillis(0)); -- recording.start(); -- -- ByteBuffer bufA = ByteBuffer.allocateDirect(10); -- ByteBuffer bufB = ByteBuffer.allocateDirect(20); -- bufA.put("1234567890".getBytes()); -- bufB.put("1234567890".getBytes()); -- -- // test write(ByteBuffer) -- bufA.flip(); -- long size = ch.write(bufA); -- expectedEvents.add(IOEvent.createFileWriteEvent(size, tmp)); -- -- // test write(ByteBuffer, long) -- bufA.flip(); -- size = ch.write(bufA, bufA.capacity() / 2); -- expectedEvents.add(IOEvent.createFileWriteEvent(size, tmp)); -- -- // test write(ByteBuffer[]) -- bufA.flip(); -- bufA.limit(5); -- bufB.flip(); -- bufB.limit(5); -- size = ch.write(new ByteBuffer[] { bufA, bufB }); -- expectedEvents.add(IOEvent.createFileWriteEvent(size, tmp)); -- -- // test force(boolean) -- ch.force(true); -- expectedEvents.add(IOEvent.createFileForceEvent(tmp)); -- -- // reset file -- ch.position(0); -- -- // test read(ByteBuffer) -- bufA.clear(); -- size = ch.read(bufA); -- expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); -- -- // test read(ByteBuffer, long) -- bufA.clear(); -- size = ch.read(bufA, bufA.capacity() / 2); -- expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); -- -- // test read(ByteBuffer[]) -- bufA.clear(); -- bufA.limit(5); -- bufB.clear(); -- bufB.limit(5); -- size = ch.read(new ByteBuffer[] { bufA, bufB }); -- expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); -- -- // Read at EOF. Should get size -1 in event. -- ch.position(ch.size()); -- bufA.clear(); -- size = ch.read(bufA); -- assertEquals(size, -1L, "Expected size -1 when read at EOF"); -- expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); -- -- ch.close(); -- recording.stop(); -- List events = Events.fromRecording(recording); -- IOHelper.verifyEqualsInOrder(events, expectedEvents); -+ try (Recording recording = new Recording()) { -+ List expectedEvents = new ArrayList<>(); -+ try (RandomAccessFile rf = new RandomAccessFile(tmp, "rw"); FileChannel ch = rf.getChannel();) { -+ recording.enable(IOEvent.EVENT_FILE_FORCE).withThreshold(Duration.ofMillis(0)); -+ recording.enable(IOEvent.EVENT_FILE_READ).withThreshold(Duration.ofMillis(0)); -+ recording.enable(IOEvent.EVENT_FILE_WRITE).withThreshold(Duration.ofMillis(0)); -+ recording.start(); -+ -+ ByteBuffer bufA = ByteBuffer.allocateDirect(10); -+ ByteBuffer bufB = ByteBuffer.allocateDirect(20); -+ bufA.put("1234567890".getBytes()); -+ bufB.put("1234567890".getBytes()); -+ -+ // test write(ByteBuffer) -+ bufA.flip(); -+ long size = ch.write(bufA); -+ expectedEvents.add(IOEvent.createFileWriteEvent(size, tmp)); -+ -+ // test write(ByteBuffer, long) -+ bufA.flip(); -+ size = ch.write(bufA, bufA.capacity() / 2); -+ expectedEvents.add(IOEvent.createFileWriteEvent(size, tmp)); -+ -+ // test write(ByteBuffer[]) -+ bufA.flip(); -+ bufA.limit(5); -+ bufB.flip(); -+ bufB.limit(5); -+ size = ch.write(new ByteBuffer[] { bufA, bufB }); -+ expectedEvents.add(IOEvent.createFileWriteEvent(size, tmp)); -+ -+ // test force(boolean) -+ ch.force(true); -+ expectedEvents.add(IOEvent.createFileForceEvent(tmp)); -+ -+ // reset file -+ ch.position(0); -+ -+ // test read(ByteBuffer) -+ bufA.clear(); -+ size = ch.read(bufA); -+ expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); -+ -+ // test read(ByteBuffer, long) -+ bufA.clear(); -+ size = ch.read(bufA, bufA.capacity() / 2); -+ expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); -+ -+ // test read(ByteBuffer[]) -+ bufA.clear(); -+ bufA.limit(5); -+ bufB.clear(); -+ bufB.limit(5); -+ size = ch.read(new ByteBuffer[] { bufA, bufB }); -+ expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); -+ -+ // Read at EOF. Should get size -1 in event. -+ ch.position(ch.size()); -+ bufA.clear(); -+ size = ch.read(bufA); -+ assertEquals(size, -1L, "Expected size -1 when read at EOF"); -+ expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); -+ -+ ch.close(); -+ recording.stop(); -+ List events = Events.fromRecording(recording); -+ IOHelper.verifyEqualsInOrder(events, expectedEvents); -+ } - } - } - } -diff --git a/jdk/test/jdk/jfr/event/io/TestFileReadOnly.java b/jdk/test/jdk/jfr/event/io/TestFileReadOnly.java -index 065ebadc3..b7e20d0ef 100644 ---- a/jdk/test/jdk/jfr/event/io/TestFileReadOnly.java -+++ b/jdk/test/jdk/jfr/event/io/TestFileReadOnly.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, 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 -@@ -52,50 +52,51 @@ public class TestFileReadOnly { - public static void main(String[] args) throws Throwable { - File tmp = File.createTempFile("TestFileReadOnly", ".tmp", new File(".")); - tmp.deleteOnExit(); -- Recording recording = new Recording(); -- List expectedEvents = new ArrayList<>(); -+ try(Recording recording = new Recording()) { -+ List expectedEvents = new ArrayList<>(); - -- recording.enable(IOEvent.EVENT_FILE_READ).withThreshold(Duration.ofMillis(0)); -- recording.enable(IOEvent.EVENT_FILE_WRITE).withThreshold(Duration.ofMillis(0)); -- recording.start(); -+ recording.enable(IOEvent.EVENT_FILE_READ).withThreshold(Duration.ofMillis(0)); -+ recording.enable(IOEvent.EVENT_FILE_WRITE).withThreshold(Duration.ofMillis(0)); -+ recording.start(); - -- final byte[] buf = { 1, 2, 3 }; -+ final byte[] buf = { 1, 2, 3 }; - -- // Create the file. -- try (RandomAccessFile f = new RandomAccessFile(tmp, "rw")) { -- f.write(buf); -- expectedEvents.add(IOEvent.createFileWriteEvent(buf.length, tmp)); -- } -- -- // Reopen the file as ReadOnly and try to write to it. -- // Should generate an event with bytesWritten = -1. -- try (RandomAccessFile f = new RandomAccessFile(tmp, "r")) { -- try { -+ // Create the file. -+ try (RandomAccessFile f = new RandomAccessFile(tmp, "rw")) { - f.write(buf); -- fail("No exception for ReadOnly File"); -- } catch (IOException e) { -- // Expected exception -- expectedEvents.add(IOEvent.createFileWriteEvent(-1, tmp)); -+ expectedEvents.add(IOEvent.createFileWriteEvent(buf.length, tmp)); - } -- } - -- // Try to write to read-only FileChannel. -- try (RandomAccessFile f = new RandomAccessFile(tmp, "r"); FileChannel ch = f.getChannel()) { -- ByteBuffer writeBuf = ByteBuffer.allocateDirect(buf.length); -- writeBuf.put(buf); -- writeBuf.flip(); -- ch.position(0); -- try { -- ch.write(writeBuf); -- fail("No exception for ReadOnly FileChannel"); -- } catch (java.nio.channels.NonWritableChannelException e) { -- // Expected exception -- expectedEvents.add(IOEvent.createFileWriteEvent(-1, tmp)); -+ // Reopen the file as ReadOnly and try to write to it. -+ // Should generate an event with bytesWritten = -1. -+ try (RandomAccessFile f = new RandomAccessFile(tmp, "r")) { -+ try { -+ f.write(buf); -+ fail("No exception for ReadOnly File"); -+ } catch (IOException e) { -+ // Expected exception -+ expectedEvents.add(IOEvent.createFileWriteEvent(-1, tmp)); -+ } - } -- } - -- recording.stop(); -- List events = Events.fromRecording(recording); -- IOHelper.verifyEqualsInOrder(events, expectedEvents); -+ // Try to write to read-only FileChannel. -+ try (RandomAccessFile f = new RandomAccessFile(tmp, "r"); FileChannel ch = f.getChannel()) { -+ ByteBuffer writeBuf = ByteBuffer.allocateDirect(buf.length); -+ writeBuf.put(buf); -+ writeBuf.flip(); -+ ch.position(0); -+ try { -+ ch.write(writeBuf); -+ fail("No exception for ReadOnly FileChannel"); -+ } catch (java.nio.channels.NonWritableChannelException e) { -+ // Expected exception -+ expectedEvents.add(IOEvent.createFileWriteEvent(-1, tmp)); -+ } -+ } -+ -+ recording.stop(); -+ List events = Events.fromRecording(recording); -+ IOHelper.verifyEqualsInOrder(events, expectedEvents); -+ } - } - } -diff --git a/jdk/test/jdk/jfr/event/io/TestFileStreamEvents.java b/jdk/test/jdk/jfr/event/io/TestFileStreamEvents.java -index 46c7b80f3..0bddf5a6c 100644 ---- a/jdk/test/jdk/jfr/event/io/TestFileStreamEvents.java -+++ b/jdk/test/jdk/jfr/event/io/TestFileStreamEvents.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, 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 -@@ -50,47 +50,48 @@ public class TestFileStreamEvents { - public static void main(String[] args) throws Throwable { - File tmp = File.createTempFile("TestFileStreamEvents", ".tmp", new File(".")); - tmp.deleteOnExit(); -- Recording recording = new Recording(); -- List expectedEvents = new ArrayList<>(); -+ try (Recording recording = new Recording()) { -+ List expectedEvents = new ArrayList<>(); - -- try(FileOutputStream fos = new FileOutputStream(tmp); FileInputStream fis = new FileInputStream(tmp);) { -- recording.enable(IOEvent.EVENT_FILE_READ).withThreshold(Duration.ofMillis(0)); -- recording.enable(IOEvent.EVENT_FILE_WRITE).withThreshold(Duration.ofMillis(0)); -- recording.start(); -+ try(FileOutputStream fos = new FileOutputStream(tmp); FileInputStream fis = new FileInputStream(tmp);) { -+ recording.enable(IOEvent.EVENT_FILE_READ).withThreshold(Duration.ofMillis(0)); -+ recording.enable(IOEvent.EVENT_FILE_WRITE).withThreshold(Duration.ofMillis(0)); -+ recording.start(); - -- int writeByte = 47; -- byte[] writeBuf = {11, 12, 13, 14}; -+ int writeByte = 47; -+ byte[] writeBuf = {11, 12, 13, 14}; - -- // Write -- fos.write(writeByte); -- expectedEvents.add(IOEvent.createFileWriteEvent(1, tmp)); -- fos.write(writeBuf); -- expectedEvents.add(IOEvent.createFileWriteEvent(writeBuf.length, tmp)); -- fos.write(writeBuf, 0, 2); -- expectedEvents.add(IOEvent.createFileWriteEvent(2, tmp)); -+ // Write -+ fos.write(writeByte); -+ expectedEvents.add(IOEvent.createFileWriteEvent(1, tmp)); -+ fos.write(writeBuf); -+ expectedEvents.add(IOEvent.createFileWriteEvent(writeBuf.length, tmp)); -+ fos.write(writeBuf, 0, 2); -+ expectedEvents.add(IOEvent.createFileWriteEvent(2, tmp)); - -- // Read -- int readByte = fis.read(); -- assertEquals(readByte, writeByte, "Wrong byte read"); -- expectedEvents.add(IOEvent.createFileReadEvent(1, tmp)); -+ // Read -+ int readByte = fis.read(); -+ assertEquals(readByte, writeByte, "Wrong byte read"); -+ expectedEvents.add(IOEvent.createFileReadEvent(1, tmp)); - -- byte[] readBuf = new byte[writeBuf.length]; -- long size = fis.read(readBuf); -- assertEquals(size, (long)writeBuf.length, "Wrong size when reading byte[]"); -- expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); -+ byte[] readBuf = new byte[writeBuf.length]; -+ long size = fis.read(readBuf); -+ assertEquals(size, (long)writeBuf.length, "Wrong size when reading byte[]"); -+ expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); - -- size = fis.read(readBuf, 0, 2); -- assertEquals(size, 2L, "Wrong size when reading 2 bytes"); -- expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); -+ size = fis.read(readBuf, 0, 2); -+ assertEquals(size, 2L, "Wrong size when reading 2 bytes"); -+ expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); - -- // We are at EOF. Read more and verify we get size -1. -- size = fis.read(readBuf); -- assertEquals(size, -1L, "Size should be -1 at EOF"); -- expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); -+ // We are at EOF. Read more and verify we get size -1. -+ size = fis.read(readBuf); -+ assertEquals(size, -1L, "Size should be -1 at EOF"); -+ expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); - -- recording.stop(); -- List events = Events.fromRecording(recording); -- IOHelper.verifyEqualsInOrder(events, expectedEvents); -+ recording.stop(); -+ List events = Events.fromRecording(recording); -+ IOHelper.verifyEqualsInOrder(events, expectedEvents); -+ } - } - } - } -diff --git a/jdk/test/jdk/jfr/event/io/TestInstrumentation.java b/jdk/test/jdk/jfr/event/io/TestInstrumentation.java -index d5430e6c6..19fe5a6da 100644 ---- a/jdk/test/jdk/jfr/event/io/TestInstrumentation.java -+++ b/jdk/test/jdk/jfr/event/io/TestInstrumentation.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, 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 -@@ -104,11 +104,9 @@ public class TestInstrumentation implements ClassFileTransformer { - "java/io/FileOutputStream::write::([B)V", - "java/io/FileOutputStream::write::([BII)V", - "java/net/SocketInputStream::read::()I", -- "java/net/SocketInputStream::read::([B)I", - "java/net/SocketInputStream::read::([BII)I", - "java/net/SocketInputStream::close::()V", - "java/net/SocketOutputStream::write::(I)V", -- "java/net/SocketOutputStream::write::([B)V", - "java/net/SocketOutputStream::write::([BII)V", - "java/net/SocketOutputStream::close::()V", - "java/nio/channels/FileChannel::read::([Ljava/nio/ByteBuffer;)J", -diff --git a/jdk/test/jdk/jfr/event/io/TestRandomAccessFileEvents.java b/jdk/test/jdk/jfr/event/io/TestRandomAccessFileEvents.java -index 959ed4d22..9c28231c5 100644 ---- a/jdk/test/jdk/jfr/event/io/TestRandomAccessFileEvents.java -+++ b/jdk/test/jdk/jfr/event/io/TestRandomAccessFileEvents.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, 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 -@@ -49,62 +49,63 @@ public class TestRandomAccessFileEvents { - public static void main(String[] args) throws Throwable { - File tmp = File.createTempFile("TestRandomAccessFileEvents", ".tmp", new File(".")); - tmp.deleteOnExit(); -- Recording recording = new Recording(); -- List expectedEvents = new ArrayList<>(); -- -- recording.enable(IOEvent.EVENT_FILE_WRITE).withThreshold(Duration.ofMillis(0)); -- recording.enable(IOEvent.EVENT_FILE_READ).withThreshold(Duration.ofMillis(0)); -- recording.start(); -- -- RandomAccessFile ras = new RandomAccessFile(tmp, "rw"); -- int writeInt = 47; -- byte[] writeBuffer = {10,11,12,13}; -- -- // Write an int and a buffer. -- ras.write(writeInt); -- expectedEvents.add(IOEvent.createFileWriteEvent(1, tmp)); -- ras.write(writeBuffer); -- expectedEvents.add(IOEvent.createFileWriteEvent(writeBuffer.length, tmp)); -- -- ras.seek(0); -- -- // Read int and buffer -- int readInt = ras.read(); -- assertEquals(readInt, writeInt, "wrong int read"); -- expectedEvents.add(IOEvent.createFileReadEvent(1, tmp)); -- byte[] readBuffer = new byte [writeBuffer.length]; -- int size = ras.read(readBuffer); -- verifyBufferEquals(readBuffer, writeBuffer); -- expectedEvents.add(IOEvent.createFileReadEvent(readBuffer.length, tmp)); -- -- // Read beyond EOF -- readInt = ras.read(); -- assertEquals(-1, readInt, "wrong read after EOF"); -- expectedEvents.add(IOEvent.createFileReadEvent(-1, tmp)); -- -- // Seek to beginning and verify we can read after EOF. -- ras.seek(0); -- readInt = ras.read(); -- assertEquals(readInt, writeInt, "wrong int read after seek(0)"); -- expectedEvents.add(IOEvent.createFileReadEvent(1, tmp)); -- -- // seek beyond EOF and verify we get EOF when reading. -- ras.seek(10); -- readInt = ras.read(); -- assertEquals(-1, readInt, "wrong read after seek beyond EOF"); -- expectedEvents.add(IOEvent.createFileReadEvent(-1, tmp)); -- -- // Read partial buffer. -- int partialSize = writeBuffer.length - 2; -- ras.seek(ras.length()-partialSize); -- size = ras.read(readBuffer); -- assertEquals(size, partialSize, "Wrong size partial buffer read"); -- expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); -- -- ras.close(); -- recording.stop(); -- List events = Events.fromRecording(recording); -- IOHelper.verifyEqualsInOrder(events, expectedEvents); -+ try (Recording recording = new Recording()) { -+ List expectedEvents = new ArrayList<>(); -+ -+ recording.enable(IOEvent.EVENT_FILE_WRITE).withThreshold(Duration.ofMillis(0)); -+ recording.enable(IOEvent.EVENT_FILE_READ).withThreshold(Duration.ofMillis(0)); -+ recording.start(); -+ -+ RandomAccessFile ras = new RandomAccessFile(tmp, "rw"); -+ int writeInt = 47; -+ byte[] writeBuffer = {10,11,12,13}; -+ -+ // Write an int and a buffer. -+ ras.write(writeInt); -+ expectedEvents.add(IOEvent.createFileWriteEvent(1, tmp)); -+ ras.write(writeBuffer); -+ expectedEvents.add(IOEvent.createFileWriteEvent(writeBuffer.length, tmp)); -+ -+ ras.seek(0); -+ -+ // Read int and buffer -+ int readInt = ras.read(); -+ assertEquals(readInt, writeInt, "wrong int read"); -+ expectedEvents.add(IOEvent.createFileReadEvent(1, tmp)); -+ byte[] readBuffer = new byte [writeBuffer.length]; -+ int size = ras.read(readBuffer); -+ verifyBufferEquals(readBuffer, writeBuffer); -+ expectedEvents.add(IOEvent.createFileReadEvent(readBuffer.length, tmp)); -+ -+ // Read beyond EOF -+ readInt = ras.read(); -+ assertEquals(-1, readInt, "wrong read after EOF"); -+ expectedEvents.add(IOEvent.createFileReadEvent(-1, tmp)); -+ -+ // Seek to beginning and verify we can read after EOF. -+ ras.seek(0); -+ readInt = ras.read(); -+ assertEquals(readInt, writeInt, "wrong int read after seek(0)"); -+ expectedEvents.add(IOEvent.createFileReadEvent(1, tmp)); -+ -+ // seek beyond EOF and verify we get EOF when reading. -+ ras.seek(10); -+ readInt = ras.read(); -+ assertEquals(-1, readInt, "wrong read after seek beyond EOF"); -+ expectedEvents.add(IOEvent.createFileReadEvent(-1, tmp)); -+ -+ // Read partial buffer. -+ int partialSize = writeBuffer.length - 2; -+ ras.seek(ras.length()-partialSize); -+ size = ras.read(readBuffer); -+ assertEquals(size, partialSize, "Wrong size partial buffer read"); -+ expectedEvents.add(IOEvent.createFileReadEvent(size, tmp)); -+ -+ ras.close(); -+ recording.stop(); -+ List events = Events.fromRecording(recording); -+ IOHelper.verifyEqualsInOrder(events, expectedEvents); -+ } - } - - private static void verifyBufferEquals(byte[] a, byte[] b) { -diff --git a/jdk/test/jdk/jfr/event/io/TestRandomAccessFileThread.java b/jdk/test/jdk/jfr/event/io/TestRandomAccessFileThread.java -index b6200fd66..539759c6f 100644 ---- a/jdk/test/jdk/jfr/event/io/TestRandomAccessFileThread.java -+++ b/jdk/test/jdk/jfr/event/io/TestRandomAccessFileThread.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, 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 -@@ -64,43 +64,42 @@ public class TestRandomAccessFileThread { - public static void main(String[] args) throws Throwable { - File tmp = File.createTempFile("TestRandomAccessFileThread", ".tmp", new File(".")); - tmp.deleteOnExit(); -- -- Recording recording = new Recording(); -- recording.enable(IOEvent.EVENT_FILE_READ).withThreshold(Duration.ofMillis(0)); -- recording.enable(IOEvent.EVENT_FILE_WRITE).withThreshold(Duration.ofMillis(0)); -- recording.start(); -- -- TestThread writerThread = new TestThread(new XRun() { -- @Override -- public void xrun() throws IOException { -- final byte[] buf = new byte[OP_COUNT]; -- for (int i = 0; i < buf.length; ++i) { -- buf[i] = (byte)((i + 'a') % 255); -- } -- try (RandomAccessFile raf = new RandomAccessFile(tmp, "rwd")) { -- for(int i = 0; i < OP_COUNT; ++i) { -- raf.write(buf, 0, i + 1); -- writeCount++; -+ try (Recording recording = new Recording()) { -+ recording.enable(IOEvent.EVENT_FILE_READ).withThreshold(Duration.ofMillis(0)); -+ recording.enable(IOEvent.EVENT_FILE_WRITE).withThreshold(Duration.ofMillis(0)); -+ recording.start(); -+ -+ TestThread writerThread = new TestThread(new XRun() { -+ @Override -+ public void xrun() throws IOException { -+ final byte[] buf = new byte[OP_COUNT]; -+ for (int i = 0; i < buf.length; ++i) { -+ buf[i] = (byte)((i + 'a') % 255); - } -- } -- }}, "TestWriterThread"); -+ try (RandomAccessFile raf = new RandomAccessFile(tmp, "rwd")) { -+ for(int i = 0; i < OP_COUNT; ++i) { -+ raf.write(buf, 0, i + 1); -+ writeCount++; -+ } -+ } -+ }}, "TestWriterThread"); - - TestThread readerThread = new TestThread(new XRun() { -- @Override -- public void xrun() throws IOException { -- try (RandomAccessFile raf = new RandomAccessFile(tmp, "r")) { -- byte[] buf = new byte[OP_COUNT]; -- for(int i = 0; i < OP_COUNT; ++i) { -- while (writeCount <= i) { -- // No more data to read. Wait for writer thread. -- Thread.yield(); -+ @Override -+ public void xrun() throws IOException { -+ try (RandomAccessFile raf = new RandomAccessFile(tmp, "r")) { -+ byte[] buf = new byte[OP_COUNT]; -+ for(int i = 0; i < OP_COUNT; ++i) { -+ while (writeCount <= i) { -+ // No more data to read. Wait for writer thread. -+ Thread.yield(); -+ } -+ int expectedSize = i + 1; -+ int actualSize = raf.read(buf, 0, expectedSize); -+ Asserts.assertEquals(actualSize, expectedSize, "Wrong read size. Probably test error."); - } -- int expectedSize = i + 1; -- int actualSize = raf.read(buf, 0, expectedSize); -- Asserts.assertEquals(actualSize, expectedSize, "Wrong read size. Probably test error."); - } -- } -- }}, "TestReaderThread"); -+ }}, "TestReaderThread"); - - readerThread.start(); - writerThread.start(); -@@ -118,7 +117,7 @@ public class TestRandomAccessFileThread { - continue; - } - logEventSummary(event); -- if (Events.isEventType(event,IOEvent.EVENT_FILE_READ)) { -+ if (Events.isEventType(event, IOEvent.EVENT_FILE_READ)) { - readEvents.add(event); - } else { - writeEvents.add(event); -@@ -136,91 +135,92 @@ public class TestRandomAccessFileThread { - Asserts.assertEquals(readEvents.size(), OP_COUNT, "Wrong number of read events"); - Asserts.assertEquals(writeEvents.size(), OP_COUNT, "Wrong number of write events"); - } -- -- private static void logEventSummary(RecordedEvent event) { -- boolean isRead = Events.isEventType(event, IOEvent.EVENT_FILE_READ); -- String name = isRead ? "read " : "write"; -- String bytesField = isRead ? "bytesRead" : "bytesWritten"; -- long bytes = Events.assertField(event, bytesField).getValue(); -- long commit = Events.assertField(event, "startTime").getValue(); -- Instant start = event.getStartTime(); -- Instant end = event.getEndTime(); -- System.out.printf("%s: bytes=%d, commit=%d, start=%s, end=%s%n", name, bytes, commit, start, end); -- } -- -- private static void verifyThread(List events, Thread thread) { -- events.stream().forEach(e -> Events.assertEventThread(e, thread)); -- } -- -- private static void verifyBytes(List events, String fieldName) { -- long expectedBytes = 0; -- for (RecordedEvent event : events) { -- Events.assertField(event, fieldName).equal(++expectedBytes); -- } -+ } -+ -+ private static void logEventSummary(RecordedEvent event) { -+ boolean isRead = Events.isEventType(event, IOEvent.EVENT_FILE_READ); -+ String name = isRead ? "read " : "write"; -+ String bytesField = isRead ? "bytesRead" : "bytesWritten"; -+ long bytes = Events.assertField(event, bytesField).getValue(); -+ long commit = Events.assertField(event, "startTime").getValue(); -+ Instant start = event.getStartTime(); -+ Instant end = event.getEndTime(); -+ System.out.printf("%s: bytes=%d, commit=%d, start=%s, end=%s%n", name, bytes, commit, start, end); -+ } -+ -+ private static void verifyThread(List events, Thread thread) { -+ events.stream().forEach(e -> Events.assertEventThread(e, thread)); -+ } -+ -+ private static void verifyBytes(List events, String fieldName) { -+ long expectedBytes = 0; -+ for (RecordedEvent event : events) { -+ Events.assertField(event, fieldName).equal(++expectedBytes); - } -- -- // Verify that all times are increasing -- private static void verifyTimes(List events) { -- RecordedEvent prev = null; -- for (RecordedEvent curr : events) { -- if (prev != null) { -- try { -- Asserts.assertGreaterThanOrEqual(curr.getStartTime(), prev.getStartTime(), "Wrong startTime"); -- Asserts.assertGreaterThanOrEqual(curr.getEndTime(), prev.getEndTime(), "Wrong endTime"); -- long commitPrev = Events.assertField(prev, "startTime").getValue(); -- long commitCurr = Events.assertField(curr, "startTime").getValue(); -- Asserts.assertGreaterThanOrEqual(commitCurr, commitPrev, "Wrong commitTime"); -- } catch (Exception e) { -- System.out.println("Error: " + e.getMessage()); -- System.out.println("Prev Event: " + prev); -- System.out.println("Curr Event: " + curr); -- throw e; -- } -+ } -+ -+ // Verify that all times are increasing -+ private static void verifyTimes(List events) { -+ RecordedEvent prev = null; -+ for (RecordedEvent curr : events) { -+ if (prev != null) { -+ try { -+ Asserts.assertGreaterThanOrEqual(curr.getStartTime(), prev.getStartTime(), "Wrong startTime"); -+ Asserts.assertGreaterThanOrEqual(curr.getEndTime(), prev.getEndTime(), "Wrong endTime"); -+ long commitPrev = Events.assertField(prev, "startTime").getValue(); -+ long commitCurr = Events.assertField(curr, "startTime").getValue(); -+ Asserts.assertGreaterThanOrEqual(commitCurr, commitPrev, "Wrong commitTime"); -+ } catch (Exception e) { -+ System.out.println("Error: " + e.getMessage()); -+ System.out.println("Prev Event: " + prev); -+ System.out.println("Curr Event: " + curr); -+ throw e; - } -- prev = curr; - } -+ prev = curr; - } -- -- // Verify that all times are increasing -- private static void verifyReadWriteTimes(List readEvents, List writeEvents) { -- List events = new ArrayList<>(); -- events.addAll(readEvents); -- events.addAll(writeEvents); -- events.sort(new EventComparator()); -- -- int countRead = 0; -- int countWrite = 0; -- for (RecordedEvent event : events) { -- if (Events.isEventType(event, IOEvent.EVENT_FILE_READ)) { -- ++countRead; -- } else { -- ++countWrite; -- } -- // We can not read from the file before it has been written. -- // This check verifies that times of different threads are correct. -- // Since the read and write are from different threads, it is possible that the read -- // is committed before the same write. -- // But read operation may only be 1 step ahead of the write operation. -- Asserts.assertLessThanOrEqual(countRead, countWrite + 1, "read must be after write"); -+ } -+ -+ // Verify that all times are increasing -+ private static void verifyReadWriteTimes(List readEvents, List writeEvents) { -+ List events = new ArrayList<>(); -+ events.addAll(readEvents); -+ events.addAll(writeEvents); -+ events.sort(new EventComparator()); -+ -+ int countRead = 0; -+ int countWrite = 0; -+ for (RecordedEvent event : events) { -+ if (Events.isEventType(event, IOEvent.EVENT_FILE_READ)) { -+ ++countRead; -+ } else { -+ ++countWrite; - } -+ // We can not read from the file before it has been written. -+ // This check verifies that times of different threads are correct. -+ // Since the read and write are from different threads, it is possible that the read -+ // is committed before the same write. -+ // But read operation may only be 1 step ahead of the write operation. -+ Asserts.assertLessThanOrEqual(countRead, countWrite + 1, "read must be after write"); - } -+ } - -- private static boolean isOurEvent(RecordedEvent event, File file) { -- if (!Events.isEventType(event, IOEvent.EVENT_FILE_READ) && -- !Events.isEventType(event, IOEvent.EVENT_FILE_WRITE)) { -- return false; -- } -- String path = Events.assertField(event, "path").getValue(); -- return file.getPath().equals(path); -+ private static boolean isOurEvent(RecordedEvent event, File file) { -+ if (!Events.isEventType(event, IOEvent.EVENT_FILE_READ) && -+ !Events.isEventType(event, IOEvent.EVENT_FILE_WRITE)) { -+ return false; - } -- -- private static class EventComparator implements Comparator { -- @Override -- public int compare(RecordedEvent a, RecordedEvent b) { -- long commitA = Events.assertField(a, "startTime").getValue(); -- long commitB = Events.assertField(b, "startTime").getValue(); -- return Long.compare(commitA, commitB); -- } -+ String path = Events.assertField(event, "path").getValue(); -+ return file.getPath().equals(path); -+ } -+ -+ private static class EventComparator implements Comparator { -+ @Override -+ public int compare(RecordedEvent a, RecordedEvent b) { -+ long commitA = Events.assertField(a, "startTime").getValue(); -+ long commitB = Events.assertField(b, "startTime").getValue(); -+ return Long.compare(commitA, commitB); - } -+ } - - } -diff --git a/jdk/test/jdk/jfr/event/io/TestSocketChannelEvents.java b/jdk/test/jdk/jfr/event/io/TestSocketChannelEvents.java -index dbd43adbf..23b692a31 100644 ---- a/jdk/test/jdk/jfr/event/io/TestSocketChannelEvents.java -+++ b/jdk/test/jdk/jfr/event/io/TestSocketChannelEvents.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, 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 -@@ -53,6 +53,7 @@ public class TestSocketChannelEvents { - private static final int bufSizeB = 20; - - private List expectedEvents = new ArrayList<>(); -+ - private synchronized void addExpectedEvent(IOEvent event) { - expectedEvents.add(event); - } -@@ -62,69 +63,70 @@ public class TestSocketChannelEvents { - } - - public void test() throws Throwable { -- Recording recording = new Recording(); -- -- try (ServerSocketChannel ss = ServerSocketChannel.open()) { -- recording.enable(IOEvent.EVENT_SOCKET_READ).withThreshold(Duration.ofMillis(0)); -- recording.enable(IOEvent.EVENT_SOCKET_WRITE).withThreshold(Duration.ofMillis(0)); -- recording.start(); -- -- ss.socket().setReuseAddress(true); -- ss.socket().bind(null); -- -- TestThread readerThread = new TestThread(new XRun() { -- @Override -- public void xrun() throws IOException { -- ByteBuffer bufA = ByteBuffer.allocate(bufSizeA); -- ByteBuffer bufB = ByteBuffer.allocate(bufSizeB); -- try (SocketChannel sc = ss.accept()) { -- int readSize = sc.read(bufA); -- assertEquals(readSize, bufSizeA, "Wrong readSize bufA"); -- addExpectedEvent(IOEvent.createSocketReadEvent(bufSizeA, sc.socket())); -- -- bufA.clear(); -- bufA.limit(1); -- readSize = (int)sc.read(new ByteBuffer[] { bufA, bufB }); -- assertEquals(readSize, 1 + bufSizeB, "Wrong readSize 1+bufB"); -- addExpectedEvent(IOEvent.createSocketReadEvent(readSize, sc.socket())); -- -- // We try to read, but client have closed. Should get EOF. -- bufA.clear(); -- bufA.limit(1); -- readSize = sc.read(bufA); -- assertEquals(readSize, -1, "Wrong readSize at EOF"); -- addExpectedEvent(IOEvent.createSocketReadEvent(-1, sc.socket())); -+ try (Recording recording = new Recording()) { -+ try (ServerSocketChannel ss = ServerSocketChannel.open()) { -+ recording.enable(IOEvent.EVENT_SOCKET_READ).withThreshold(Duration.ofMillis(0)); -+ recording.enable(IOEvent.EVENT_SOCKET_WRITE).withThreshold(Duration.ofMillis(0)); -+ recording.start(); -+ -+ ss.socket().setReuseAddress(true); -+ ss.socket().bind(null); -+ -+ TestThread readerThread = new TestThread(new XRun() { -+ @Override -+ public void xrun() throws IOException { -+ ByteBuffer bufA = ByteBuffer.allocate(bufSizeA); -+ ByteBuffer bufB = ByteBuffer.allocate(bufSizeB); -+ try (SocketChannel sc = ss.accept()) { -+ int readSize = sc.read(bufA); -+ assertEquals(readSize, bufSizeA, "Wrong readSize bufA"); -+ addExpectedEvent(IOEvent.createSocketReadEvent(bufSizeA, sc.socket())); -+ -+ bufA.clear(); -+ bufA.limit(1); -+ readSize = (int) sc.read(new ByteBuffer[] { bufA, bufB }); -+ assertEquals(readSize, 1 + bufSizeB, "Wrong readSize 1+bufB"); -+ addExpectedEvent(IOEvent.createSocketReadEvent(readSize, sc.socket())); -+ -+ // We try to read, but client have closed. Should -+ // get EOF. -+ bufA.clear(); -+ bufA.limit(1); -+ readSize = sc.read(bufA); -+ assertEquals(readSize, -1, "Wrong readSize at EOF"); -+ addExpectedEvent(IOEvent.createSocketReadEvent(-1, sc.socket())); -+ } - } -- } -- }); -- readerThread.start(); -- -- try (SocketChannel sc = SocketChannel.open(ss.socket().getLocalSocketAddress())) { -- ByteBuffer bufA = ByteBuffer.allocateDirect(bufSizeA); -- ByteBuffer bufB = ByteBuffer.allocateDirect(bufSizeB); -- for (int i = 0; i < bufSizeA; ++i) { -- bufA.put((byte)('a' + (i % 20))); -- } -- for (int i = 0; i < bufSizeB; ++i) { -- bufB.put((byte)('A' + (i % 20))); -- } -- bufA.flip(); -- bufB.flip(); -+ }); -+ readerThread.start(); -+ -+ try (SocketChannel sc = SocketChannel.open(ss.socket().getLocalSocketAddress())) { -+ ByteBuffer bufA = ByteBuffer.allocateDirect(bufSizeA); -+ ByteBuffer bufB = ByteBuffer.allocateDirect(bufSizeB); -+ for (int i = 0; i < bufSizeA; ++i) { -+ bufA.put((byte) ('a' + (i % 20))); -+ } -+ for (int i = 0; i < bufSizeB; ++i) { -+ bufB.put((byte) ('A' + (i % 20))); -+ } -+ bufA.flip(); -+ bufB.flip(); - -- sc.write(bufA); -- addExpectedEvent(IOEvent.createSocketWriteEvent(bufSizeA, sc.socket())); -+ sc.write(bufA); -+ addExpectedEvent(IOEvent.createSocketWriteEvent(bufSizeA, sc.socket())); - -- bufA.clear(); -- bufA.limit(1); -- int bytesWritten = (int)sc.write(new ByteBuffer[] { bufA, bufB }); -- assertEquals(bytesWritten, 1 + bufSizeB, "Wrong bytesWritten 1+bufB"); -- addExpectedEvent(IOEvent.createSocketWriteEvent(bytesWritten, sc.socket())); -- } -+ bufA.clear(); -+ bufA.limit(1); -+ int bytesWritten = (int) sc.write(new ByteBuffer[] { bufA, bufB }); -+ assertEquals(bytesWritten, 1 + bufSizeB, "Wrong bytesWritten 1+bufB"); -+ addExpectedEvent(IOEvent.createSocketWriteEvent(bytesWritten, sc.socket())); -+ } - -- readerThread.joinAndThrow(); -- recording.stop(); -- List events= Events.fromRecording(recording); -- IOHelper.verifyEquals(events, expectedEvents); -+ readerThread.joinAndThrow(); -+ recording.stop(); -+ List events = Events.fromRecording(recording); -+ IOHelper.verifyEquals(events, expectedEvents); -+ } - } - } - } -diff --git a/jdk/test/jdk/jfr/event/io/TestSocketEvents.java b/jdk/test/jdk/jfr/event/io/TestSocketEvents.java -index c0b64aa7d..5b544cc7e 100644 ---- a/jdk/test/jdk/jfr/event/io/TestSocketEvents.java -+++ b/jdk/test/jdk/jfr/event/io/TestSocketEvents.java -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, 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 -@@ -55,6 +55,7 @@ public class TestSocketEvents { - private static final byte[] writeBuf = { 'B', 'C', 'D', 'E' }; - - private List expectedEvents = new ArrayList<>(); -+ - private synchronized void addExpectedEvent(IOEvent event) { - expectedEvents.add(event); - } -@@ -64,58 +65,59 @@ public class TestSocketEvents { - } - - private void test() throws Throwable { -- Recording recording = new Recording(); -- -- try (ServerSocket ss = new ServerSocket()) { -- recording.enable(IOEvent.EVENT_SOCKET_READ).withThreshold(Duration.ofMillis(0)); -- recording.enable(IOEvent.EVENT_SOCKET_WRITE).withThreshold(Duration.ofMillis(0)); -- recording.start(); -- -- ss.setReuseAddress(true); -- ss.bind(null); -- -- TestThread readerThread = new TestThread(new XRun() { -- @Override -- public void xrun() throws IOException { -- byte[] bs = new byte[4]; -- try (Socket s = ss.accept(); InputStream is = s.getInputStream()) { -- int readInt = is.read(); -- assertEquals(readInt, writeInt, "Wrong readInt"); -- addExpectedEvent(IOEvent.createSocketReadEvent(1, s)); -- -- int bytesRead = is.read(bs, 0, 3); -- assertEquals(bytesRead, 3, "Wrong bytesRead partial buffer"); -- addExpectedEvent(IOEvent.createSocketReadEvent(bytesRead, s)); -- -- bytesRead = is.read(bs); -- assertEquals(bytesRead, writeBuf.length, "Wrong bytesRead full buffer"); -- addExpectedEvent(IOEvent.createSocketReadEvent(bytesRead, s)); -- -- // Try to read more, but writer have closed. Should get EOF. -- readInt = is.read(); -- assertEquals(readInt, -1, "Wrong readInt at EOF"); -- addExpectedEvent(IOEvent.createSocketReadEvent(-1, s)); -- } -- } -- }); -- readerThread.start(); -- -- try (Socket s = new Socket()) { -- s.connect(ss.getLocalSocketAddress()); -- try (OutputStream os = s.getOutputStream()) { -- os.write(writeInt); -- addExpectedEvent(IOEvent.createSocketWriteEvent(1, s)); -- os.write(writeBuf, 0, 3); -- addExpectedEvent(IOEvent.createSocketWriteEvent(3, s)); -- os.write(writeBuf); -- addExpectedEvent(IOEvent.createSocketWriteEvent(writeBuf.length, s)); -+ try (Recording recording = new Recording()) { -+ try (ServerSocket ss = new ServerSocket()) { -+ recording.enable(IOEvent.EVENT_SOCKET_READ).withThreshold(Duration.ofMillis(0)); -+ recording.enable(IOEvent.EVENT_SOCKET_WRITE).withThreshold(Duration.ofMillis(0)); -+ recording.start(); -+ -+ ss.setReuseAddress(true); -+ ss.bind(null); -+ -+ TestThread readerThread = new TestThread(new XRun() { -+ @Override -+ public void xrun() throws IOException { -+ byte[] bs = new byte[4]; -+ try (Socket s = ss.accept(); InputStream is = s.getInputStream()) { -+ int readInt = is.read(); -+ assertEquals(readInt, writeInt, "Wrong readInt"); -+ addExpectedEvent(IOEvent.createSocketReadEvent(1, s)); -+ -+ int bytesRead = is.read(bs, 0, 3); -+ assertEquals(bytesRead, 3, "Wrong bytesRead partial buffer"); -+ addExpectedEvent(IOEvent.createSocketReadEvent(bytesRead, s)); -+ -+ bytesRead = is.read(bs); -+ assertEquals(bytesRead, writeBuf.length, "Wrong bytesRead full buffer"); -+ addExpectedEvent(IOEvent.createSocketReadEvent(bytesRead, s)); -+ -+ // Try to read more, but writer have closed. Should -+ // get EOF. -+ readInt = is.read(); -+ assertEquals(readInt, -1, "Wrong readInt at EOF"); -+ addExpectedEvent(IOEvent.createSocketReadEvent(-1, s)); -+ } -+ } -+ }); -+ readerThread.start(); -+ -+ try (Socket s = new Socket()) { -+ s.connect(ss.getLocalSocketAddress()); -+ try (OutputStream os = s.getOutputStream()) { -+ os.write(writeInt); -+ addExpectedEvent(IOEvent.createSocketWriteEvent(1, s)); -+ os.write(writeBuf, 0, 3); -+ addExpectedEvent(IOEvent.createSocketWriteEvent(3, s)); -+ os.write(writeBuf); -+ addExpectedEvent(IOEvent.createSocketWriteEvent(writeBuf.length, s)); -+ } - } -- } - -- readerThread.joinAndThrow(); -- recording.stop(); -- List events = Events.fromRecording(recording); -- IOHelper.verifyEquals(events, expectedEvents); -+ readerThread.joinAndThrow(); -+ recording.stop(); -+ List events = Events.fromRecording(recording); -+ IOHelper.verifyEquals(events, expectedEvents); -+ } - } - } - } --- -2.22.0 - diff --git a/8268819-SA-Remove-libthread_db-dependency-on-Linux.patch b/8268819-SA-Remove-libthread_db-dependency-on-Linux.patch index 2cb61f57d04001bc03d00bcdde983d44da21ecd9..d2d7530d28640879516f4cf7dfdc1ccc288f1855 100644 --- a/8268819-SA-Remove-libthread_db-dependency-on-Linux.patch +++ b/8268819-SA-Remove-libthread_db-dependency-on-Linux.patch @@ -314,23 +314,16 @@ index 802e5b0bb..a8e0c2a5c 100644 - #endif /* _PROC_SERVICE_H_ */ diff --git a/hotspot/agent/src/os/linux/ps_core.c b/hotspot/agent/src/os/linux/ps_core.c -index b7fe4c095..6da43f195 100644 +index 6fb8c940..5728bcc4 100644 --- a/hotspot/agent/src/os/linux/ps_core.c +++ b/hotspot/agent/src/os/linux/ps_core.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2003, 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 @@ -31,6 +31,7 @@ #include #include #include "libproc_impl.h" +#include "proc_service.h" #include "salibelf.h" - + // This file has the libproc implementation to read core files. @@ -546,8 +547,7 @@ static bool core_handle_prstatus(struct ps_prochandle* ph, const char* buf, size prstatus_t* prstat = (prstatus_t*) buf; @@ -338,9 +331,9 @@ index b7fe4c095..6da43f195 100644 print_debug("got integer regset for lwp %d\n", prstat->pr_pid); - // we set pthread_t to -1 for core dump - if((newthr = add_thread_info(ph, (pthread_t) -1, prstat->pr_pid)) == NULL) -+ if((newthr = add_thread_info(ph, prstat->pr_pid)) == NULL) ++ if((newthr = add_thread_info(ph, prstat->pr_pid)) == NULL) return false; - + // copy regs diff --git a/hotspot/agent/src/os/linux/ps_proc.c b/hotspot/agent/src/os/linux/ps_proc.c index c4d6a9ecc..748cc1397 100644 diff --git a/debuginfo.diz-should-not-contain-the-path-after-unzip.patch b/debuginfo.diz-should-not-contain-the-path-after-unzip.patch deleted file mode 100755 index 1f49d5f7761b0de3ef03d69f94a126e675408603..0000000000000000000000000000000000000000 --- a/debuginfo.diz-should-not-contain-the-path-after-unzip.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk -index 0e0346374..2d9bdbeed 100644 ---- a/make/common/NativeCompilation.gmk -+++ b/make/common/NativeCompilation.gmk -@@ -537,7 +537,7 @@ define SetupNativeCompilation - # to be rebuilt properly. - $$($1_DEBUGINFO_ZIP): $$($1_DEBUGINFO_FILES) $$($1_TARGET) - $(CD) $$($1_OBJECT_DIR) \ -- && $(ZIP) -q $$@ $$($1_DEBUGINFO_FILES) -+ && $(ZIP) -q $$@ $$(subst $$($1_OBJECT_DIR)/,,$$($1_DEBUGINFO_FILES)) - endif - else - ifneq ($$($1_STRIP_POLICY), no_strip) --- -2.22.0 - diff --git a/fix-log-bug-enhance-aes-hmac-performance.patch b/fix-log-bug-enhance-aes-hmac-performance.patch index 48da9a117e036e931e20ab491019986206550437..6f42559b23943815edc84ecea5f6e3e1b93d3310 100644 --- a/fix-log-bug-enhance-aes-hmac-performance.patch +++ b/fix-log-bug-enhance-aes-hmac-performance.patch @@ -17,38 +17,10 @@ Signed-off-by: He Dongbo create mode 100644 jdk/test/micro/org/openeuler/bench/security/openssl/HMacBenchmark.java diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh -index 60298422f..bdfdd207b 100644 +index 27cff542..d19c772e 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh -@@ -4288,7 +4288,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++" - - ################################################################################ - # The order of these defines the priority by which we try to find them. --VALID_VS_VERSIONS="2010 2012 2013 2015 2017" -+VALID_VS_VERSIONS="2010 2012 2013 2015 2017 2019" - - VS_DESCRIPTION_2010="Microsoft Visual Studio 2010" - VS_VERSION_INTERNAL_2010=100 -@@ -4346,6 +4346,18 @@ VS_SDK_INSTALLDIR_2017= - VS_VS_PLATFORM_NAME_2017="v141" - VS_SDK_PLATFORM_NAME_2017= - -+VS_DESCRIPTION_2019="Microsoft Visual Studio 2019 - CURRENTLY NOT WORKING" -+VS_VERSION_INTERNAL_2019=141 -+VS_MSVCR_2019=vcruntime140.dll -+VS_MSVCP_2019=msvcp140.dll -+VS_ENVVAR_2019="VS150COMNTOOLS" -+VS_USE_UCRT_2019="true" -+VS_VS_INSTALLDIR_2019="Microsoft Visual Studio/2019" -+VS_EDITIONS_2019="Community Professional Enterprise" -+VS_SDK_INSTALLDIR_2019= -+VS_VS_PLATFORM_NAME_2019="v141" -+VS_SDK_PLATFORM_NAME_2019= -+ - ################################################################################ - - -@@ -25694,10 +25706,10 @@ $as_echo "$as_me: Valid Visual Studio versions: $VALID_VS_VERSIONS." >&6;} +@@ -25937,10 +25937,10 @@ $as_echo "$as_me: Valid Visual Studio versions: $VALID_VS_VERSIONS." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 $as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then @@ -61,7 +33,7 @@ index 60298422f..bdfdd207b 100644 fi for VCVARSFILE in $VCVARSFILES; do -@@ -25751,10 +25763,10 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal +@@ -25994,10 +25994,10 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 $as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then @@ -74,7 +46,7 @@ index 60298422f..bdfdd207b 100644 fi for VCVARSFILE in $VCVARSFILES; do -@@ -25790,8 +25802,6 @@ $as_echo "$as_me: directory within the Visual Studio installation" >&6;} +@@ -26033,8 +26033,6 @@ $as_echo "$as_me: directory within the Visual Studio installation" >&6;} fi fi @@ -83,7 +55,7 @@ index 60298422f..bdfdd207b 100644 if test "x$VS_COMNTOOLS" != x; then if test "x$VS_ENV_CMD" = x; then -@@ -25824,10 +25834,10 @@ $as_echo "$as_me: directory within the Visual Studio installation" >&6;} +@@ -26067,10 +26065,10 @@ $as_echo "$as_me: directory within the Visual Studio installation" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 $as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then @@ -96,7 +68,7 @@ index 60298422f..bdfdd207b 100644 fi for VCVARSFILE in $VCVARSFILES; do -@@ -25883,10 +25893,10 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal +@@ -26126,10 +26124,10 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 $as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then @@ -109,7 +81,7 @@ index 60298422f..bdfdd207b 100644 fi for VCVARSFILE in $VCVARSFILES; do -@@ -25944,10 +25954,10 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal +@@ -26187,10 +26185,10 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 $as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then @@ -122,7 +94,7 @@ index 60298422f..bdfdd207b 100644 fi for VCVARSFILE in $VCVARSFILES; do -@@ -26002,10 +26012,10 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal +@@ -26245,10 +26243,10 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 $as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then @@ -135,7 +107,7 @@ index 60298422f..bdfdd207b 100644 fi for VCVARSFILE in $VCVARSFILES; do -@@ -26059,10 +26069,10 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal +@@ -26302,10 +26300,10 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 $as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then @@ -149,38 +121,10 @@ index 60298422f..bdfdd207b 100644 for VCVARSFILE in $VCVARSFILES; do diff --git a/common/autoconf/toolchain_windows.m4 b/common/autoconf/toolchain_windows.m4 -index a78f9ac66..0b5efdad2 100644 +index 9e617c33..f024da1e 100644 --- a/common/autoconf/toolchain_windows.m4 +++ b/common/autoconf/toolchain_windows.m4 -@@ -25,7 +25,7 @@ - - ################################################################################ - # The order of these defines the priority by which we try to find them. --VALID_VS_VERSIONS="2010 2012 2013 2015 2017" -+VALID_VS_VERSIONS="2010 2012 2013 2015 2017 2019" - - VS_DESCRIPTION_2010="Microsoft Visual Studio 2010" - VS_VERSION_INTERNAL_2010=100 -@@ -83,6 +83,18 @@ VS_SDK_INSTALLDIR_2017= - VS_VS_PLATFORM_NAME_2017="v141" - VS_SDK_PLATFORM_NAME_2017= - -+VS_DESCRIPTION_2019="Microsoft Visual Studio 2019 - CURRENTLY NOT WORKING" -+VS_VERSION_INTERNAL_2019=141 -+VS_MSVCR_2019=vcruntime140.dll -+VS_MSVCP_2019=msvcp140.dll -+VS_ENVVAR_2019="VS150COMNTOOLS" -+VS_USE_UCRT_2019="true" -+VS_VS_INSTALLDIR_2019="Microsoft Visual Studio/2019" -+VS_EDITIONS_2019="Community Professional Enterprise" -+VS_SDK_INSTALLDIR_2019= -+VS_VS_PLATFORM_NAME_2019="v141" -+VS_SDK_PLATFORM_NAME_2019= -+ - ################################################################################ - - AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT], -@@ -107,10 +119,10 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT], +@@ -121,10 +121,10 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT], if test -d "$VS_BASE"; then AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD]) if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then @@ -193,7 +137,7 @@ index a78f9ac66..0b5efdad2 100644 fi for VCVARSFILE in $VCVARSFILES; do -@@ -198,8 +210,6 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE], +@@ -212,8 +212,6 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE], fi fi diff --git a/fix-make-bugs-when-git-and-hg-not-exist.patch b/fix-make-bugs-when-git-and-hg-not-exist.patch deleted file mode 100644 index 61c8892b3057da8b981e6044c40ba6bafc2f17b1..0000000000000000000000000000000000000000 --- a/fix-make-bugs-when-git-and-hg-not-exist.patch +++ /dev/null @@ -1,27 +0,0 @@ -From a447db8644fe785db481a425fe3efa62cb11122f Mon Sep 17 00:00:00 2001 -Date: Mon, 25 Apr 2022 17:12:39 +0800 -Subject: [PATCH] Fix make bugs when git and hg not exist - ---- - make/common/MakeBase.gmk | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk -index 2ba3d04..c97a42a 100644 ---- a/make/common/MakeBase.gmk -+++ b/make/common/MakeBase.gmk -@@ -318,9 +318,9 @@ SCM_TIP_FILECMD := $(PRINTF) "$(SCM):%s" \ - # Emit the scm:id pair to $@ - define GetSourceTips - $(CD) $(SRC_ROOT) ; \ -- if [ -d $(SCM_DIR) -a "$(SCM_VERSION)" != "" ] ; then \ -+ if [ -d "$(SCM_DIR)" -a "$(SCM_VERSION)" != "" ] ; then \ - $(ID_COMMAND) >> $@ ; \ -- elif [ -f $(SCM_TIP_FILENAME) ] ; then \ -+ elif [ -f "$(SCM_TIP_FILENAME)" ] ; then \ - $(SCM_TIP_FILECMD) >> $@ ; \ - fi; - $(PRINTF) "\n" >> $@ --- -1.8.3.1 - diff --git a/jdk8u-jdk8u332-b09.tar.xz b/jdk8u-jdk8u342-b07.tar.xz similarity index 81% rename from jdk8u-jdk8u332-b09.tar.xz rename to jdk8u-jdk8u342-b07.tar.xz index 3e51ad8d51c90c7bbb1e5a5c5ecde2c6fc35aef5..1ec85bbd33f44e7bc8bc70455c82e2fc28d7e27d 100644 Binary files a/jdk8u-jdk8u332-b09.tar.xz and b/jdk8u-jdk8u342-b07.tar.xz differ diff --git a/openjdk-1.8.0.spec b/openjdk-1.8.0.spec index 37487c53b1c15e0e534a4131dba3da6984a344df..d847189bb59a0887ea4265cb75d803a6994b8f5d 100644 --- a/openjdk-1.8.0.spec +++ b/openjdk-1.8.0.spec @@ -152,13 +152,13 @@ %global origin_nice OpenJDK %global top_level_dir_name %{origin} %global repo jdk8u -%global revision jdk8u332-b09 +%global revision jdk8u342-b07 %global full_revision %{repo}-%{revision} # Define IcedTea version used for SystemTap tapsets and desktop files %global icedteaver 3.15.0 -%global updatever 332 -%global buildver b09 +%global updatever 342 +%global buildver b07 # priority must be 7 digits in total. The expression is workarounding tip %global priority 1800%{updatever} @@ -922,7 +922,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever}.%{buildver} -Release: 6 +Release: 0 # 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 @@ -999,7 +999,6 @@ Patch58: Reduce-the-probability-of-the-crash-related-to-ciObj.patch Patch62: 8165857.patch Patch63: 8033552.patch Patch67: 8165860.patch -Patch68: 8194154.patch Patch70: 8164948.patch # 8u242 @@ -1050,7 +1049,6 @@ Patch142: 8207160.patch Patch144: add-appcds-test-case.patch # 8u282 -Patch146: 8168926.patch Patch147: 8215047.patch Patch148: 8237894.patch Patch149: Remove-the-parentheses-around-company-name.patch @@ -1081,13 +1079,11 @@ Patch177: downgrade-symver-of-memcpy-GLIBC.patch Patch178: fix-log-bug-enhance-aes-hmac-performance.patch Patch179: keep-the-binary-equal.patch Patch180: link-option-use-rpath-instead-of-runpath.patch -Patch181: remove-gnu-debuglink-when-using-enable-debug-.patch Patch183: revert-windows-bugfix.patch Patch184: set-vm.vendor-by-configure.patch Patch185: update-cacerts-and-VerifyCACerts.java-test.patch Patch186: update-to-keep-same-with-master.patch Patch188: 8247691_incorrect_handling_of_VM_exceptions_in_C1_deopt_stub.patch -Patch189: 8266187_Memory_leak_in_appendBootClassPath.patch Patch192: add_kae_implementation_add_default_conf_file.patch Patch193: improve_algorithmConstraints_checkAlgorithm_performance.patch Patch194: modify_the_default_iteration_time_and_forks_in_the_JMH_of_KAEProvider.patch @@ -1111,7 +1107,6 @@ Patch212: enhance-the-TimeZone-s-path-solution-on-Euler.patch Patch214: fix-appcds-s-option-AppCDSLockFile.patch Patch215: PS-introduce-UsePSRelaxedForwardee-to-enable-using-r.patch Patch216: Parallel-Full-GC-for-G1.patch -Patch217: 8202142-jfr-event-io-TestInstrumentation-is-unstable.patch Patch218: 8143251-Thread-suspend-on-VM_G1IncCollectionPause-do.patch Patch219: G1Uncommit-Introduce-G1PeriodGCNotRetry-control-whet.patch Patch220: JDK-debug-version-crash-when-using-AppCDS.patch @@ -1127,7 +1122,6 @@ Patch229: downgrade-the-symver-of-fcntl64.patch # 8u322 Patch230: add-system-property-swing.JComboBox.useLegacyMode.patch -Patch231: debuginfo.diz-should-not-contain-the-path-after-unzip.patch Patch232: 8173361-various-crashes-in-JvmtiExport-post_compiled.patch Patch233: fix-TestUseCompressedOopsErgo-run-failed.patch Patch235: fix-testme-Test6929067-run-faild.patch @@ -1139,7 +1133,6 @@ Patch240: 8207011-Remove-uses-of-the-register-storage-class-specifier.patch Patch241: 8268819-SA-Remove-libthread_db-dependency-on-Linux.patch # 8u332 -Patch242: fix-make-bugs-when-git-and-hg-not-exist.patch 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 @@ -1147,6 +1140,8 @@ Patch246: 7092821-java.security.Provider.getService-is-synchro.patch Patch247: 8173339-AArch64-Fix-minimum-stack-size-computations.patch Patch248: 8067941-TESTBUG-Fix-tests-for-OS-with-64K-page-size.patch +# 8u342 + ############################################# # # Upstreamable patches @@ -1504,7 +1499,6 @@ pushd %{top_level_dir_name} %patch62 -p1 %patch63 -p1 %patch67 -p1 -%patch68 -p1 %patch70 -p1 %patch75 -p1 %patch83 -p1 @@ -1543,7 +1537,6 @@ pushd %{top_level_dir_name} %patch141 -p1 %patch142 -p1 %patch144 -p1 -%patch146 -p1 %patch147 -p1 %patch148 -p1 %patch149 -p1 @@ -1572,13 +1565,11 @@ pushd %{top_level_dir_name} %patch178 -p1 %patch179 -p1 %patch180 -p1 -%patch181 -p1 %patch183 -p1 %patch184 -p1 %patch185 -p1 %patch186 -p1 %patch188 -p1 -%patch189 -p1 %patch192 -p1 %patch194 -p1 %patch195 -p1 @@ -1599,7 +1590,6 @@ pushd %{top_level_dir_name} %patch214 -p1 %patch215 -p1 %patch216 -p1 -%patch217 -p1 %patch218 -p1 %patch219 -p1 %patch220 -p1 @@ -1611,7 +1601,6 @@ pushd %{top_level_dir_name} %patch228 -p1 %patch229 -p1 %patch230 -p1 -%patch231 -p1 %patch232 -p1 %patch233 -p1 %patch235 -p1 @@ -1621,7 +1610,6 @@ pushd %{top_level_dir_name} %patch239 -p1 %patch240 -p1 %patch241 -p1 -%patch242 -p1 %patch243 -p1 %patch244 -p1 %patch245 -p1 @@ -2252,6 +2240,20 @@ cjc.mainProgram(arg) %endif %changelog +* Fri Jul 22 2022 kuenking111 - 1:1.8.0.342-b07.0 +- del 8168926.patch +- del 8194154.patch +- del 8202142-jfr-event-io-TestInstrumentation-is-unstable.patch +- del 8266187_Memory_leak_in_appendBootClassPath.patch +- del debuginfo.diz-should-not-contain-the-path-after-unzip.patch +- del fix-make-bugs-when-git-and-hg-not-exist.patch +- modified 7092821-java.security.Provider.getService-is-synchro.patch +- modified 8268819-SA-Remove-libthread_db-dependency-on-Linux.patch +- modified fix-log-bug-enhance-aes-hmac-performance.patch + +* Fri Jul 15 2022 kuenking111 - 1:1.8.0.332-b09.7 +- del remove-gnu-debuglink-when-using-enable-debug-.patch + * Mon Jul 4 2022 kuenking111 - 1:1.8.0.332-b09.6 - add 8067941-TESTBUG-Fix-tests-for-OS-with-64K-page-size.patch @@ -2261,7 +2263,7 @@ cjc.mainProgram(arg) * Mon Jul 4 2022 kuenking111 - 1:1.8.0.332-b09.4 - add 7092821-java.security.Provider.getService-is-synchro.patch -* Fri Jun 30 2022 kuenking111 - 1:1.8.0.332-b09.3 +* Thu Jun 30 2022 kuenking111 - 1:1.8.0.332-b09.3 - add change-sa-jdi.jar-make-file-for-BEP.PATCH * Thu Apr 28 2022 kuenking111 - 1:1.8.0.332-b09.2 @@ -2311,7 +2313,7 @@ cjc.mainProgram(arg) - deleted Delete-expired-certificate-globalsignr2ca.patch - deleted inline-optimize-for-aarch64.patch -* Wed Jan 05 2022 noah - 1:1.8.0.312-b07.11 +* Tue Jan 05 2021 noah - 1:1.8.0.312-b07.11 - adapted to newst cjc to fix issue with rpm 4.17 * Tue Dec 21 2021 kuenking111 - 1:1.8.0.312-b07.10 diff --git a/remove-gnu-debuglink-when-using-enable-debug-.patch b/remove-gnu-debuglink-when-using-enable-debug-.patch deleted file mode 100644 index 8d7ff6eb74a3d74bffdb2c935cb3df117a0f1d75..0000000000000000000000000000000000000000 --- a/remove-gnu-debuglink-when-using-enable-debug-.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 39774b66e6b962a89a02504f08c20b309f9eef1f Mon Sep 17 00:00:00 2001 -From: zhangyipeng -Date: Thu, 4 Mar 2021 10:10:30 +0800 -Subject: [PATCH] [Huawei]remove gnu debuglink when using enable debug - symbols - - - -Signed-off-by: Sun Jianye ---- - hotspot/make/linux/makefiles/jsig.make | 1 - - hotspot/make/linux/makefiles/saproc.make | 1 - - hotspot/make/linux/makefiles/vm.make | 1 - - make/common/NativeCompilation.gmk | 2 +- - 4 files changed, 1 insertion(+), 4 deletions(-) - -diff --git a/hotspot/make/linux/makefiles/jsig.make b/hotspot/make/linux/makefiles/jsig.make -index 6290db5af..9838a50aa 100644 ---- a/hotspot/make/linux/makefiles/jsig.make -+++ b/hotspot/make/linux/makefiles/jsig.make -@@ -63,7 +63,6 @@ $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE) - ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) - ifneq ($(STRIP_POLICY),no_strip) - $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO) -- $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@ - endif - ifeq ($(STRIP_POLICY),all_strip) - $(QUIETLY) $(STRIP) $@ -diff --git a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make -index ffc0ec5ce..dfeb254da 100644 ---- a/hotspot/make/linux/makefiles/saproc.make -+++ b/hotspot/make/linux/makefiles/saproc.make -@@ -107,7 +107,6 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) - ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) - ifneq ($(STRIP_POLICY),no_strip) - $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO) -- $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ - endif - ifeq ($(STRIP_POLICY),all_strip) - $(QUIETLY) $(STRIP) $@ -diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make -index 1985db071..408b0cc9d 100644 ---- a/hotspot/make/linux/makefiles/vm.make -+++ b/hotspot/make/linux/makefiles/vm.make -@@ -359,7 +359,6 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT) - ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) - ifneq ($(STRIP_POLICY),no_strip) - $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO) -- $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@ - endif - ifeq ($(STRIP_POLICY),all_strip) - $(QUIETLY) $(STRIP) $@ -diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk -index 9980e8ab9..4fa9f14cf 100644 ---- a/make/common/NativeCompilation.gmk -+++ b/make/common/NativeCompilation.gmk -@@ -487,7 +487,7 @@ define SetupNativeCompilation - $$($1_DEBUGINFO_FILES): $$($1_TARGET) - $(RM) $$@ - $(OBJCOPY) --only-keep-debug $$< $$@ -- $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< -+ $(CD) $$(@D) - $(TOUCH) $$@ - endif - else ifeq ($(OPENJDK_TARGET_OS), aix) --- -2.19.0 -