Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8310656: RISC-V: __builtin___clear_cache can fail silently. #1968

Conversation

luhenry
Copy link
Member

@luhenry luhenry commented Nov 17, 2023

Hi all,

This pull request contains a backport of commit 5f1d762750a0d4c20da5b23d54f922dbb5cbbe34 from the openjdk/jdk21u repository.

The commit being backported was authored by Robbin Ehn on 2 Jul 2023 and was reviewed by Ludovic Henry, Thomas Stuefe and Fei Yang.

Thanks!


Progress

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

Issue

  • JDK-8310656: RISC-V: __builtin___clear_cache can fail silently. (Bug - P2 - Approved)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1968

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

Using diff file

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

Webrev

Link to Webrev Comment

Backport-of: faf1b822d03b726413d77a2b247dfbbf4db7d57e
@bridgekeeper
Copy link

bridgekeeper bot commented Nov 17, 2023

👋 Welcome back luhenry! 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 openjdk bot added the rfr Pull request is ready for review label Nov 17, 2023
@luhenry
Copy link
Member Author

luhenry commented Nov 17, 2023

/approval request That fix is required for Java to not crash randomly on non instruction/data cache coherent systems when running inside a container on an older version of Docker. The issue with Docker is that it blocks the riscv_icache_flush syscall by default, leading to the __builtin_clear_cache failing silently. That leads to the i-cache not being flushed, leading to random failures. With this patch, instead of failing randomly, it fails at startup logging an informative message, allowing the user to go and fix their configuration.

@luhenry
Copy link
Member Author

luhenry commented Nov 17, 2023

The patch applied mostly cleanly. The only conflict was on the dates in the copyright header in src/hotspot/cpu/riscv/icache_riscv.cpp.

@openjdk
Copy link

openjdk bot commented Nov 17, 2023

@luhenry
8310656: The approval request has been created successfully.

@openjdk openjdk bot added the approval label Nov 17, 2023
@mlbridge
Copy link

mlbridge bot commented Nov 17, 2023

Webrevs

Copy link

@VladimirKempik VladimirKempik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, this also helps clang builds of openjdk (when linking eith libstdc++, not libc++)

@openjdk
Copy link

openjdk bot commented Nov 17, 2023

⚠️ @luhenry 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.

@robehn
Copy link
Contributor

robehn commented Nov 17, 2023

