Skip to content

Conversation

@eme64
Copy link
Contributor

@eme64 eme64 commented May 26, 2023

I found this failure with my jasm fuzzer. Have not tried to reproduce it with plain java.

I added the code above the assert, the comments explain why:

if (x->Opcode() == Op_Region) {
// x has not yet been transformed to Loop or LongCountedLoop.
// This should only happen if we are inside an infinite loop.
// It happens like this:
// build_loop_tree -> do not attach infinite loop and nested loops
// beautify_loops -> does not transform the infinite and nested loops to LoopNode, because not attached yet
// build_loop_tree -> find and attach infinite and nested loops
// counted_loop -> nested Regions are not yet transformed to LoopNodes, we land here
assert(x->as_Region()->is_in_infinite_subgraph(),
"x can only be a Region and not Loop if inside infinite loop");
// Come back later when Region is transformed to LoopNode
return false;
}
assert(x->Opcode() == Op_Loop || x->Opcode() == Op_LongCountedLoop, "regular loops only");

Here the graph just before the assert:
image

120 Loop -> need it to kick of beautify_loop and a second build_loop_tree
71 Region -> inifinite loop, NeverBranch is inserted on first build_loop_tree pass. Only attached to loop tree after second build_loop_tree.
x = 81 Region -> looks like a counted loop, but is only attached to the loop tree after beautify_loop in the second build_loop_tree.

Testing up to tier6 and stress testing. Passed.


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-8308749: C2 failed: regular loops only (counted loop inside infinite loop) (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14178

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

Using diff file

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

Webrev

Link to Webrev Comment

@eme64 eme64 changed the title 8308749: failed: regular loops only (counted loop inside infinite loop 8308749: failed: regular loops only (counted loop inside infinite loop) May 26, 2023
@bridgekeeper
Copy link

bridgekeeper bot commented May 26, 2023

👋 Welcome back epeter! 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
Copy link

openjdk bot commented May 26, 2023

@eme64 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 May 26, 2023
@eme64 eme64 changed the title 8308749: failed: regular loops only (counted loop inside infinite loop) 8308749: C2 failed: regular loops only (counted loop inside infinite loop) May 26, 2023
@eme64 eme64 marked this pull request as ready for review May 30, 2023 07:49
@openjdk openjdk bot added the rfr Pull request is ready for review label May 30, 2023
@mlbridge
Copy link

mlbridge bot commented May 30, 2023

Webrevs

* questions.
*/

super public class TestCountedLoopInsideInfiniteLoop
Copy link
Contributor

Choose a reason for hiding this comment

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

May be add comment why you put this into separate file and not make inner class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vnkozlov Is that even possible, to make jasm code inside a java file? I just repeated the pattern of other jasm tests in the same directory.

Copy link
Contributor

Choose a reason for hiding this comment

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

My bad. Missed that it is jasm.

* questions.
*/

super public class TestCountedLoopInsideInfiniteLoop
Copy link
Contributor

Choose a reason for hiding this comment

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

My bad. Missed that it is jasm.

@openjdk
Copy link

openjdk bot commented Jun 1, 2023

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

8308749: C2 failed: regular loops only (counted loop inside infinite loop)

Reviewed-by: kvn, chagedorn

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

  • 3981297: 8309703: AIX build fails after JDK-8280982
  • 16c3d53: 8308603: Removing do_pending_ref/enclosing_ref from MetaspaceClosure
  • b94b679: 8309627: Incorrect sorting of DirtyCardQueue buffers
  • aace3dc: 8309760: ProblemList serviceability/jvmti/vthread/FollowReferences/VThreadStackRefTest.java#default with ZGC
  • 80edd5c: 8294985: SSLEngine throws IAE during parsing of X500Principal
  • bdd81b3: 8304885: Reuse stale data to improve DNS resolver resiliency
  • beec734: 8309692: Fix -Wconversion warnings in javaClasses
  • 7d82479: 8309142: Refactor test/langtools/tools/javac/versions/Versions.java
  • f5ec93e: 8309745: Problem list open client tests failing on Ubuntu_23.04
  • cee5724: 8309727: Assert privileges while reading the jdk.incubator.vector.VECTOR_ACCESS_OOB_CHECK system property
  • ... and 285 more: https://git.openjdk.org/jdk/compare/eb11508eff7b2e01b8942f4cda9fb01527a860b5...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 Jun 1, 2023
Copy link
Member

@chhagedorn chhagedorn 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!

@eme64
Copy link
Contributor Author

eme64 commented Jun 12, 2023

Thanks @vnkozlov @chhagedorn for the reviews!
/integrate

@openjdk
Copy link

openjdk bot commented Jun 12, 2023

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

  • f5cbe53: 8027711: Unify wildcarding syntax for CompileCommand and CompileOnly
  • 4d66d97: 8309549: com/sun/tools/attach/warnings/DynamicLoadWarningTest.java fails on AIX
  • 3981297: 8309703: AIX build fails after JDK-8280982
  • 16c3d53: 8308603: Removing do_pending_ref/enclosing_ref from MetaspaceClosure
  • b94b679: 8309627: Incorrect sorting of DirtyCardQueue buffers
  • aace3dc: 8309760: ProblemList serviceability/jvmti/vthread/FollowReferences/VThreadStackRefTest.java#default with ZGC
  • 80edd5c: 8294985: SSLEngine throws IAE during parsing of X500Principal
  • bdd81b3: 8304885: Reuse stale data to improve DNS resolver resiliency
  • beec734: 8309692: Fix -Wconversion warnings in javaClasses
  • 7d82479: 8309142: Refactor test/langtools/tools/javac/versions/Versions.java
  • ... and 287 more: https://git.openjdk.org/jdk/compare/eb11508eff7b2e01b8942f4cda9fb01527a860b5...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jun 12, 2023

@eme64 Pushed as commit 6c3e621.

💡 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

Development

Successfully merging this pull request may close these issues.

3 participants