Integrated: 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val))

Anton Seoane Ampudia aseoane at openjdk.org
Wed Oct 29 09:40:20 UTC 2025


On Tue, 21 Oct 2025 09:19:22 GMT, Anton Seoane Ampudia <aseoane at openjdk.org> wrote:

> This PR introduces a fix for a intermittent assert crash due to a non-oop found in the stack when deoptimizing.
> 
> The `inline_native_GetEventWriter` JFR intrinsic performs a call into the runtime, which can safepoint, to write a checkpoint for the vthread. This call returns a global handle (`jobject`) that then gets resolved to a raw oop.
> 
> However, the corresponding `jfr_write_checkpoint_Type` does not set any return, modelling the call as `void`. If a safepoint hits in the small window after the stub returns but before the writer oop is used, and the GC moves the object in that window, the deoptimization path cannot resolve a handle that it never recorded, leading to the subsequent crash.
> 
> An IR Framework test is introduced to exercise the error explicitly. Additionally, related documentation in form of comments in the appropriate file (`runtime.hpp`) is added to hopefully prevent similar cases in the future.
> 
> **Testing:** passes tiers 1-5

This pull request has now been integrated.

Changeset: 8457f38f
Author:    Anton Seoane Ampudia <aseoane at openjdk.org>
Committer: Roberto Castañeda Lozano <rcastanedalo at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/8457f38f14182e2a55ff5d243cdacb06c9003c49
Stats:     76 lines in 3 files changed: 74 ins; 0 del; 2 mod

8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with  assert(oopDesc::is_oop_or_null(val))

Reviewed-by: dlong, rcastanedalo, mgronlun

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

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


More information about the hotspot-compiler-dev mailing list