[jdk25u-dev] RFR: 8372591: assert(!current->cont_fastpath() || freeze.check_valid_fast_path()) failed
Roland Mesde
duke at openjdk.org
Wed Jan 14 16:48:40 UTC 2026
On Tue, 13 Jan 2026 19:47:29 GMT, Roland Mesde <duke at openjdk.org> wrote:
> 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
>
> Results attached:
>
> [linux-aarch64-specific-test.log](https://github.com/user-attachments/files/24616553/linux-aarch64-specific-test.log)
> [linux-x64-specific-test.log](https://github.com/user-attachments/files/24616554/linux-x64-specific-test.log)
> [macos-aarch64-specific-test.log](https://github.com/user-attachments/files/24616555/macos-aarch64-specific-test.log)
> [windows-x64-specific-test.log](https://github.com/user-attachments/files/24616556/windows-x64-specific-test.log)
Our customers utilize the JDK in a highly varied amount of use cases and issues that occur indicate that it is likely to manifest for OpenJDK and would be a worthwhile consideration.
-------------
PR Comment: https://git.openjdk.org/jdk25u-dev/pull/144#issuecomment-3750495171
More information about the jdk-updates-dev
mailing list