[jdk25u-dev] RFR: 8372591: assert(!current->cont_fastpath() || freeze.check_valid_fast_path()) failed

Roland Mesde duke at openjdk.org
Tue Jan 13 22:06:54 UTC 2026


Backporting JDK-8372591: assert(!current->cont_fastpath() || freeze.check_valid_fast_path()) failed.

This PR fixes a critical bug in OSR (On-Stack Replacement) handling with continuations where _cont_fastpath is incorrectly set when an OSR frame has an interpreted caller. The issue occurs because OSR frames are created from the sender's unextended_sp (not sp), but _cont_fastpath was being set to the sender's sp, potentially pointing outside valid stack space.

This mismatch can cause _cont_fastpath to be prematurely cleared while interpreted frames remain on the stack, leading to incorrect execution of the freeze fast path (which should only run when all frames are compiled) and resulting in crashes.

The fix changes OSR_migration_begin to use the sender's unextended_sp for _cont_fastpath, ensuring proper stack boundary tracking.

This backport has internal demand.

Ran related tests on linux-x64, linux-aarch64, macos-aarch64 and windows-x64:

make test TEST=test/jdk/jdk/internal/vm/Continuation/OSRWithManyLocals.java

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

Commit messages:
 - Backport 5fd095fb9b8f1d2000760519d42d7d0068b82651

Changes: https://git.openjdk.org/jdk25u-dev/pull/144/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk25u-dev&pr=144&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8372591
  Stats: 91 lines in 2 files changed: 90 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk25u-dev/pull/144.diff
  Fetch: git fetch https://git.openjdk.org/jdk25u-dev.git pull/144/head:pull/144

PR: https://git.openjdk.org/jdk25u-dev/pull/144


More information about the jdk-updates-dev mailing list