[foreign-memaccess+abi] RFR: Fix test failures following 8300201

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Feb 7 18:49:45 UTC 2023


The fix for JDK-8300201 has introduced an initialization issue involving `NativeMemorySegmentImpl`. The constructor of that class is accessing the `UNSAFE` static field (declared in same class), but that field seems to be set to `null` in some cases (probably because of a static initializer loop). This is something I also have observed when working on https://git.openjdk.org/panama-foreign/pull/781

The fix is to just use the Unsafe static field for getting the address size, and avoid the `UNSAFE` field in the constructor. More investigation might follow, to pinpoint exactly where the initialization problem is.

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

Commit messages:
 - Fix test failures

Changes: https://git.openjdk.org/panama-foreign/pull/782/files
 Webrev: https://webrevs.openjdk.org/?repo=panama-foreign&pr=782&range=00
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/panama-foreign/pull/782.diff
  Fetch: git fetch https://git.openjdk.org/panama-foreign pull/782/head:pull/782

PR: https://git.openjdk.org/panama-foreign/pull/782


More information about the panama-dev mailing list