[jdk17] RFR: 8269066: assert(ZAddress::is_marked(addr)) failed: Should be marked

Per Liden pliden at openjdk.java.net
Tue Jun 22 15:04:38 UTC 2021


Please review this patch to fix an issue in ZBarrierSetC2.

This problem was spotted when running an updated version of test/hotspot/jtreg/vmTestbase/gc/gctests/PhantomReference/phantom001/phantom001.java, which used `PhantomReference.refersTo()` (see JIRA).

The root cause of the problem is that `set_barrier_data()` in `zBarrierSetC2.cpp` only checks for `ON_WEAK_OOP_REF` and otherwise defaults to `ON_STRONG_OOP_REF`. With the introduction of `Reference.refersTo()` and `PhantomReference.refersTo()` it should also check for `ON_PHANTOM_OOP_REF` and `AS_NO_KEEPALIVE`, but that was missed. As a result, we generate calls to the wrong load barrier type.

Testing:
  * Tier1-7 using ZGC on Linux/x86.
  * 100+ iterations of test/hotspot/jtreg/vmTestbase/gc/gctests/PhantomReference/phantom001/phantom001.java (updated version)
  * Manual ad-hoc testing to verify that we generate the correct load barrier.

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

Commit messages:
 - 8269066: assert(ZAddress::is_marked(addr)) failed: Should be marked

Changes: https://git.openjdk.java.net/jdk17/pull/118/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk17&pr=118&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8269066
  Stats: 13 lines in 1 file changed: 10 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk17/pull/118.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/118/head:pull/118

PR: https://git.openjdk.java.net/jdk17/pull/118



More information about the hotspot-gc-dev mailing list