RFR: 8309675: Generational ZGC: compiler/gcbarriers/UnsafeIntrinsicsTest.java fails in nmt_commit

Stefan Karlsson stefank at openjdk.org
Thu Jun 8 18:24:40 UTC 2023


On Thu, 8 Jun 2023 18:05:46 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

> The failure happens because we have extra verification code that is incorrect to use when calling the NMT tracking code. 
> 
> The fix is to simply inline the address calculation code *without* the verification code.
> 
> This fixes a tier3 failure. I'm going to run this through more extensive testing but it would be good to get this reviewed.

To understand the fix see the function I'm replacing:

inline zaddress ZOffset::address(zoffset offset) {
  return to_zaddress(untype(offset) | ZAddressHeapBase);
}


and the verification code in this function:

inline zaddress to_zaddress(uintptr_t value) {
  const zaddress addr = zaddress(value);
  assert_is_valid(addr);
  DEBUG_ONLY(dereferenceable_test(addr));
  return addr;
}


The crash happens because of the dereferenceable_test, which checks that the memory have been committed and is accessible. As described in nmt_commit, we fake the address we report to NMT, so we can't try to dereference the contents of that address.

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

PR Comment: https://git.openjdk.org/jdk/pull/14382#issuecomment-1583130866


More information about the hotspot-gc-dev mailing list