Skip to content

Conversation

@rm-gh-8
Copy link
Contributor

@rm-gh-8 rm-gh-8 commented Jan 13, 2026

Backporting JDK-8373485: JFR Crash during sampling: assert(jt->has_last_Java_frame()) failed: invariant.

The fix adds the missing memory barrier to ensure proper load ordering when sampling native threads.

For parity with Oracle JDK.

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

make test TEST="jdk_jfr"

Results attached:

linux-aarch64-specific-test.log
linux-x64-specific-test.log
macos-aarch64-specific-test.log
windows-x64-specific-test.log


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8373485 needs maintainer approval

Issue

  • JDK-8373485: JFR Crash during sampling: assert(jt->has_last_Java_frame()) failed: invariant (Bug - P3 - Approved)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk25u-dev.git pull/145/head:pull/145
$ git checkout pull/145

Update a local copy of the PR:
$ git checkout pull/145
$ git pull https://git.openjdk.org/jdk25u-dev.git pull/145/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 145

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk25u-dev/pull/145.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 13, 2026

👋 Welcome back rm-gh-8! 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 Jan 13, 2026

@rm-gh-8 This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8373485: JFR Crash during sampling:  assert(jt->has_last_Java_frame()) failed: invariant

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 2 new commits pushed to the master branch:

  • 5c423ee: 8371559: Intermittent timeouts in test javax/net/ssl/Stapling/HttpsUrlConnClient.java
  • 1e72690: 8342175: MemoryEaterMT fails intermittently with ExceptionInInitializerError

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot changed the title Backport 543a972222118155e4c72c6f2d32d154c5dfd442 8373485: JFR Crash during sampling: assert(jt->has_last_Java_frame()) failed: invariant Jan 13, 2026
@openjdk
Copy link

openjdk bot commented Jan 13, 2026

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required labels Jan 13, 2026
@rm-gh-8 rm-gh-8 marked this pull request as ready for review January 15, 2026 17:58
@rm-gh-8 rm-gh-8 marked this pull request as draft January 15, 2026 18:01
@rm-gh-8 rm-gh-8 marked this pull request as ready for review January 15, 2026 18:01
@openjdk
Copy link

openjdk bot commented Jan 15, 2026

⚠️ @rm-gh-8 This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 15, 2026
@rm-gh-8
Copy link
Contributor Author

rm-gh-8 commented Jan 15, 2026

/approval request for backport of JDK-8373485: JFR Crash during sampling: assert(jt->has_last_Java_frame()) failed: invariant.

This PR fixes a missing memory barrier in JFR's native thread sampling.

For parity with Oracle JDK.

Low-medium risk - Addresses specific memory ordering issue with clear scope, though incorrect barrier placement could introduce subtle race conditions and additional memory barriers may increase JFR sampling overhead.

@openjdk
Copy link

openjdk bot commented Jan 15, 2026

@rm-gh-8
8373485: The approval request has been created successfully.

@openjdk openjdk bot added the approval Requires approval; will be removed when approval is received label Jan 15, 2026
@mlbridge
Copy link

mlbridge bot commented Jan 15, 2026

Webrevs

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed approval Requires approval; will be removed when approval is received labels Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant