RFR: JDK-8226878: zero crashes after JDK-8191278

Ao Qi aoqi at loongson.cn
Thu Jun 27 11:04:23 UTC 2019


Hi,

On zero, StubRoutines::unsafe_arraycopy() may return
ShouldNotCallThisStub() but not NULL. Is it ok to use
Copy::conjoint_memory_atomic instead of
StubRoutines::UnsafeArrayCopy_stub()(src, dst, sz) on zero?

JBS:
https://bugs.openjdk.java.net/browse/JDK-8226878

Fix:
diff --git a/src/hotspot/share/prims/unsafe.cpp
b/src/hotspot/share/prims/unsafe.cpp
--- a/src/hotspot/share/prims/unsafe.cpp
+++ b/src/hotspot/share/prims/unsafe.cpp
@@ -401,7 +401,7 @@
   void* dst = index_oop_from_field_offset_long(dstp, dstOffset);
   {
     GuardUnsafeAccess guard(thread);
-    if (StubRoutines::unsafe_arraycopy() != NULL) {
+    if (StubRoutines::unsafe_arraycopy() != NULL ZERO_ONLY(&&
StubRoutines::unsafe_arraycopy() != ShouldNotCallThisStub())) {
       StubRoutines::UnsafeArrayCopy_stub()(src, dst, sz);
     } else {
       Copy::conjoint_memory_atomic(src, dst, sz);



Thanks,
Ao Qi


More information about the hotspot-dev mailing list