RFR: 8365229: ARM32: c2i_no_clinit_check_entry assert failed after JDK-8364269

Aleksey Shipilev shade at openjdk.org
Tue Aug 12 14:17:24 UTC 2025


When recording adapter entries, we record _offsets_, not the actual addresses:


  entry_offset[3] = handler->get_c2i_no_clinit_check_entry() - i2c_entry;


Every platform except ARM32 and Zero have all these entries set up, so offset are always sane. But those two platforms set up `nullptr` as `c2i_no_clinit_check_entry()`, because clinit barriers are unimplemented. So the new assert added in [JDK-8364269](https://bugs.openjdk.org/browse/JDK-8364269) fails encountering effectively `nullptr - i2c_entry` "garbage" and fails.

This PR is the second least horrible (IMO) fix for this: relaxing assert by checking that "out of range" values are actually wrapping around back to `0`/`nullptr`. Had to do it in unsigned ints to avoid UB. For the affected platforms, we do not actually access this problematic/garbage entry offset, since we are always checking if clinit barriers are enabled. So the assert is the only place where it matters.

The least horrible solution would be storing the actual `address`-es instead of `int` offsets. But that likely has footprint implications.

Additional testing:
 - [x] Linux ARM32 server fastdebug, `java -version` now works

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

Commit messages:
 - Unsigned overflow is not UB
 - Fix

Changes: https://git.openjdk.org/jdk/pull/26746/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26746&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8365229
  Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/26746.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26746/head:pull/26746

PR: https://git.openjdk.org/jdk/pull/26746


More information about the hotspot-compiler-dev mailing list