From: Vladimir Petko Date: Wed, 22 Jul 2026 00:23:02 +0000 (+1200) Subject: disable UnsafeGuard in Unsafe_SetMemory0 for i386 X-Git-Tag: archive/raspbian/25.0.5_7ea-1+rpi1~3^2~9 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=14bd22a50d0562d6da7d86ff5e24b9a74b16eb80;p=openjdk-25.git disable UnsafeGuard in Unsafe_SetMemory0 for i386 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 --- diff --git a/src/hotspot/share/prims/unsafe.cpp b/src/hotspot/share/prims/unsafe.cpp index a6300e814..d173b3fa7 100644 --- a/src/hotspot/share/prims/unsafe.cpp +++ b/src/hotspot/share/prims/unsafe.cpp @@ -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);