There is some weird message in header: [JDK-8310656](https://bugs.openjdk.org/browse/JDK-8310656): RISC-V: __builtin___clear_cache can fail silently. (Bug - P2 - Requested) ⚠️ Issue is already resolved. Consider making this a "backport pull request" by setting the PR title to Backport <hash> with the hash of the original commit. See [Backports](https://wiki.openjdk.org/display/SKARA/Backports).

" Issue is already resolved. " doesn't sound right.

Yes, looks good, thanks!

@RealFYang
Copy link
Member

Hmm ... This doesn't seem right. Shouldn't this be made a backport PR?

@luhenry luhenry changed the title 8310656: RISC-V: __builtin___clear_cache can fail silently. Backport 5f1d762750a0d4c20da5b23d54f922dbb5cbbe34 Nov 18, 2023
@openjdk openjdk bot changed the title Backport 5f1d762750a0d4c20da5b23d54f922dbb5cbbe34 8310656: RISC-V: __builtin___clear_cache can fail silently. Nov 18, 2023
@openjdk
Copy link

openjdk bot commented Nov 18, 2023

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

@luhenry
Copy link
Member Author

luhenry commented Nov 18, 2023

@RealFYang @robehn the backport linking is fixed now

@luhenry
Copy link
Member Author

luhenry commented Nov 18, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Nov 18, 2023

@luhenry This pull request has not yet been marked as ready for integration.

@GoeLin
Copy link
Member

GoeLin commented Nov 20, 2023

Hi @luhenry
please backport this to 21, first.
I remove the label in the meantime.

@openjdk openjdk bot removed the approval label Nov 20, 2023
@RealFYang
Copy link
Member

@GoeLin : Hi Goetz, I think it's already there in jdk21: openjdk/jdk21@5f1d762

@luhenry
Copy link
Member Author

luhenry commented Nov 20, 2023

@GoeLin it's in openjdk/jdk21 and openjdk/jdk21u

@openjdk openjdk bot added the approval label Nov 20, 2023
@openjdk
Copy link

openjdk bot commented Nov 21, 2023

@luhenry 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:

8310656: RISC-V: __builtin___clear_cache can fail silently.

Reviewed-by: vkempik, rehn

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

  • 40c29f7: 8279856: Parallel: Use PreservedMarks to record promotion-failed objects
  • 2a37bae: 8262186: Call X509KeyManager.chooseClientAlias once for all key types
  • b7605b7: 8302109: Trivial fixes to btree tests
  • c478c81: 8292067: Convert test/sun/management/jmxremote/bootstrap shell tests to java version
  • e4ddf06: 8320053: GHA: Cross-compile gtest code
  • 3d9cb02: 8317834: java/lang/Thread/IsAlive.java timed out
  • db83123: 8316645: RISC-V: Remove dependency on libatomic by adding cmpxchg 1b
  • 9bde50e: 8319958: test/jdk/java/io/File/libGetXSpace.c does not compile on Windows 32-bit
  • c7fb6ea: 8318759: Add four DigiCert root certificates
  • e0bdb10: 8307311: Timeouts on one macOS 12.6.1 host of two Swing JTableHeader tests
  • ... and 1 more: https://git.openjdk.org/jdk17u-dev/compare/68f72954dca6166758d7da78628afa0aca2caf88...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@VladimirKempik, @robehn) but any other Committer may sponsor as well.

➡️ 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 added the ready Pull request is ready to be integrated label Nov 21, 2023
@openjdk openjdk bot removed the approval label Nov 21, 2023
@VladimirKempik
Copy link

/sponsor

@openjdk
Copy link

openjdk bot commented Nov 21, 2023

@VladimirKempik The change author (@luhenry) must issue an integrate command before the integration can be sponsored.

@luhenry
Copy link
Member Author

luhenry commented Nov 22, 2023

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Nov 22, 2023
@openjdk
Copy link

openjdk bot commented Nov 22, 2023

@luhenry
Your change (at version 1ee86f2) is now ready to be sponsored by a Committer.

@VladimirKempik
Copy link

/sponsor

@openjdk
Copy link

openjdk bot commented Nov 22, 2023

Going to push as commit 2da7aeb.
Since your change was applied there have been 11 commits pushed to the master branch:

  • 40c29f7: 8279856: Parallel: Use PreservedMarks to record promotion-failed objects
  • 2a37bae: 8262186: Call X509KeyManager.chooseClientAlias once for all key types
  • b7605b7: 8302109: Trivial fixes to btree tests
  • c478c81: 8292067: Convert test/sun/management/jmxremote/bootstrap shell tests to java version
  • e4ddf06: 8320053: GHA: Cross-compile gtest code
  • 3d9cb02: 8317834: java/lang/Thread/IsAlive.java timed out
  • db83123: 8316645: RISC-V: Remove dependency on libatomic by adding cmpxchg 1b
  • 9bde50e: 8319958: test/jdk/java/io/File/libGetXSpace.c does not compile on Windows 32-bit
  • c7fb6ea: 8318759: Add four DigiCert root certificates
  • e0bdb10: 8307311: Timeouts on one macOS 12.6.1 host of two Swing JTableHeader tests
  • ... and 1 more: https://git.openjdk.org/jdk17u-dev/compare/68f72954dca6166758d7da78628afa0aca2caf88...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 22, 2023
@openjdk openjdk bot closed this Nov 22, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Nov 22, 2023
@openjdk
Copy link

openjdk bot commented Nov 22, 2023

@VladimirKempik @luhenry Pushed as commit 2da7aeb.

💡 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 clean integrated Pull request has been integrated
5 participants