File: jdk-8335238-workaround.patch

package info (click to toggle)
openjdk-25 25~15ea-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 832,092 kB
  • sloc: java: 5,679,805; cpp: 1,330,552; xml: 1,320,570; ansic: 487,102; asm: 405,131; objc: 21,025; sh: 15,221; javascript: 11,105; python: 8,227; makefile: 2,503; perl: 357; awk: 351; sed: 172; pascal: 103; exp: 54; jsp: 24
file content (24 lines) | stat: -rw-r--r-- 981 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: disable UnsafeGuard in Unsafe_SetMemory0 for i386
 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.
Author: Vladimir Petko <vladimir.petko@canonical.com>
Bug: https://bugs.openjdk.org/browse/JDK-8335238
Forwarded: not-needed
Last-Update: 2024-07-01

--- a/src/hotspot/share/prims/unsafe.cpp
+++ b/src/hotspot/share/prims/unsafe.cpp
@@ -392,7 +392,9 @@ UNSAFE_ENTRY_SCOPED(void, Unsafe_SetMemo
   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);