Skip to content

Conversation

@gnu-andrew
Copy link
Member

@gnu-andrew gnu-andrew commented Feb 20, 2025

Clean backport of a fix for a race condition in code adapted from JavaCallWrapper for the FFM API. This is more visible in 22 and later, where FFM is fully supported and the OpenType implementation using HarfBuzz has been ported to use it. However, the copy in the native state seems to have been introduced as far back as JDK-8269240 in 17 when the JavaCallWrapper code was ported to what was then universalUpcallHandler.cpp.


Progress

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

Issues

  • JDK-8331735: UpcallLinker::on_exit races with GC when copying frame anchor (Bug - P3 - Approved)
  • JDK-8343144: UpcallLinker::on_entry racingly clears pending exception with GC safepoints (Bug - P4 - Approved)
  • JDK-8286875: ProgrammableUpcallHandler::on_entry/on_exit access thread fields from native (Bug - P4 - Approved)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1424

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 20, 2025

👋 Welcome back andrew! 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 Feb 20, 2025

@gnu-andrew 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:

8331735: UpcallLinker::on_exit races with GC when copying frame anchor
8343144: UpcallLinker::on_entry racingly clears pending exception with GC safepoints
8286875: ProgrammableUpcallHandler::on_entry/on_exit access thread fields from native

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 14 new commits pushed to the master branch:

  • 4159e88: 8350650: Bump update version for OpenJDK: jdk-21.0.8
  • 5806906: 8317808: HTTP/2 stream cancelImpl may leave subscriber registered
  • 951453e: 8344581: [TESTBUG] java/awt/Robot/ScreenCaptureRobotTest.java failing on macOS
  • 2f9840c: 8339356: Test javax/net/ssl/SSLSocket/Tls13PacketSize.java failed with java.net.SocketException: An established connection was aborted by the software in your host machine
  • 68ad843: 8342635: javax/swing/JFileChooser/FileSystemView/WindowsDefaultIconSizeTest.java creates tmp file in src dir
  • 335b2f5: 8349039: Adjust exception No type named in database
  • d02ad34: 8327476: Upgrade JLine to 3.26.1
  • 9c26323: 8349729: [21u] AIX jtreg tests fail to compile with qvisibility=hidden
  • 69192fe: 8348675: TrayIcon tests fail in Ubuntu 24.10 Wayland
  • ed0c9d3: 8346828: javax/swing/JScrollBar/4865918/bug4865918.java still fails in CI
  • ... and 4 more: https://git.openjdk.org/jdk21u-dev/compare/1b49a33e73ba40058462e0d8269d941386d94a30...master

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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot changed the title Backport 461ffafeba459c077f1c2d9c5037305b71a8bc2a 8331735: UpcallLinker::on_exit races with GC when copying frame anchor Feb 20, 2025
@openjdk
Copy link

openjdk bot commented Feb 20, 2025

This backport pull request has now been updated with issues 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 Feb 20, 2025
@openjdk
Copy link

openjdk bot commented Feb 20, 2025

⚠️ @gnu-andrew 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 Feb 20, 2025
@mlbridge
Copy link

mlbridge bot commented Feb 20, 2025

Webrevs

@gnu-andrew
Copy link
Member Author

/approval request Clean backport of a fix for a race condition in the FFM API. Can lead to crashes when the FFM code manipulates a frame anchor in native mode, which the GC does not expect to happen. Fix is to move the frame anchor copying to Java mode, where the GC will wait for the thread to get to a safepoint. Risk to other code is low as the UpcallLinker is only used by FFM.

@openjdk
Copy link

openjdk bot commented Feb 20, 2025

@gnu-andrew
8331735: The approval request has been created successfully.
8343144: The approval request has been created successfully.
8286875: The approval request has been created successfully.

@openjdk openjdk bot added approval Requires approval; will be removed when approval is received ready Pull request is ready to be integrated and removed approval Requires approval; will be removed when approval is received labels Feb 20, 2025
@GoeLin
Copy link
Member

GoeLin commented Feb 25, 2025

@gnu-andrew, you might want to push this, today 18:00 CET the last automatic merge from jdk21u-dev to jdk21u will happen.

@gnu-andrew
Copy link
Member Author

@gnu-andrew, you might want to push this, today 18:00 CET the last automatic merge from jdk21u-dev to jdk21u will happen.

Ah, sorry, I got my dates mixed up and thought that was next week. I've been away the first half of this week, so only been able to get back to this today.

@gnu-andrew
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Feb 28, 2025

Going to push as commit 91457e6.
Since your change was applied there have been 16 commits pushed to the master branch:

  • ae47d99: 8346082: Output JVMTI agent information in hserr files
  • b942b5e: 8345146: [PPC64] Make intrinsic conversions between bit representations of half precision values and floats
  • 4159e88: 8350650: Bump update version for OpenJDK: jdk-21.0.8
  • 5806906: 8317808: HTTP/2 stream cancelImpl may leave subscriber registered
  • 951453e: 8344581: [TESTBUG] java/awt/Robot/ScreenCaptureRobotTest.java failing on macOS
  • 2f9840c: 8339356: Test javax/net/ssl/SSLSocket/Tls13PacketSize.java failed with java.net.SocketException: An established connection was aborted by the software in your host machine
  • 68ad843: 8342635: javax/swing/JFileChooser/FileSystemView/WindowsDefaultIconSizeTest.java creates tmp file in src dir
  • 335b2f5: 8349039: Adjust exception No type named in database
  • d02ad34: 8327476: Upgrade JLine to 3.26.1
  • 9c26323: 8349729: [21u] AIX jtreg tests fail to compile with qvisibility=hidden
  • ... and 6 more: https://git.openjdk.org/jdk21u-dev/compare/1b49a33e73ba40058462e0d8269d941386d94a30...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 28, 2025
@openjdk openjdk bot closed this Feb 28, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 28, 2025
@openjdk
Copy link

openjdk bot commented Feb 28, 2025

@gnu-andrew Pushed as commit 91457e6.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

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 integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

2 participants