[lworld] RFR: 8247746: [lworld] TestNullableArray::test78 fails with ZGC due to incorrect result

Tobias Hartmann thartmann at openjdk.java.net
Wed Jun 17 10:14:16 UTC 2020


A missing control dependency between an oop load from an array and the corresponding "is-not-flat" check led to
re-ordering of the load to before the check. Although the result is only used in the "not-flat" case, ZGC load barriers
are still executed on that "oop" that is actually a non-oop field of the flattened inline type array element. In rare
cases, the following barrier code screws up the contents of that field:

#0  0x00007fa990daf32e in Atomic::PlatformCmpxchg<8ul>::operator()<unsigned long> (this=<optimized out>,
exchange_value=<optimized out>, compare_value=<optimized out>,
    dest=0x100000f17350) at /oracle/valhalla_int/open/src/hotspot/os_cpu/linux_x86/atomic_linux_x86.hpp:126
#1  Atomic::CmpxchgImpl<unsigned long, unsigned long, unsigned long, void>::operator() (this=<optimized out>,
order=memory_order_conservative, exchange_value=21990232555242,
    compare_value=<optimized out>, dest=0x100000f17350) at
    /oracle/valhalla_int/open/src/hotspot/share/runtime/atomic.hpp:745
#2  Atomic::cmpxchg<unsigned long, unsigned long, unsigned long> (order=memory_order_conservative,
exchange_value=21990232555242, compare_value=<optimized out>, dest=0x100000f17350)
    at /oracle/valhalla_int/open/src/hotspot/share/runtime/atomic.hpp:721
#3  ZBarrier::self_heal<&ZBarrier::is_good_or_null_fast_path> (heal_addr=<optimized out>, addr=<optimized out>,
p=0x100000f17350)
    at /oracle/valhalla_int/open/src/hotspot/share/gc/z/zBarrier.inline.hpp:120
#4  ZBarrier::self_heal<&ZBarrier::is_good_or_null_fast_path> (heal_addr=<optimized out>, addr=<optimized out>,
p=0x100000f17350)
    at /oracle/valhalla_int/open/src/hotspot/share/gc/z/zBarrier.inline.hpp:106
#5  ZBarrier::barrier<&ZBarrier::is_good_or_null_fast_path, &ZBarrier::load_barrier_on_oop_slow_path> (o=...,
p=<optimized out>)
    at /oracle/valhalla_int/open/src/hotspot/share/gc/z/zBarrier.inline.hpp:152
#6  ZBarrier::load_barrier_on_oop_field_preloaded (o=..., p=0x100000f17350) at
/oracle/valhalla_int/open/src/hotspot/share/gc/z/zBarrier.inline.hpp:236 #7
ZBarrierSetRuntime::load_barrier_on_oop_field_preloaded (o=<optimized out>, p=0x100000f17350) at
/oracle/valhalla_int/open/src/hotspot/share/gc/z/zBarrierSetRuntime.cpp:30 #8  0x00007fa9851a8774 in ?? () #9
0x0000000000000000 in ?? ()

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

Commit messages:
 - 8247746: [lworld] TestNullableArray::test78 fails with ZGC due to incorrect result

Changes: https://git.openjdk.java.net/valhalla/pull/87/files
 Webrev: https://webrevs.openjdk.java.net/valhalla/87/webrev.00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8247746
  Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod
  Patch: https://git.openjdk.java.net/valhalla/pull/87.diff
  Fetch: git fetch https://git.openjdk.java.net/valhalla pull/87/head:pull/87

PR: https://git.openjdk.java.net/valhalla/pull/87


More information about the valhalla-dev mailing list