8247746: [lworld] TestNullableArray::test78 fails with ZGC due to incorrect result #87
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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() (this=, exchange_value=, compare_value=,
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=, order=memory_order_conservative, exchange_value=21990232555242,
compare_value=, 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=, 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=, addr=, 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=, addr=, 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=)
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=, p=0x100000f17350) at /oracle/valhalla_int/open/src/hotspot/share/gc/z/zBarrierSetRuntime.cpp:30
#8 0x00007fa9851a8774 in ?? ()
#9 0x0000000000000000 in ?? ()
Progress
Issue
Download
$ git fetch https://git.openjdk.java.net/valhalla pull/87/head:pull/87
$ git checkout pull/87