[crac] RFR: Merge jdk:jdk-25+22

Dmitry Cherepanov dcherepanov at openjdk.org
Wed Jul 16 18:18:08 UTC 2025


Merge with jdk-25+22

Attaching output of `--diff-merges=remerge`

<details>

<summary>jdk-25+20</summary>


commit 28128cb4e515074ced2dfd4cd371bebe4cdc4dbc
Merge: 698225b6594 953eef4f113
Author: Dmitry Cherepanov <dcherepanov at azul.com>
Date:   Tue Jul 15 11:33:36 2025 +0400

    Merge with jdk-25+20

diff --git a/src/hotspot/cpu/x86/globals_x86.hpp b/src/hotspot/cpu/x86/globals_x86.hpp
remerge CONFLICT (content): Merge conflict in src/hotspot/cpu/x86/globals_x86.hpp
index 2d380144da1..103fde55fb3 100644
--- a/src/hotspot/cpu/x86/globals_x86.hpp
+++ b/src/hotspot/cpu/x86/globals_x86.hpp
@@ -192,7 +192,6 @@ define_pd_global(intx, InitArrayShortSize, 8*BytesPerLong);
              "Turn off JVM mitigations related to Intel micro code "        \
              "mitigations for the Intel JCC erratum")                       \
                                                                             \
-<<<<<<< 698225b6594 (Merge jdk:jdk-25+19)
   product(ccstr, CPUFeatures, nullptr, "CPU feature set, "                  \
       "use -XX:CPUFeatures=0xnumber with -XX:CRaCCheckpointTo when you "    \
       "get an error during -XX:CRaCRestoreFrom on a different machine; "    \
@@ -205,18 +204,16 @@ define_pd_global(intx, InitArrayShortSize, 8*BytesPerLong);
                                                                             \
   product(bool, IgnoreCPUFeatures, false, RESTORE_SETTABLE | EXPERIMENTAL,  \
       "Do not refuse to run after -XX:CRaCRestoreFrom finds out some "      \
-      "CPU features are missing")
-
-=======
+      "CPU features are missing")                                           \
+                                                                            \
   product(int, X86ICacheSync, -1, DIAGNOSTIC,                               \
              "Select the X86 ICache sync mechanism: -1 = auto-select; "     \
              "0 = none (dangerous); 1 = CLFLUSH loop; 2 = CLFLUSHOPT loop; "\
              "3 = CLWB loop; 4 = single CPUID; 5 = single SERIALIZE. "      \
              "Explicitly selected mechanism will fail at startup if "       \
              "hardware does not support it.")                               \
-             range(-1, 5)                                                   \
-                                                                            \
->>>>>>> 953eef4f113 (8347337: ZGC: String dedups short-lived strings)
+             range(-1, 5)
+
 // end of ARCH_FLAGS
 
 #endif // CPU_X86_GLOBALS_X86_HPP


</details>

