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

8321972: test runtime/Unsafe/InternalErrorTest.java timeout on linux-riscv64 platform #17103

Closed
wants to merge 1 commit into from

Conversation

zifeihan
Copy link
Member

@zifeihan zifeihan commented Dec 14, 2023

As described on the JBS issue, JDK-8320886 extended InternalErrorTest.java adding extra test for Unsafe_SetMemory0 trying to access next page after truncation. This triggers SIGBUS error and control flow is transfered to JVM signal handler [1]. But the current logic doesn't consider 16-bit compressed instructions when calculating next_pc. It always add NativeCall::instruction_size which is 4 to pc and use the result as next_pc. This is not correct as the memset invoked in this case contains compressed instructions and it is those instructions that are triggering the SIGBUS error.

The proposed fix is similar with other platform with variable-length instruction encoding like x86.
The encoding of the instruction triggering the SIGBUS error is checked to see if it is a compressed instruction and then calculate next_pc based on that. The test case can now pass normally with this fix.

[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp#L274

Testing:

  • Run tier1-3 tests on qemu 8.1.50 with UseRVV (release)

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-8321972: test runtime/Unsafe/InternalErrorTest.java timeout on linux-riscv64 platform (Bug - P4)

Reviewers

Contributors

  • Fei Yang <fyang@openjdk.org>

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17103

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 14, 2023

👋 Welcome back gcao! 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 Dec 14, 2023
@openjdk
Copy link

openjdk bot commented Dec 14, 2023

@zifeihan The following label will be automatically applied to this pull request:

  • hotspot

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.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Dec 14, 2023
@zifeihan
Copy link
Member Author

/contributor add @RealFYang

@openjdk
Copy link

openjdk bot commented Dec 14, 2023

@zifeihan
Contributor Fei Yang <fyang@openjdk.org> successfully added.

@mlbridge
Copy link

mlbridge bot commented Dec 14, 2023

Webrevs

Copy link
Member

@RealFYang RealFYang left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me. I find that the native GNU compiler toolchain on both my unmatched and licheepi-4a boards are compiling with RVC by default, which means native JDK builds on those hardware platforms will also have compressed instructions.

@openjdk
Copy link

openjdk bot commented Dec 14, 2023

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

8321972: test runtime/Unsafe/InternalErrorTest.java timeout on linux-riscv64 platform

Co-authored-by: Fei Yang <fyang@openjdk.org>
Reviewed-by: fyang

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

  • f6fe39f: 8322078: ZipSourceCache.testKeySourceMapping() test fails with The process cannot access the file because it is being used by another process
  • e204242: 8321017: Record in JFR that IEEE rounding mode was corrupted by loading a library
  • 2d60955: 8322141: SequenceInputStream.transferTo should not return as soon as Long.MAX_VALUE bytes have been transferred
  • e0bad51: 8322543: Parallel: Remove unused _major_pause_old_slope_counter
  • 424c58f: 8187634: keystore.getCertificateAlias(cert) returns original alias, inconsistent with fix of JDK-6483657
  • 14dab31: 8322377: Parallel: Remove unused arg in adjust_promo_for_pause_time and adjust_eden_for_pause_time
  • 5fcac7c: 8322364: Parallel: Remove unused SizePolicyTrueValues enum members
  • 2f917bf: 8322417: Console read line with zero out should zero out when throwing exception
  • 7db69e6: 8322513: Build failure with minimal
  • f7dc257: 8322321: Add man page doc for -XX:+VerifySharedSpaces
  • ... and 64 more: https://git.openjdk.org/jdk/compare/3d9d353edb64dd364925481d7b7c8822beeaa117...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 (@RealFYang) 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 Dec 14, 2023
@zifeihan
Copy link
Member Author

@RealFYang : Thanks for taking a look. If there is no other comment, I will proceed to integrate.

@zifeihan
Copy link
Member Author

/integrate

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

openjdk bot commented Dec 21, 2023

@zifeihan
Your change (at version 5f012aa) is now ready to be sponsored by a Committer.

@RealFYang
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Dec 21, 2023

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

  • f6fe39f: 8322078: ZipSourceCache.testKeySourceMapping() test fails with The process cannot access the file because it is being used by another process
  • e204242: 8321017: Record in JFR that IEEE rounding mode was corrupted by loading a library
  • 2d60955: 8322141: SequenceInputStream.transferTo should not return as soon as Long.MAX_VALUE bytes have been transferred
  • e0bad51: 8322543: Parallel: Remove unused _major_pause_old_slope_counter
  • 424c58f: 8187634: keystore.getCertificateAlias(cert) returns original alias, inconsistent with fix of JDK-6483657
  • 14dab31: 8322377: Parallel: Remove unused arg in adjust_promo_for_pause_time and adjust_eden_for_pause_time
  • 5fcac7c: 8322364: Parallel: Remove unused SizePolicyTrueValues enum members
  • 2f917bf: 8322417: Console read line with zero out should zero out when throwing exception
  • 7db69e6: 8322513: Build failure with minimal
  • f7dc257: 8322321: Add man page doc for -XX:+VerifySharedSpaces
  • ... and 64 more: https://git.openjdk.org/jdk/compare/3d9d353edb64dd364925481d7b7c8822beeaa117...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 21, 2023
@openjdk openjdk bot closed this Dec 21, 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 Dec 21, 2023
@openjdk
Copy link

openjdk bot commented Dec 21, 2023

@RealFYang @zifeihan Pushed as commit e8768ae.

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

@zifeihan
Copy link
Member Author

/backport jdk21u-dev

@openjdk
Copy link

openjdk bot commented Dec 21, 2023

@zifeihan the backport was successfully created on the branch backport-zifeihan-e8768ae0 in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit e8768ae0 from the openjdk/jdk repository.

The commit being backported was authored by Gui Cao on 21 Dec 2023 and was reviewed by Fei Yang.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-zifeihan-e8768ae0:backport-zifeihan-e8768ae0
$ git checkout backport-zifeihan-e8768ae0
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-zifeihan-e8768ae0

@zifeihan zifeihan deleted the JDK-8321972 branch January 2, 2024 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants