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

8270533: AArch64: size_fits_all_mem_uses should return false if its output is a CAS #4790

Closed
wants to merge 1 commit into from

Conversation

theRealAph
Copy link
Contributor

@theRealAph theRealAph commented Jul 15, 2021

size_fits_all_mem_uses(AddPNode) is used to determine if an add with shift expression can be used as an input to a MemNode. However, it is not correct when one of its outputs is a CAS. This causes a crash when a single AddPNode feeds a CAS and an ordinary MemNode.

This bug is probably latent in the current HotSpot because pd_clone_address_expressions() clones AddPNodes that are used as inputs to MemNodes, so size_fits_all_mem_uses() never sees a CAS as one of its outputs. The matcher for a CompareAndSwapX node doesn't call size_fits_all_mem_uses(), so this can only happen when the same expression feeds both an ordinary MemNode and a CompareAndSwapX.

This bug has been back-ported to JDK 8u, so it must be fixed there. Even though the bug is latent in current HotSpot, it should be fixed.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8270533: AArch64: size_fits_all_mem_uses should return false if its output is a CAS

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4790/head:pull/4790
$ git checkout pull/4790

Update a local copy of the PR:
$ git checkout pull/4790
$ git pull https://git.openjdk.java.net/jdk pull/4790/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4790

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4790.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 15, 2021

👋 Welcome back aph! 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 Jul 15, 2021
@openjdk
Copy link

openjdk bot commented Jul 15, 2021

@theRealAph 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.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Jul 15, 2021
@mlbridge
Copy link

mlbridge bot commented Jul 15, 2021

Webrevs

Copy link
Contributor

@adinn adinn left a comment

Choose a reason for hiding this comment

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

Yes, this fix is correct even though it is currently short-circuited by the address cloning code.

@openjdk
Copy link

openjdk bot commented Jul 15, 2021

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

8270533: AArch64: size_fits_all_mem_uses should return false if its output is a CAS

Reviewed-by: adinn, ngasson

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

  • 5350b99: 8272131: PhaseMacroExpand::generate_slow_arraycopy crash when clone null CallProjections.fallthrough_ioproj
  • 1489352: 8271718: Crash when during color transformation the color profile is replaced
  • 2a9acc3: 8272050: typo in MachSpillCopyNode::implementation after JDK-8131362
  • b62e742: 8213714: AttachingConnector/attach/attach001 failed due to "bind failed: Address already in use"
  • 66d1faa: 8271601: Math.floorMod(int, int) and Math.floorMod(long, long) differ in their logic
  • 57ae9fb: 8140442: Add getOutermostTypeElement to javax.lang.model utility class
  • 67869b4: 8270137: Kerberos Credential Retrieval from Cache not Working in Cross-Realm Setup
  • 35b399a: 8269130: Replace usages of Collection.toArray() with Collection.toArray(T[]) to avoid redundant array copying
  • 2b05fae: 8260262: Use common code in function unmap_shared() in perfMemory_posix.cpp
  • f2599ad: 8272196: Remove unused class ParStrongRootsScope
  • ... and 320 more: https://git.openjdk.java.net/jdk/compare/357fe09f2e46efa3343f6c8a57b8693dcd5dd43c...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 added the ready Pull request is ready to be integrated label Jul 15, 2021
@bridgekeeper
Copy link

bridgekeeper bot commented Sep 8, 2021

@theRealAph This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@theRealAph
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 8, 2021

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

  • a66629a: 8254167: G1: Record regions where evacuation failed to provide targeted iteration
  • 286a1f6: 8273440: Zero: Disable runtime/Unsafe/InternalErrorTest.java
  • 7d24a33: 8273318: Some containers/docker/TestJFREvents.java configs are running out of memory
  • 1513dc7: 8271603: Unnecessary Vector usage in java.desktop
  • ea4907a: 8273047: test jfr/api/consumer/TestRecordedFrame.java timing out
  • 4eacdb3: 8273104: Refactoring option parser for UL
  • 8884d2f: 8273462: ProblemList vmTestbase/vm/mlvm/anonloader/stress/oome/heap/Test.java in -Xcomp mode
  • d6d6c06: 8273246: Amend the test java/nio/channels/DatagramChannel/ManySourcesAndTargets.java to execute in othervm mode
  • 708407e: 8273168: Remove superfluous use of boxing in java.desktop
  • 270a9d9: 8273043: [TEST_BUG] Automate NimbusJTreeSelTextColor.java
  • ... and 580 more: https://git.openjdk.java.net/jdk/compare/357fe09f2e46efa3343f6c8a57b8693dcd5dd43c...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Sep 8, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 8, 2021
@openjdk
Copy link

openjdk bot commented Sep 8, 2021

@theRealAph Pushed as commit 6750c34.

💡 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
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
3 participants