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

8273115: CountedLoopEndNode::stride_con crash in debug build with -XX:+TraceLoopOpts #8178

Closed
wants to merge 1 commit into from

Conversation

rwestrel
Copy link
Contributor

@rwestrel rwestrel commented Apr 11, 2022

The crash occurs because a counted loop has an unexpected shape: the
exit test doesn't depend on a trip count phi. It's similar to a crash
I encountered in (not yet integrated) PR
#7823 and fixed with an extra
CastII:
https://github.com/openjdk/jdk/pull/7823/files#diff-6a59f91cb710d682247df87c75faf602f0ff9f87e2855ead1b80719704fbedff

That fix is not sufficient here, though. But the fix I proposed here
works for both.

After the counted loop is created initially, the bounds of the loop
are captured in the iv Phi. Pre/main/post loops are created and the
main loop is unrolled once. CCP next runs and in the process, the type
of the iv Phi of the main loop becomes a constant. The reason is that
as types propagate, the type captured by the iv Phi and the improved
type that's computed by CCP for the Phi are joined and the end result
is a constant. Next the iv Phi constant folds but the exit test
doesn't. This results in a badly shaped counted loop. This happens
because on first unroll, an Opaque2 node is added that hides the type
of the loop limit. I propose adding a CastII to make sure the type of
the new limit (which cannot exceed the initial limit) is not lost.


Progress

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

Issue

  • JDK-8273115: CountedLoopEndNode::stride_con crash in debug build with -XX:+TraceLoopOpts

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8178

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 11, 2022

👋 Welcome back roland! 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 label Apr 11, 2022
@openjdk
Copy link

@openjdk openjdk bot commented Apr 11, 2022

@rwestrel 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 label Apr 11, 2022
@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 11, 2022

Webrevs

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Good.

@openjdk
Copy link

@openjdk openjdk bot commented Apr 11, 2022

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

8273115: CountedLoopEndNode::stride_con crash in debug build with -XX:+TraceLoopOpts

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

  • ab83bce: 8284661: Reproducible assembly builds without relative linking
  • c5e9719: 8266246: Swing test PressedIconTest.java sometimes fails on macOS 11 ARM
  • 447c2d1: 8284521: Write an automated regression test for RFE 4371575
  • 145dfed: 8284937: riscv: should not allocate special register for temp
  • 87faa85: 8186958: Need method to create pre-sized HashMap
  • 41fc078: 8284112: Minor cleanup could be done in javax.crypto
  • 897d6c0: 8282008: Incorrect handling of quoted arguments in ProcessBuilder
  • ffdeb32: 8284928: Add links from SourceVersion to specific JLS versions
  • d3d71ea: 8284922: Fix some doc-comment issues on methods with package access in JDK API
  • 6e36c45: 8284923: Update description of SourceVersion.RELEASE_18
  • ... and 70 more: https://git.openjdk.java.net/jdk/compare/40ddb7558cd985d49aa5aaedae6c5145ba3d0ac0...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 label Apr 11, 2022
Copy link
Member

@TobiHartmann TobiHartmann left a comment

Nice analysis. Looks good!

@rwestrel
Copy link
Contributor Author

@rwestrel rwestrel commented Apr 25, 2022

@vnkozlov @TobiHartmann thanks for the reviews

@rwestrel
Copy link
Contributor Author

@rwestrel rwestrel commented Apr 25, 2022

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Apr 25, 2022

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

  • c5aa75d: 8285439: remove unused os::fsync
  • 9d9f4e5: 8285437: riscv: Fix MachNode size mismatch for MacroAssembler::verify_oops*
  • 08024d9: 8193543: Regression automated test '/open/test/jdk/java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java' fails
  • a1efb95: 8129827: [TEST_BUG] Test java/awt/Robot/RobotWheelTest/RobotWheelTest.java fails
  • 03cbb48: 8285445: cannot open file "NUL:"
  • e9d604a: 8285431: Assertion in NativeGSSContext constructor
  • 357b1b1: 8242440: use separate, destroyable JavaVM instances per libgraal compiler thread
  • b10833b: 8285303: riscv: Incorrect register mask in call_native_base
  • ce8db2c: 8285394: Compiler blackholes can be eliminated due to stale ciMethod::intrinsic_id()
  • 4e252cf: 8285370: Fix typo in jdk.charsets
  • ... and 155 more: https://git.openjdk.java.net/jdk/compare/40ddb7558cd985d49aa5aaedae6c5145ba3d0ac0...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated label Apr 25, 2022
@openjdk openjdk bot closed this Apr 25, 2022
@openjdk openjdk bot removed ready rfr labels Apr 25, 2022
@openjdk
Copy link

@openjdk openjdk bot commented Apr 25, 2022

@rwestrel Pushed as commit dc63584.

💡 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 integrated
3 participants