]> dgit.raspbian.org Git - openjdk-25.git/commitdiff
disable UnsafeGuard in Unsafe_SetMemory0 for i386
authorVladimir Petko <vladimir.petko@canonical.com>
Wed, 22 Jul 2026 00:23:02 +0000 (12:23 +1200)
committerVladimir Petko <vladimir.petko@canonical.com>
Wed, 22 Jul 2026 00:23:02 +0000 (12:23 +1200)
Bug: https://bugs.openjdk.org/browse/JDK-8335238
Forwarded: not-needed
Last-Update: 2024-07-01

x86 hotspot aseembler incorrectly returns next instruction's PC
for rep stos %eax,%es:(%edi) causing an infinite loop.
This patch removes UnsafeGuard for i386, so that VM crashes
instead of hanging indefinitely.
Patch should not be forwarded as it reverses JDK-8320886 for
i386.

Gbp-Pq: Name jdk-8335238-workaround.patch

src/hotspot/share/prims/unsafe.cpp

index a6300e81468b4028bf48445b7aec7acc43994444..d173b3fa7a9e5af080746bd8da23c53a040df4fe 100644 (file)
@@ -391,7 +391,9 @@ UNSAFE_ENTRY_SCOPED(void, Unsafe_SetMemory0(JNIEnv *env, jobject unsafe, jobject
   void* p = index_oop_from_field_offset_long(base, offset);
 
   {
+#if !defined(IA32) || !defined(TARGET_ARCH_x86)
     GuardUnsafeAccess guard(thread);
+#endif
     if (StubRoutines::unsafe_setmemory() != nullptr) {
       MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXExec, thread));
       StubRoutines::UnsafeSetMemory_stub()(p, sz, value);