Resolved conflicts with [JDK-8353558](https://bugs.openjdk.org/browse/JDK-8353558)


<details>

<summary>jdk-25+21</summary>


commit e1eb43d5964652ba568752f8e743624148c86da2
Merge: 28128cb4e51 e2ae50d877b
Author: Dmitry Cherepanov <dcherepanov at azul.com>
Date:   Tue Jul 15 12:09:36 2025 +0400

    Merge with jdk-25+21

diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp
remerge CONFLICT (content): Merge conflict in src/hotspot/cpu/x86/vm_version_x86.cpp
index d701b560b3c..df0a56956e8 100644
--- a/src/hotspot/cpu/x86/vm_version_x86.cpp
+++ b/src/hotspot/cpu/x86/vm_version_x86.cpp
@@ -1296,16 +1296,12 @@ void VM_Version::get_processor_features_hardware() {
   _supports_atomic_getset8 = true;
   _supports_atomic_getadd8 = true;
 
-<<<<<<< 28128cb4e51 (Merge with jdk-25+20)
   if (ShowCPUFeatures) {
     tty->print_cr("This machine's CPU features are: -XX:CPUFeatures=" UINT64_FORMAT_X "," UINT64_FORMAT_X, _features, _glibc_features);
   }
 }
 
 void VM_Version::get_processor_features_hotspot() {
-#ifdef _LP64
-=======
->>>>>>> e2ae50d877b (8355569: Some nsk/jdi tests can glean the "main" thread by using the ClassPrepareEvent for the debuggee main class)
   // OS should support SSE for x64 and hardware should support at least SSE2.
   if (!VM_Version::supports_sse2()) {
     if (!FLAG_IS_DEFAULT(CPUFeatures))
@@ -1529,13 +1525,9 @@ void VM_Version::get_processor_features_hotspot() {
               "(%u cores per cpu, %u threads per core) family %d model %d stepping %d microcode 0x%x",
               cores_per_cpu(), threads_per_core(),
               cpu_family(), _model, _stepping, os::cpu_microcode_revision());
-<<<<<<< 28128cb4e51 (Merge with jdk-25+20)
-  assert(res > 0, "not enough temporary space allocated");
-  insert_features_names(buf + res, sizeof(buf) - res);
-=======
+
   assert(cpu_info_size > 0, "not enough temporary space allocated");
-  insert_features_names(buf + cpu_info_size, sizeof(buf) - cpu_info_size, _features_names);
->>>>>>> e2ae50d877b (8355569: Some nsk/jdi tests can glean the "main" thread by using the ClassPrepareEvent for the debuggee main class)
+  insert_features_names(buf + cpu_info_size, sizeof(buf) - cpu_info_size);
 
   _cpu_info_string = os::strdup(buf);
 
@@ -2624,8 +2616,7 @@ void VM_Version::initialize() {
                                      g.generate_detect_virt());
   clear_apx_test_state_stub = CAST_TO_FN_PTR(clear_apx_test_state_t,
                                      g.clear_apx_test_state());
-<<<<<<< 28128cb4e51 (Merge with jdk-25+20)
-#endif
+
   assert(      _features == 0,       "_features should be zero at startup");
   assert(_glibc_features == 0, "_glibc_features should be zero at startup");
   get_processor_features_hardware();
@@ -2667,9 +2658,6 @@ void VM_Version::initialize() {
 #endif
 
   get_processor_features_hotspot();
-=======
-  get_processor_features();
->>>>>>> e2ae50d877b (8355569: Some nsk/jdi tests can glean the "main" thread by using the ClassPrepareEvent for the debuggee main class)
 
   Assembler::precompute_instructions();
 
diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp
remerge CONFLICT (content): Merge conflict in src/hotspot/os/linux/os_linux.cpp
index 1c43eef8fb3..8203b17ae72 100644
--- a/src/hotspot/os/linux/os_linux.cpp
+++ b/src/hotspot/os/linux/os_linux.cpp
@@ -214,13 +214,10 @@ typedef int (*malloc_info_func_t)(int options, FILE *stream);
 static malloc_info_func_t g_malloc_info = nullptr;
 #endif // __GLIBC__
 
-<<<<<<< 28128cb4e51 (Merge with jdk-25+20)
 static int cached_pid = 0;
 
 static int clock_tics_per_sec = 100;
 
-=======
->>>>>>> e2ae50d877b (8355569: Some nsk/jdi tests can glean the "main" thread by using the ClassPrepareEvent for the debuggee main class)
 // If the VM might have been created on the primordial thread, we need to resolve the
 // primordial thread stack bounds and check if the current thread might be the
 // primordial thread in places. If we know that the primordial thread is never used,
@@ -4399,12 +4396,9 @@ static void check_pax(void) {
 // this is called _before_ most of the global arguments have been parsed
 void os::init(void) {
   char dummy;   // used to get a guess on initial stack address
-<<<<<<< 28128cb4e51 (Merge with jdk-25+20)
   cached_pid = current_process_id();
 
   clock_tics_per_sec = checked_cast<int>(sysconf(_SC_CLK_TCK));
-=======
->>>>>>> e2ae50d877b (8355569: Some nsk/jdi tests can glean the "main" thread by using the ClassPrepareEvent for the debuggee main class)
   int sys_pg_size = checked_cast<int>(sysconf(_SC_PAGESIZE));
   if (sys_pg_size < 0) {
     fatal("os_linux.cpp: os::init: sysconf failed (%s)",
diff --git a/src/hotspot/os/posix/signals_posix.cpp b/src/hotspot/os/posix/signals_posix.cpp
remerge CONFLICT (content): Merge conflict in src/hotspot/os/posix/signals_posix.cpp
index 931c28c23a4..a0492af3918 100644
--- a/src/hotspot/os/posix/signals_posix.cpp
+++ b/src/hotspot/os/posix/signals_posix.cpp
@@ -147,13 +147,8 @@ class SavedSignalHandlers {
 };
 
 
-<<<<<<< 28128cb4e51 (Merge with jdk-25+20)
-debug_only(static bool signal_sets_initialized = false);
-static sigset_t unblocked_sigs, blocked_sigs, vm_sigs, preinstalled_sigs;
-=======
 DEBUG_ONLY(static bool signal_sets_initialized = false);
-static sigset_t unblocked_sigs, vm_sigs, preinstalled_sigs;
->>>>>>> e2ae50d877b (8355569: Some nsk/jdi tests can glean the "main" thread by using the ClassPrepareEvent for the debuggee main class)
+static sigset_t unblocked_sigs, blocked_sigs, vm_sigs, preinstalled_sigs;
 
 // Our own signal handlers should never ever get replaced by a third party one.
 //  To check that, and to aid with diagnostics, store a copy of the handler setup
@@ -1552,7 +1547,6 @@ static void signal_sets_init() {
   if (!ReduceSignalUsage) {
     sigaddset(&vm_sigs, BREAK_SIGNAL);
   }
-<<<<<<< 28128cb4e51 (Merge with jdk-25+20)
 
   sigemptyset(&blocked_sigs);
 // RESTORE_SIGNAL is used only on Linux, other platform don't send this
@@ -1568,10 +1562,7 @@ static void signal_sets_init() {
   }
 #endif
 
-  debug_only(signal_sets_initialized = true);
-=======
   DEBUG_ONLY(signal_sets_initialized = true);
->>>>>>> e2ae50d877b (8355569: Some nsk/jdi tests can glean the "main" thread by using the ClassPrepareEvent for the debuggee main class)
 }
 
 // These are signals that are unblocked while a thread is running Java.
diff --git a/src/hotspot/share/gc/z/zPageAllocator.cpp b/src/hotspot/share/gc/z/zPageAllocator.cpp
remerge CONFLICT (content): Merge conflict in src/hotspot/share/gc/z/zPageAllocator.cpp
index f109c8b91a9..37e271b43d9 100644
--- a/src/hotspot/share/gc/z/zPageAllocator.cpp
+++ b/src/hotspot/share/gc/z/zPageAllocator.cpp
@@ -2467,46 +2467,6 @@ void ZPageAllocator::print_cache_extended_on(outputStream* st) const {
 
   _lock.unlock();
 }
-<<<<<<< 28128cb4e51 (Merge with jdk-25+20)
-
-void ZPageAllocator::print_on_error(outputStream* st) const {
-  const bool locked = try_lock_on_error(&_lock);
-
-  if (!locked) {
-    st->print_cr("<Without lock>");
-  }
-
-  // Print information even though we have not successfully taken the lock.
-  // This is thread-safe, but may produce inconsistent results.
-  print_on_inner(st);
-
-  if (locked) {
-    _lock.unlock();
-  }
-}
-
-void ZPageAllocator::print_on_inner(outputStream* st) const {
-  // Print total usage
-  st->print("ZHeap");
-  st->fill_to(17);
-  st->print_cr("used %zuM, capacity %zuM, max capacity %zuM",
-               used() / M, capacity() / M, max_capacity() / M);
-
-  // Print per-partition
-
-  streamIndentor indentor(st, 1);
-
-  if (_partitions.count() == 1) {
-    // The summary printing is redundant if we only have one partition
-    _partitions.get(0).print_cache_on(st);
-    return;
-  }
-
-  ZPartitionConstIterator iter = partition_iterator();
-  for (const ZPartition* partition; iter.next(&partition);) {
-    partition->print_on(st);
-  }
-}
 
 void ZPageAllocator::uncommit_unused_memory() {
   uint64_t timeout;
@@ -2526,5 +2486,3 @@ void ZPageAllocator::uncommit_unused_memory() {
     event.commit(uncommitted);
   }
 }
-=======
->>>>>>> e2ae50d877b (8355569: Some nsk/jdi tests can glean the "main" thread by using the ClassPrepareEvent for the debuggee main class)
diff --git a/src/hotspot/share/gc/z/zPageAllocator.hpp b/src/hotspot/share/gc/z/zPageAllocator.hpp
remerge CONFLICT (content): Merge conflict in src/hotspot/share/gc/z/zPageAllocator.hpp
index 1dc0ba22f0e..02da4daae2d 100644
--- a/src/hotspot/share/gc/z/zPageAllocator.hpp
+++ b/src/hotspot/share/gc/z/zPageAllocator.hpp
@@ -283,18 +283,12 @@ class ZPageAllocator {
 
   void threads_do(ThreadClosure* tc) const;
 
-<<<<<<< 28128cb4e51 (Merge with jdk-25+20)
-  void print_on(outputStream* st) const;
-  void print_extended_on_error(outputStream* st) const;
-  void print_on_error(outputStream* st) const;
-
   void uncommit_unused_memory();
-=======
+
   void print_usage_on(outputStream* st) const;
   void print_total_usage_on(outputStream* st) const;
   void print_partition_usage_on(outputStream* st) const;
   void print_cache_extended_on(outputStream* st) const;
->>>>>>> e2ae50d877b (8355569: Some nsk/jdi tests can glean the "main" thread by using the ClassPrepareEvent for the debuggee main class)
 };
 
 class ZPageAllocatorStats {
diff --git a/src/hotspot/share/runtime/abstract_vm_version.hpp b/src/hotspot/share/runtime/abstract_vm_version.hpp
remerge CONFLICT (content): Merge conflict in src/hotspot/share/runtime/abstract_vm_version.hpp
index 9e4d8f7e2fd..addd7b4e314 100644
--- a/src/hotspot/share/runtime/abstract_vm_version.hpp
+++ b/src/hotspot/share/runtime/abstract_vm_version.hpp
@@ -131,14 +131,12 @@ class Abstract_VM_Version: AllStatic {
 
   static uint64_t features()           { return _features; }
   static const char* features_string() { return _features_string; }
-<<<<<<< 28128cb4e51 (Merge with jdk-25+20)
-=======
+
   static const char* cpu_info_string() { return _cpu_info_string; }
   static void insert_features_names(char* buf, size_t buflen, const char* features_names[]);
   static const char* extract_features_string(const char* cpu_info_string,
                                              size_t cpu_info_string_len,
                                              size_t features_offset);
->>>>>>> e2ae50d877b (8355569: Some nsk/jdi tests can glean the "main" thread by using the ClassPrepareEvent for the debuggee main class)
 
   static VirtualizationType get_detected_virtualization() {
     return _detected_virtualization;


</details>

Resolved conflicts with [JDK-8353786](https://bugs.openjdk.org/browse/JDK-8353786), [JDK-8354362](https://bugs.openjdk.org/browse/JDK-8354362) and [JDK-8355473](https://bugs.openjdk.org/browse/JDK-8355473)


<details>

<summary>jdk-25+22</summary>


commit 99eb6eacea6888e7da5b3de485586d50c6301376 (HEAD -> merge-jdk, dmitry-crac/merge-jdk)
Merge: e1eb43d5964 52a5583d691
Author: Dmitry Cherepanov <dcherepanov at azul.com>
Date:   Tue Jul 15 22:13:09 2025 +0400

    Merge with jdk-25+22

diff --git a/src/java.base/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java b/src/java.base/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java
remerge CONFLICT (content): Merge conflict in src/java.base/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java
index 5404932c145..5865e75d35e 100644
--- a/src/java.base/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java
+++ b/src/java.base/share/classes/sun/nio/ch/AsynchronousServerSocketChannelImpl.java
@@ -75,8 +75,7 @@ abstract class AsynchronousServerSocketChannelImpl
 
     AsynchronousServerSocketChannelImpl(AsynchronousChannelGroupImpl group) {
         super(group.provider());
-<<<<<<< e1eb43d5964 (Merge with jdk-25+21)
-        this.fd = Net.serverSocket(true);
+        this.fd = Net.serverSocket();
         this.resource = new JDKSocketResource(this) {
             @Override
             protected FileDescriptor getFD() {
@@ -105,7 +104,7 @@ protected void closeBeforeCheckpoint() throws IOException {
 
             @Override
             protected void reopenAfterRestore() throws IOException {
-                FileDescriptor newfd = Net.serverSocket(true);
+                FileDescriptor newfd = Net.serverSocket();
                 IOUtil.setfdVal(fd, IOUtil.fdVal(newfd));
                 reopen();
                 synchronized (stateLock) {
@@ -117,9 +116,6 @@ protected void reopenAfterRestore() throws IOException {
                 }
             }
         };
-=======
-        this.fd = Net.serverSocket();
->>>>>>> 52a5583d691 (8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException)
     }
 
     @Override
diff --git a/src/java.base/share/classes/sun/nio/ch/NioSocketImpl.java b/src/java.base/share/classes/sun/nio/ch/NioSocketImpl.java
remerge CONFLICT (content): Merge conflict in src/java.base/share/classes/sun/nio/ch/NioSocketImpl.java
index 4741b3e653b..db2fa94f209 100644
--- a/src/java.base/share/classes/sun/nio/ch/NioSocketImpl.java
+++ b/src/java.base/share/classes/sun/nio/ch/NioSocketImpl.java
@@ -462,8 +462,8 @@ public void reopenAfterRestore() throws IOException {
         }
         synchronized (stateLock) {
             FileDescriptor fd;
-            fd = Net.serverSocket(true);
-            Runnable closer = closerFor(fd, true);
+            fd = Net.serverSocket();
+            Runnable closer = closerFor(fd);
             IOUtil.setfdVal(NioSocketImpl.this.fd, IOUtil.fdVal(fd));
             NioSocketImpl.this.cleaner = CleanerFactory.cleaner().register(NioSocketImpl.this, closer);
             state = ST_UNCONNECTED;
@@ -1220,27 +1220,7 @@ protected void sendUrgentData(int data) throws IOException {
     /**
      * Returns an action to close the given file descriptor.
      */
-<<<<<<< e1eb43d5964 (Merge with jdk-25+21)
-    private static Runnable closerFor0(FileDescriptor fd, boolean stream) {
-        if (stream) {
-            return () -> {
-                try {
-                    nd.close(fd);
-                } catch (IOException ioe) {
-                    throw new UncheckedIOException(ioe);
-                }
-            };
-        } else {
-            return () -> {
-                try {
-                    nd.close(fd);
-                } catch (IOException ioe) {
-                    throw new UncheckedIOException(ioe);
-                }
-            };
-        }
-=======
-    private static Runnable closerFor(FileDescriptor fd) {
+    private static Runnable closerFor0(FileDescriptor fd) {
         return () -> {
             try {
                 nd.close(fd);
@@ -1248,10 +1228,9 @@ private static Runnable closerFor(FileDescriptor fd) {
                 throw new UncheckedIOException(ioe);
             }
         };
->>>>>>> 52a5583d691 (8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException)
     }
 
-    private static Runnable closerFor(FileDescriptor fd, boolean stream) {
+    private static Runnable closerFor(FileDescriptor fd) {
 
         // FIXME ensure FileDispatcherImpl's Resource is registered before the closer is used,
         // otherwise the closer during beforeCheckpoint may be the first one to access
@@ -1262,7 +1241,7 @@ private static Runnable closerFor(FileDescriptor fd, boolean stream) {
             throw new RuntimeException(e);
         }
 
-        return closerFor0(fd, stream);
+        return closerFor0(fd);
     }
 
     /**
diff --git a/src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java b/src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java
index 27133138aaa..ceff0b1872d 100644
--- a/src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java
+++ b/src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java
@@ -772,7 +772,7 @@ protected void reopenAfterRestore() throws IOException {
             if (family == UNIX) {
                 newFd = UnixDomainSockets.socket();
             } else {
-                newFd = Net.serverSocket(family, true);
+                newFd = Net.serverSocket(family);
             }
             // We could avoid making fdVal non-final and dup2(...) to the original
             // value but that could accidentally conflict with another FD created


</details>

Resolved conflicts with [JDK-8356154](https://bugs.openjdk.org/browse/JDK-8356154)

-------------

Commit messages:
 - Merge with jdk-25+22
 - 8356154: Respecify java.net.Socket constructors that allow creating UDP sockets to throw IllegalArgumentException
 - 8356407: Part of class verification is skipped in AOT training run
 - 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer
 - 8244533: Configure should abort on missing short names in Windows
 - 8356126: Duplication handling and optimization of CaptureCallState
 - 8332934: Do loop with continue with subsequent switch leads to incorrect stack maps
 - 8354461: Update tests to disable streaming output for attach tools
 - 8351313: VM crashes when AOTMode/AOTCache/AOTConfiguration are empty
 - 8356318: Unexpected VerifyError in AOT training run
 - ... and 359 more: https://git.openjdk.org/crac/compare/698225b6...99eb6eac

The webrevs contain the adjustments done while merging with regards to each parent branch:
 - crac: https://webrevs.openjdk.org/?repo=crac&pr=244&range=00.0
 - jdk:jdk-25+22: https://webrevs.openjdk.org/?repo=crac&pr=244&range=00.1

Changes: https://git.openjdk.org/crac/pull/244/files
  Stats: 85715 lines in 2189 files changed: 63539 ins; 13639 del; 8537 mod
  Patch: https://git.openjdk.org/crac/pull/244.diff
  Fetch: git fetch https://git.openjdk.org/crac.git pull/244/head:pull/244

PR: https://git.openjdk.org/crac/pull/244


More information about the crac-dev mailing list