Skip to content

Conversation

anton-seoane
Copy link
Contributor

@anton-seoane anton-seoane commented Oct 21, 2025

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.

Testing: passes tiers 1-5


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) (Bug - P3)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27913/head:pull/27913
$ git checkout pull/27913

Update a local copy of the PR:
$ git checkout pull/27913
$ git pull https://git.openjdk.org/jdk.git pull/27913/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27913

View PR using the GUI difftool:
$ git pr show -t 27913

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27913.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 21, 2025

👋 Welcome back aseoane! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Oct 21, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) 8347463: jdk/jfr/threading/TestManyVirtualThreads.java crashes with assert(oopDesc::is_oop_or_null(val)) Oct 21, 2025
@openjdk
Copy link

openjdk bot commented Oct 21, 2025

@anton-seoane The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@anton-seoane anton-seoane marked this pull request as ready for review October 21, 2025 09:25
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 21, 2025
@mlbridge
Copy link

mlbridge bot commented Oct 21, 2025

Webrevs

@robcasloz
Copy link
Contributor

/cc hotspot-jfr

@openjdk
Copy link

openjdk bot commented Oct 21, 2025

@robcasloz
The hotspot-jfr label was successfully added.

@anton-seoane anton-seoane marked this pull request as draft October 21, 2025 13:00
@anton-seoane
Copy link
Contributor Author

Switching back to draft after conversation with @robcasloz, to perform further investigation

@openjdk openjdk bot removed the rfr Pull request is ready for review label Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants