Skip to content

8265767: compiler/eliminateAutobox/TestIntBoxing.java crashes on arm32 after 8264649 in debug VMs #3818

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

Closed
wants to merge 2 commits into from

Conversation

huishi-hs
Copy link

@huishi-hs huishi-hs commented Apr 30, 2021

This patch fix failure exposed by JDK-8264649.

compiler/eliminateAutobox/TestIntBoxing.java crashes on arm32 in Compile::check_no_dead_use assertion.
In LoadNode::eliminate_autobox, early "result" is dead after line 1450 but not added into PhaseGVN worklist for optimization.
Its out_cnt is 0. If it isn't removed, will trigger assertion in Compile::check_no_dead_use.

1443             } else if (result->is_Add() && result->in(2)->is_Con() &&
1444                        result->in(1)->Opcode() == Op_LShiftX &&
1445                        result->in(1)->in(2) == phase->intcon(shift)) {
1446               // We can't do general optimization: ((X<<Z) + Y) >> Z ==> X + (Y>>Z)
1447               // but for boxing cache access we know that X<<Z will not overflow
1448               // (there is range check) so we do this optimizatrion by hand here.
1449               Node* add_con = new RShiftXNode(result->in(2), phase->intcon(shift));
                       --- result before is  dead and might not removed
1450               result = new AddXNode(result->in(1)->in(1), phase->transform(add_con)); 
1451             } else 

Detail analysis is in https://bugs.openjdk.java.net/browse/JDK-8265767

@mychris I have verified compiler/eliminateAutobox/TestIntBoxing.java on qemu, it failed with same assertion and now passes with this fix. Would you please help verify it on arm32 machine?

Testing:

  • Passed Tier1-3 on Linux x86_64, release and fastdebug build, default option and -XX:-TieredCompilation.
  • compiler/eliminateAutobox/TestIntBoxing.java on arm32 release/fastdebug/slowdebug

Progress

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

Issue

  • JDK-8265767: compiler/eliminateAutobox/TestIntBoxing.java crashes on arm32 after 8264649 in debug VMs

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3818

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 30, 2021

👋 Welcome back hshi! 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 Apr 30, 2021
@openjdk
Copy link

openjdk bot commented Apr 30, 2021

@huishi-hs 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 Apr 30, 2021
@mlbridge
Copy link

mlbridge bot commented Apr 30, 2021

Webrevs

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

The fix is reasonable.
Add comment // remove dead node later
Pass PhaseIterGVN* igvn instead of eliminate_autobox(PhaseGVN* phase) to simplify code. Note, can_reshape == true only for PhaseIterGVN.

…for simiplification and add comments for previous commit
@huishi-hs
Copy link
Author

The fix is reasonable.
Add comment // remove dead node later
Pass PhaseIterGVN* igvn instead of eliminate_autobox(PhaseGVN* phase) to simplify code. Note, can_reshape == true only for PhaseIterGVN.

@vnkozlov Thanks for your review! All comments are fixed and pass Tier1-3 on Linux x86_64, release and fastdebug build, default option and -XX:-TieredCompilation.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Good.

@openjdk
Copy link

openjdk bot commented May 2, 2021

@huishi-hs 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:

8265767: compiler/eliminateAutobox/TestIntBoxing.java crashes on arm32 after 8264649 in debug VMs

Reviewed-by: kvn, thartmann

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

  • 3544a9d: 8266391: Replace use of reflection in jdk.internal.platform.Metrics
  • 020236c: 8264786: [macos] All Swing/AWT apps cause Allow Notifications prompt to appear when app is launched
  • 45760d4: 8266320: (bf) ReadOnlyBufferException in heap buffer put(String,int,int) should not be conditional
  • ff65920: 8265491: Math Signum optimization for x86
  • 55cc0af: 8266185: Shenandoah: Fix incorrect comment/assertion messages
  • 880c138: 8265349: vmTestbase/../stress/compiler/deoptimize/Test.java fails with OOME due to CodeCache exhaustion.
  • 001c514: 8265322: C2: Simplify control inputs for BarrierSetC2::obj_allocate
  • 194bcec: 8265984: Concurrent GC: Some tests fail "assert(is_frame_safe(f)) failed: Frame must be safe"
  • 1d9ea3a: 8266083: Shenandoah: Consolidate dedup/no dedup oop closures
  • 80941f4: 8234446: Post-CMS workgroup hierarchy cleanup
  • ... and 19 more: https://git.openjdk.java.net/jdk/compare/07ecd421d1538ae53ffbea65eccfa938e19a9f0f...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 (@vnkozlov, @TobiHartmann) 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 May 2, 2021
@mychris
Copy link
Contributor

mychris commented May 3, 2021

Thanks for looking into this issue.
I am currently testing on an ARMv7-A target, and compiler/eliminateAutobox/TestIntBoxing.java is passing now 👍. The whole hotspot tier1 suite will take some time, so I will report back later today, or tomorrow.

@mychris
Copy link
Contributor

mychris commented May 3, 2021

Hi @huishi-hs, hotspot tier1 passes on my ARMv7-A targets.

@huishi-hs
Copy link
Author

@mychris Thanks for help verification!
@vnkozlov Thanks for review!
Does this patch need a second review before integrate?

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

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

Looks good to me too.

@huishi-hs
Copy link
Author

@TobiHartmann Thanks!

@huishi-hs
Copy link
Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label May 4, 2021
@openjdk
Copy link

openjdk bot commented May 4, 2021

@huishi-hs
Your change (at version f25b383) is now ready to be sponsored by a Committer.

@TobiHartmann
Copy link
Member

/sponsor

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

openjdk bot commented May 4, 2021

@TobiHartmann @huishi-hs Since your change was applied there have been 37 commits pushed to the master branch:

  • 05e6017: 8265137: java.util.Random suddenly has new public methods nowhere documented
  • aa90df6: 8266187: Memory leak in appendBootClassPath()
  • b651904: 8266438: Compile::remove_useless_nodes does not remove opaque nodes
  • 141cc2f: 8261527: Record page size used for underlying mapping in ReservedSpace
  • 8e071c4: 8265784: [C2] Hoisting of DecodeN leaves MachTemp inputs behind
  • ce1bc9d: 8266432: ZGC: GC allocation stalls can trigger deadlocks
  • 30ccd80: 8264950: Set opaque for JTooltip in config file of NimbusLookAndFeel
  • cfdf4a7: 8266449: cleanup jtreg tags in compiler/intrinsics/sha/cli tests
  • 3544a9d: 8266391: Replace use of reflection in jdk.internal.platform.Metrics
  • 020236c: 8264786: [macos] All Swing/AWT apps cause Allow Notifications prompt to appear when app is launched
  • ... and 27 more: https://git.openjdk.java.net/jdk/compare/07ecd421d1538ae53ffbea65eccfa938e19a9f0f...master

Your commit was automatically rebased without conflicts.

Pushed as commit ee5bba0.

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

@huishi-hs huishi-hs deleted the 8265767 branch June 4, 2021 02:03
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
Development

Successfully merging this pull request may close these issues.

4 participants