RFR: 8336042: Caller/callee param size mismatch in deoptimization causes crash

Dean Long dlong at openjdk.org
Wed Feb 12 01:18:03 UTC 2025


When calling a MethodHandle linker, such as linkToStatic, we drop the last argument, which causes a mismatch between what the caller pushed and what the callee received.  In deoptimization, we check for this in several places, but in one place we had outdated code.  See the bug for the gory details.

In this PR I add asserts and a test to reproduce the problem, plus the necessary fixes in deoptimizations.  There are other inefficiencies in deoptimization that I didn't address, hoping to simplify the fix for backports.

Some platforms align locals according to the caller during deoptimization, while some align locals according to the callee.  The asserts I added compute locals both ways and check that they are still within the frame.  I attempted this on all platforms, but am only able to test x64 and aarch64.  I need help testing those asserts for arm32, ppc, riscv, and s390.

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

Commit messages:
 - fix
 - tighten upper-bound on locals assert
 - s390 build
 - update bug id, copyright, in test
 - s390 build
 - ppc build
 - wip

Changes: https://git.openjdk.org/jdk/pull/23557/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23557&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8336042
  Stats: 142 lines in 8 files changed: 133 ins; 0 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/23557.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23557/head:pull/23557

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


More information about the hotspot-dev mailing list